Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding new data segment dynamically in ORDERS05 (Inbound) for sales order

Former Member
0 Likes
800

Hi Experts

I need to update existing sales order though inbound idoc. First I need to compare IDOC with sales order, if sales order has 3 line items but IDOC have 2 line items. In that case I have to delete third line item from sales order. For that I m thinking is, at the time of IDOC processing; add new data segment for this line item with action “003”. So that it will delete that. But I don’t know how to add segment dynamically.

I am using basic order type “ORDERS05” with message type “ORDCHG” and the FM which will process this IDOC is “IDOC_INPUT_ORDCHG”. Please suggest me how to achieve this?

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
575

Technically you shouldn't have to do any of this. The IDoc must have the correct information in it - there is an 'action' qualifier for each line item and it must say whether the line has to be deleted, changed or added. All the determination should be done before the IDoc creation IMHO...

Hi Experts

I need to update existing sales order though inbound idoc. First I need to compare IDOC with sales order, if sales order has 3 line items but IDOC have 2 line items. In that case I have to delete third line item from sales order. For that I m thinking is, at the time of IDOC processing; add new data segment for this line item with action “003”. So that it will delete that. But I don’t know how to add segment dynamically.

I am using basic order type “ORDERS05” with message type “ORDCHG” and the FM which will process this IDOC is “IDOC_INPUT_ORDCHG”. Please suggest me how to achieve this?

2 REPLIES 2
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
576

Technically you shouldn't have to do any of this. The IDoc must have the correct information in it - there is an 'action' qualifier for each line item and it must say whether the line has to be deleted, changed or added. All the determination should be done before the IDoc creation IMHO...

Read only

0 Likes
575

Thanks Jelena for your response. But in this scenario business require changing the IDOC after creation but before processing because IDOC is coming from outside

Is there any way to change IDOC before creating in SAP?

In general is it advisable to change IDOC at runtime (While processing) ?