This blog post describes the steps to extend the SAP S/4HANA Cloud to meet the Japan Subcontract Act requirement. The extension scenario can be implemented using Custom Fields and Logic App, Custom CDS Views App and Custom Analytical Queries App.
Subcontract Act Business Process
Before we go into the details of the extension scenario, let’s understand the Subcontract Act in Japan.
Japanese law requires that companies protect the interests of suppliers (subcontractors) who have a lower capital fund than the main contractor. This is to protect the subcontractors against bankruptcy and late payments. This law is applicable to subcontractors involved in the domestic trade of materials and services.
At periodic intervals, Japanese companies must declare to the legal authorities that they have been following fair trade practices guidelines in their dealings with the subcontractors. They declare this by answering a questionnaire sent by the authorities.
You have administrative access to SAP S/4HANA Cloud and have implementation experience on the system. This extension requires experience in working with Custom Fields and Logic App and Custom CDS View App and Custom Analytical Queries App
Customers using the standard SAP S/4HANA Cloud solution for Japan must be able to do the following:
- Identify purchase orders that are relevant from a Subcontract Act point of view.
- Generate a list of purchase orders that are subcontract act relevant to assess if there any inequalities in the trade.
Using the in-app extensibility you can do the following:
- Create a custom code list with values applicable and not applicable at the purchase order item level to identify purchase order as relevant for the subcontract act.
- Create a Subcontract Transaction report to monitor the purchase order details that are relevant to the subcontract act.
The scope of this extension is limited to SAP S/4HANA Cloud. This extension scenario is valid for the Manage Purchase Order App and does not support the mass upload of purchase orders.
Extend purchase order to identify Subcontract Act relevant items
- Open Custom Fields and Logic app and add a new custom field of Type: Code List in the Procurement: Purchasing Document Item Business Context.
- Enable the custom field in the desired UI’s and for the business scenario – Purchase Order to Delivery on item level. Publish the field.
- Enable the field on the UI by navigating to the settings field on the right and include the Subcontract Act field.
Create Custom CDS View with purchase order and subcontract Act details
As a first step to the creation of the analytical report, we need to create a query that provides purchase order data including the subcontract act relevant extension and the supplier details. To develop the query, we need a data source that contains all the purchase order details, supplier ID, supplier name, and material name.
The purchase order details can be found in the I_PurchaseOrderItemAPI01 released view. However, there are fields such as Material Name and Supplier Name that are not available. Therefore, for the Material Name, we will create an association in the CDS View definition and for Supplier Name, we will create another basic custom CDS View, which will be associated to the main custom CDS View.
Create the simple custom CDS View to extract Supplier name
- Select Custom CDS Views app and create a new Standard CDS View
- Choose the primary data source – I_PurchaseOrderAPI01
- Add the associated data source I_Supplier and set the cardinality of the association and the join condition for I_Supplier.
4. As there is no need for parameters for this CDS View, we’ll move on to the elements section and choose the elements to be displayed in the view. A new element can be added by selecting the “Add” option.
5. The configuration for this basic custom CDS View is done, now select “Check” and then “Publish” and then we can move forward to the next steps.
Now let’s move on to the creation of the main CDS View.
Create the main CDS View to extract the purchase order, supplier and material details
- Select Custom CDS Views app and create a new Analytical cube -YY1_PurchaseOrderITemCube.
- Choose the primary data source I_PurchaseOrderItemAPI01.
- Add the associated data sources VDMDEMO_I_MaterialText and YY1_PurchaseOrderSupplier.
- Set the cardinality of the association VDMDEMO_I_MaterialText as Zero or More [0..*] and set the join condition as Material equal to I_PurchaseOrderItemAPI01.Material.
- Set the cardinality of the association YY1_PurchaseOrderSupplier as Zero or One [0..1] and set the join condition as PruchaseOrder equal to I_PurchaseOrderITemAPI01.PurchaseOrder.
Note: This CDS View will be used as a source for an analytical query. The end-user that runs the analytical query will need data specifically filtered for company code and purchasing organization. Therefore, we need to add 2 CDS View parameters, the Company Code, and the Purchasing Organization.
6. Move on to the elements section and choose the elements to be displayed in the view. A new element can be added by selecting the “Add” option. Here, we are selecting all the elements that need to be available in the report. As you are choosing fields from associations, the system may add extra fields to your element selection in order to respect the association conditions.
7. Moving to the next step – Element Properties, set the aggregation values for the CDS View measures.
8. As we’ve set the company code and purchasing organization as CDS View parameters, we need to add them to the filtering conditions.
9. The configuration for the main custom CDS View is done, now select “Check” and then “Publish” and then we can move forward to the next steps.
Create the Subcontract Transaction Report using the CDS view
To create the subcontract transaction report, we need to create an analytical query using the PurchaseOrderItemCube CDS view which we developed in the previous step. This analytical query will be used to create the report.
Create Custom Analytical Query
- Open the Custom Analytical Queries app. Create a new Analytical Query using the data source YY1_PurchaseOrderITemCube and maintain the query label.
- Select all the fields available in the field selection and specify the fields that need to be displayed.
- Set the filters as follows: Purchase Order Date (as mandatory input filter), Supplier (optional input filter), Material (optional input filter), Subcontracting Relevant (optional input filter). The company code and purchasing organization will come as input filters automatically because we’ve set them as parameters in the custom CDS View YY1_PurchaseOrderItemCube.
4. Save Draft and preview the query.
5. Add totals to the result.
Create the Report
Save the query as tile and add it to a group.