In some scenarios only updates of hierarchical data are allowed. For example, a Sales Order and a Sales Order Item can only be created together and at the same time, not independently on their own. For this OData Channel provides a deep insert functionality: a basic deep insert feature is offered to provide the possibility to the application to create single entities deeply. In addition, deep entities can be created in one activity.
When using deep insert the data need to be nested, that is, a deep structure is expected.
Deep Insert support is only guaranteed for scenarios which are handled fully by the application.
For deep insert interface /IWBEP/IF_MGW_APPL_SRV_RUNTIME provides method CREATE_DEEP_ENTITY.
The process is as follows:
The SAP Gateway framework extracts the expand expression out of the payload (inlined data).
Data is send to backend.
Method CREATE_DEEP_ENTITY is called.
The application uses /IWBEP/IF_MGW_ODATA_EXPAND to validate whether the given expand can be handled.
Initial Handling for Deep Insert
When deep insert is used the backend framework returns the "inline" data to the hub framework in the form of a table containing a flag which shows whether an “inline” structure is initial or not. Thus you can see whether this "inline" data is initial or not.