且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SAP CRM One Order header extension的缓存机制设计原理

更新时间:2022-09-05 23:17:14

In one of my previous blog A small tip to analyze code by code and export to markdown format it is introduced that the following header extension are supported in One order read function module CRM_ORDER_READ.


SAP CRM One Order header extension的缓存机制设计原理

When the given header extension is read via CRM_ORDER_READ, take OPPORT_H for example:

SAP CRM One Order header extension的缓存机制设计原理

The calling hierarchy could be found from below:

SAP CRM One Order header extension的缓存机制设计原理

Every header extension has one corresponding read function module acting as entry point for read which will be called by CRM_ORDER_READ_OW with naming convention CRM_READ_OB. In OB ( object buffer ) read function module, the corresponding object buffer is evaluated. If object buffer is not hit for current read, another DB read function module ( CRM_READ_DB is called. Within this DB read function module, another internal table which represents Database buffer is evaluated again. The real read access on database table is only performed when this second fold buffer check fails.


Take OPPORT_H read for example, I draw a picture to demonstrate this two-fold buffer evaluation logic:

SAP CRM One Order header extension的缓存机制设计原理

In the runtime, OPPORT_H object buffer could be monitored in the context of CRM_OPPORT_H_READ_OB,

SAP CRM One Order header extension的缓存机制设计原理

and database buffer in CRM_OPPORT_H_READ_DB accordingly.

SAP CRM One Order header extension的缓存机制设计原理

The object buffer is declared in function group CRM_OPPORT_H_OB:

SAP CRM One Order header extension的缓存机制设计原理

and database buffer is defined in function group CRM_OPPORT_H_DB:

SAP CRM One Order header extension的缓存机制设计原理

Further reading

I have written a series of blogs to explain how One Order API works. The blogs are written based on a simple scenario: read, change and save field “Closing Date” in Opportunity header level.


Buffer logic in One Order header extension Read


Change Scenario


CRM_ORDER_MAINTAIN


|- CRM_ORDER_MAINTAIN_MULTI_OW


|- CRM_ORDER_MAINTAIN_SINGLE_OW


|- CRM_ORDER_H_MAINTAIN_OW


|- CRM_OPPORT_H_MAINTAIN_OW


|- CRM_OPPORT_H_CHANGE_OW


|- CRM_OPPORT_H_READ_OB


|- CRM_OPPORT_H_FILL_OW


|- CRM_OPPORT_H_CHECK_OW


|- CRM_OPPORT_H_PUT_OB


|- CRM_OPPORT_H_PUBLISH_OW


Save Scenario


CRM_ORDER_SAVE


|- CRM_ORDER_SAVE_OW


|- CRM_EVENT_SET_EXETIME_MULTI_OW


|- CRM_OPPORT_H_SAVE_EC


|- CRM_ORDER_TABLE_SAVE


|- CRM_OBJECT_NAMES_DETERMINE


|- CRM_ORDER_UPDATE_TABLES_DETERM


|- CRM_ORDER_SET_OBJECTS_TO_SAVE


CRM_OPPORT_H_UPDATE_DU


Create Scenario


CRM_ORDER_MAINTAIN


|- CRM_ORDER_MAINTAIN_MULTI_OW


|- CRM_ORDER_MAINTAIN_SINGLE_OW


|- CRM_ORDER_H_MAINTAIN_OW


|- CRM_ORDERADM_H_MAINTAIN_OW


|- CRM_ORDERADM_H_CREATE_OW


|- CRM_OPPORT_H_MAINTAIN_OW


|- CRM_OPPORT_H_READ_OB


|- CRM_OPPORT_H_CREATE_OW


|- CRM_OPPORT_H_CHANGE_OW