Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
Showing results for 
Search instead for 
Did you mean: 
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.

To read the blog in Japanese, follow the link.

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

Localization Challenge

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.

Solution Approach

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.

Implementation Steps

Extend purchase order to identify Subcontract Act relevant items

  1. Open Custom Fields and Logic app and add a new custom field of Type: Code List in the Procurement: Purchasing Document Item Business Context.

  2. Enable the custom field in the desired UI’s and for the business scenario – Purchase Order to  Delivery on item level. Publish the field.

  3. 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

  1. Select Custom CDS Views app and create a new Standard CDS View

  2. Choose the primary data source – I_PurchaseOrderAPI01

  3. 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

  1. Select Custom CDS Views app and create a new Analytical cube -YY1_PurchaseOrderITemCube.

  2. Choose the primary data source I_PurchaseOrderItemAPI01.

  3. Add the associated data sources VDMDEMO_I_MaterialText and YY1_PurchaseOrderSupplier.

  4. 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.

  5. 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

  1. Open the Custom Analytical Queries app. Create a new Analytical Query using the data source YY1_PurchaseOrderITemCube and maintain the query label.

  2. Select all the fields available in the field selection and specify the fields that need to be displayed.

  3. 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.


After successfully implementing this scenario, customers can use the Subcontract Transaction Report to monitor the Subcontract Act relevant purchase orders at regular intervals to ensure they follow fair trade practices with their domestic subcontractors.