Application Development 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: 

Segment Addition for Inbound IDoc using ABAP Statement

Former Member
0 Kudos

Hi ABAP Experts,

I want to add additional standard segments (ex: E1EDK14 with other qualifiers for Basic type ORDERS05) at parent level as well as child level;using ABAP code.

I have tried using ABAP Statement 'INSERAT' at specfic sy-tabix, and updating IDOC data record (internal table ) in source code and finally i am calling function module 'IDOC_INPUT_ORDERS' to create sales order. When i process idoc using WE19 tranaction code .....idoc is going to create  when i am going to check idoc segemnts using WE02 tranaction code,Segemnts are not visiables.

Thanks in advance

Vinay

3 REPLIES 3

TMNielsen
Contributor
0 Kudos

Hi Vinay

You write that you use insert statement in source code, but where ?

Maybe you have the same solutions as we have in a number of IDOC scenarios.

We have a lot of scenarios using SAP standard IDOC handlers, but in classic enhancements (via transaction CMOD) we modify or extend the idoc data.

These data modifications are temporary and will not afterwards be visible in WE02. I guess the enhancements are called after the IDOC is read from database, but before the idoc data is "handled" by the idoc handler, and that the modified/extended IDOC data is not written back to the database.

If the update is working correctly, then this behaviour is not a problem - or is it?

Best regards

Thomas

Former Member
0 Kudos

Hi Thomas,

Thanks for responce.

Please find answers which have been raised by you :

1- You write that you use insert statement in source code, but where ?

> I have written in Z-Process code function module while processing IDoc.

2- We have a lot of scenarios using SAP standard IDOC handlers, but in classic enhancements (via transaction CMOD) we modify or extend the idoc data.

> I wanted to extend idoc (with SAP Std. Parent and Child segment) using custom function module not via customer-exit.

3- If the update is working correctly, then this behaviour is not a problem - or is it?

> I am agree with yours answer, but i was thinking in future if some problem take place for IDOC due to some segement data (Status with RED),how can another person would analysed what data is passing ,as i alreday updated when i go and see via WE02 tranaction code segments are not visiable what i have insearted via Z-function module.

kindly confirm me .

Thanks

Vinay

0 Kudos

Hi Vinay

Ok so this is what I understand: Your Z-idoc handler is handling the IDOC already created. In this Idoc handler you will read the segments into an internal table and process the IDOC. During this process you modify or extend the data in SAP standard segments, but only in the internal table.

One way to make the data changes persistent is by function modules:

EDI_DOCUMENT_OPEN_FOR_EDIT

EDI_CHANGE_DATA_SEGMENT

EDI_DOCUMENT_CLOSE_EDIT

Best regards Thomas