cancel
Showing results for 
Search instead for 
Did you mean: 

Delete bapi wrapper with multi node object

Former Member
0 Kudos

In delete bapi wrapper how do I discover if only the subnode was deleted ?.

Because the user can delete operation of the orderm and operation is subnode of object Orderm.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

OK, as you always have really helped me. But How do I find out what was the TASK (deletion, modification)? Is there any parameter that is passed along the call of bapiwrapper for this?

Could you send me an example of where bapiwrapper deletion occurs in children we please?

Thanks

rohith_deraje
Advisor
Advisor
0 Kudos

Hi esoliveira ,

Ex: OrderHeader (Root)

--- OrderItems (Child level1)

-


OrderSubItems (Child level2)

In this scenario, MODIFY will be called when

1--> Root is updated

2--> Child1 is updated/Deleted.

3--> Child2 is updated/Deleted.

Ex: When you delete OrderSubItems(Child2) on client and sync, DOE will call MODIFY BAPI pasing only OrderHeader(Root) and OrderItems(child level1). Your MODIFY BAPI should have code/logic to upate Root,OrderItems and delete OrderSubItems.

Only when you delete OrderHeader on client and sync, DOE will call call the DELETE BAPI by passing the primary key of root(OrderHeader). Your DELETE BAPI should have the logic to clean the child tables (OrderItems and OrderSubItems) and then delete the root(OrderHeader) in the Backend.

Regards

Rohith

sivasatyaprasad_yerra
Active Contributor
0 Kudos

Your bapi wrapper should work as follows:

1. DOE will send modified details to Backend system by invoking MODIFY bapi wrapper.

2. Bapi wrapper should get current image of the record from Backend system by querying for current key.

3. Find the difference between step 1 & step 2.

4. Based on this, you will know whether the child item is insert / update / delete.

sivasatyaprasad_yerra
Active Contributor
0 Kudos

Delete Bapi Wrapper will only be invoked only when entire record is deleted which means root node entry is deleted.

Otherwise Modify Bapi wrapper will be invoked with the TASK in each of the subnode which specified whether the item is deleted / modified / inserted.