Technical Articles
CRM One Order Model Redesign in S4HANA for Customer Management 1.0 – Part 2
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.


Jerry’s other blogs on S/4HANA for Customer Management
- S/4HANA for Customer Management 1.0 introduction from technical point of view
- CRM One Order Model Redesign in S/4HANA for Customer Management 1.0 – Part 1
- CRM One Order Model Redesign in S/4HANA for Customer Management 1.0 – Part 2
- Create Mass Products by code in S/4HANA for Customer Management
- Create Mass Service document in S/4HANA for Customer Management
- One order extensibility in S4HANA for Customer Management
Hello Jerry Wang !
Thanks a lot for your insights on the new CM module of S/4 HANA!
You are stressing the fact that there will be only one flat table CRMS4D_SERV_H for the order headers (and CRMS4D_SERV_I for items) and all old SAP CRM tables are added as an include structure to this one table. I'm asking myself how this is working with 1:n relations like Dates, Partners, Status, etc. where at the moment we have a Set which links the n entities to one order. According to your description I would expect now a duplication of lines in the flat table but this can't be true as the key of this table consists of CLIENT, OBJTYPE and OBJECT_ID.
On the other hand you are showing in your first blog post a screenshot of the CRMS4_ORDER package where we can see several additional tables for objects like PARTNER (CRMS4D_PARTNER / CRMS4C_PARTNER). Could you please detail a bit more how the data is stored on DB level?
Thanks a lot!
Conrad
Hi Conrad,
Thanks a lot for your reading and comments! Yes for your question regarding Dates, Partners and Status, we internally call them "Complex Set" which indeed needs some additional treatment in harmonized One order data model. I will try to find some time to introduce them in detail.
Best regards,
Jerry
Hi Conrad,
I have written some blogs to answer your questions:
Best regards,
Jerry
Hi Jerry,
thanks for your very helpful blog series!
Are there released CDS views for the one order model (or BTW for S/4HANA for Customer Management in general) already?
If not, is this planned? If yes, what timeframe? If no, what API do you recommend for S/4HANA for Customer Management?
Regards,
Wolfgang
Hi Wolfgang,
You can find all 23 CDS views developed for S4CRM 1.0 under package CRMS4_REPORT:
Best regards,
Jerry
Hi Jerry,
are these released/whitelisted views?
Thanks,
Wolfgang
Hi Jerry, excellent blog, I have to create an standar job crm using CRM_ORDER_MAINTAIN, do you have any code to do that? Do I need to fill all the structures ? thanks