Financial Management Blogs by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
cancel
Showing results for 
Search instead for 
Did you mean: 
KatherineW
Product and Topic Expert
Product and Topic Expert

Introduction

You might already know that you can store references to related data, such as external documents, in SAP Subscription Billing by defining custom references. But did you know that you can transfer those custom references to Sales Billing in SAP S/4HANA Cloud and display them on customer invoices? In this blog we’ll walk you through the steps to set this up. 

Example Use Case

You want to enter purchase order references in subscriptions and include those references in the items of billing document requests so the references can be displayed on invoices generated in SAP S/4HANA Cloud. 

Before we dive into the setup, here’s a short summary of the concepts: 

Custom References and Custom Fields

  • Billing data in SAP Subscription Billing includes custom references that originate in subscriptions or in customer or product data.  
  • Custom references from SAP Subscription Billing can be mapped to custom fields in SAP S/4HANA Cloud, as we’ll describe in this blog post.  

To find out more, browse the following documentation on the SAP Help Portal: 
Custom References | Custom Fields

Custom Integration Flows in SAP Cloud Integration

SAP provides standard integration flows that define aspects such as mapping and routing for data integrations. As a customer or partner, you can extend these integration flows, for example to adapt the way data is replicated or to include additional data in replication. If you want to dig into the details of custom integration flows, refer to Integration Flow – Concepts on the SAP Help Portal. 

For our example, we’ll show how to extend the integration flow used to transfer bills from SAP Subscription Billing to SAP S/4HANA Cloud. 

  

Configuration Steps

  1. Configure custom fields in SAP S/4HANA Cloud.
  2. Define and use custom references in SAP Subscription Billing.
  3. Extend the standard integration flow in SAP Cloud Integration.
  4. Check that the integration is working correctly.

1. Configure custom fields in SAP S/4HANA Cloud

Create a custom field

To create a customer field, you need a role with all the following business catalogs:

  • SAP_CORE_BC_EXT_BLE
  • SAP_CORE_BC_EXT_FLD
  • SAP_CORE_BC_EXT_FLEX

Open the Custom Fields app and create a custom field Purchase Order. The business context must be Sales: Billing Document Item (SD_BILLINGDOCITEM).

1_1_CustomFields_AddField.jpg

1_2_PurchaseOrder2.jpg

 1_2_PurchaseOrder1.jpg

 Adapt the user interface to show the new custom field
  1. In the Manage Billing Document Requests app, display a billing document request. Choose the billing document request number to navigate to the Billing Document Requests app. Choose the user option to adapt the UI:1_2_1_AdaptUI.jpg

  2. Search for the field Purchase Order and select it:
    1_2_2_AdaptUI.jpg

  3. The field Purchase Order appears on the billing document request item:
    1_2_3_AdaptUI.jpg

 

2. Define and use custom references in SAP Subscription Billing

  1. Open the Manage Business Configuration app, go to Custom References and define a custom reference for the purchase order. Enable the field for subscriptions and bill items: 2_BusConfig.jpg
  2. Open the Manage Subscriptions app, open a subscription, and navigate to Custom References. Find the custom reference type Purchase Order and enter a purchase order ID/number:
    2_Subscription.jpg
  3. When a bill is generated for the subscription, the bill item contains the custom reference for the purchase order:
    2_Subscription.jpg

 

3. Extend the standard integration flow in SAP Cloud Integration

To modify the message mapping of the standard integration flow to include the purchase order field, the following steps are required in SAP Cloud Integration: 

  1. Download the standard message mapping 
  2. Check the post-exit processing in the standard integration flow
  3. Create a custom integration flow
  4. Enable the extension in the standard integration flow 
Download the standard message mapping

Start by downloading the standard message mapping from the standard integration flow Transfer Bills to SAP S4HANA Cloud. You need the message mapping to add it your custom integration flow later, where you can modify the mapping.

3_1_DownloadMapping.jpg

Check the post-exit processing in the standard integration flow

3_2_PostProcessingStep.jpg

In the post-exit processing step (Post Processing), display the details of the Bundle Message step: 

3_3_MessageBody.jpg

 This step creates a new payload that contains the following: 

  • The original bill and customer payload 
  • The message mapping output

This payload will be passed from the standard integration flow to your custom integration flow. To find out more about post-exits, see Customer Exits in the SAP Cloud Integration documentation. 

Create a custom integration flow
  1. Create a custom integration flow with the ProcessDirect adapter and configure an address:3_4_CustomIFlow_Address.jpg

    Next we’ll customize the post-exit integration flow.

  2. Enter the following namespace mapping: 
    xmlns:ns1=http://sap.com/xi/XI/SplitAndMerge
    3_5_CustomIFlow_NamespaceMapping.jpg
  3. Add a filter to get the original bill response, which is the source of the message mapping: 3_6_CustomIFlow_Filter.jpg
  4. Upload the message mapping from the standard integration flow:

    3_7_CustomIFlow_MessageMapping.jpg
  5. Download the latest WSDL file from the communication arrangement SAP_COM_0095 and upload it to the custom integration flow:

    3_8_CommsArrangmentWDSL.jpg

    3_9_CommsArrangmentWDSL.jpg

  6. Modify the message mapping in the custom integration flow for the purchase order field. Map the custom reference ID to it:
    3_9_MessageMapping.jpg

     

  7. Deploy the custom integration flow. 
Enable the extension in the standard integration flow
  1. Configure the standard integration flow:

    3_91_CustomIFlow_Implemented.jpg

    3_92_CustomIFlow_ReceiverAddress.jpg

     ℹ️ The address must be the same as the address configured in the custom integration flow.

  2. Deploy the standard integration flow. 

4. Check that the integration is working correctly 

After the next transfer of billing data to SAP S/4HANA Cloud, you see a reference to the subscription billing document request in the Manage Billing Data app:

4_SBDR.jpg

When you click on the document ID, you jump into the billing document request item, where you can see that the purchase order is displayed:4_BillDocRequestItem.jpg

🏁You've now completed the setup and can include custom references in your customer invoices. 

More Information