Skip to Content
0

OData service for Document Creation with Header and Items (CREATE_DEEP_ENTITY)

Apr 09, 2017 at 09:25 PM

145

avatar image

I'm learning about OData services and Fiori implementation in general. I'm at a step where I should create a simple service for creation of a single document at a time, composed of Header and Items (a purchase requisition, achievable by calling BAPI_PR_CREATE).

So far, i've seen numerous examples and read quite a LOT of blogs and answers.

If I get it right, since Header and Item are separate entities, but SEGW generation options (mapping) are tied to a single Entity Set at a time, I'm forced to implement entirely manually the CREATE_DEEP_ENTITY method (as indicated in https://archive.sap.com/documents/docs/DOC-22305 -quite old- or https://blogs.sap.com/2016/08/01/odata-service-to-create-pr-in-park-status-with-attachment-at-item-level/). Am I correct?

If so, could you explain to me the benefits of service generation and the use case? Since most SAP documents are composed of Header and Items (orders, requisitions, invoices, etc.), in which case would I generate a service by mapping i.e. for Header or 1 Item only?

Also, I know that the basic call sequence for CREATE_DEEP_ENTITY should be:

1. io_data_provider->read_entry_data

2. map request data to BAPI parameters

3. call BAPI

4. commit

5. call copy_data_to_ref to fill ER_DEEP_ENTITY.

But does the framework have some support for this CREATE_DEEP_ENTITY, for example a "pattern" to start off? I haven't found an option. Since generated methods do some additional handling (RFC / local destination, error handling by /iwbep/if_sb_dpc_comm_services), I understand I should manually do that as well, yet the examples don't.

Thanks!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers