CRM and CX Blogs by SAP
Stay up-to-date on the latest developments and product news about intelligent customer experience and CRM technologies through blog posts from SAP experts.
Showing results for 
Search instead for 
Did you mean: 
In previous blog CRM One Order Model Redesign in S/4HANA for Customer Management 1.0 – Part 1 I have illustrated how One Order read scenario work under new persistence model in S/4HANA for Customer Management. In this blog let's explore the write scenario ( order create, update and save ).

I will use the source code introduced in blog Create Mass Service document in S/4HANA for Customer Management to create a new Service Order by ABAP code.

As you see in the source code, the way to create Service Order by One Order API in S/4HANA for Customer Management is EXACTLY the same as what you have done in SAP CRM.

In below example I have also created related data like Sales and Service Organization unit, involved partners and order line items, appointment etc. Such kinds of data are still passed into CRM_ORDER_MAINTAIN via the corresponding importing parameters for each component( it_schedlin_i, it_partner, it_orgman... ), however inside One Order API, these business data spread over these importing parameters will be again FLATTENED and stored in the flat table CRMS4D_SERV_H.

I would like to call the data stored in the importing parameter of CRM_ORDER_MAINTAIN as data in "CRM format" and data to be stored in CRMS4D_SERV_H as in "S4 format". Again it is the set of converter classes mentioned in CRM One Order Model Redesign in S/4HANA for Customer Management 1.0 – Part 1 which are responsible for such format conversion.

Since I have created corresponding data for Organization Unit, so set a breakpoint in the method CONVERT_10_TO_S4 in its converter class:

Compare the difference of CRM_ORDER_SAVE_OW in these two offerings:

From callstack it is easily observed how method CONVERT_10_TO_S4 is called:

You could consider the variable cs_workarea in line 99 as an empty container with 40 buckets. In each loop every component's converter class inserts its specific data to the corresponding bucket, as explained in the second step in picture below. So after the loop is executed, the container is full of data and ready to be persisted by update function module.