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: 

creating a user exit

Former Member
0 Kudos

Dear experts,

how can we create a userexit that adds an additional segment to the IDOC whenver an inbound IDOC is triggered from the external system.

thanks in advance

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Usually additional segments never adds to inbound IDoc. As per your requirement

bank address has already available in the system, then why adding to inbound IDoc?

If you want to send it back the same data, then add the segment at the time of outbound.

aRs

4 REPLIES 4

Former Member
0 Kudos

That depends on what is your inbound process code / function module. We don't modify the generic inbound triggering process which is common. We modify the specific Idoc generating module and the user-exit will depend on it - generally you have one user-exit repetitively called at header, item, before and after save etc.

0 Kudos

Dear friend,

my requirement is the following

create a user exit, which is triggered when an inbound IDoc is triggered by an external system, which adds additional segment, which has information about the physical address of the bank to the IDoc.

thanks.

Former Member
0 Kudos

Hi,

You normally add the additional segment in the outbound idoc. I have never seen or heard adding additoinal segment using user-exit in inbound idoc.

First, even though you add additional segments in IDOC, before posting whatever document it suppose to post, it checks the IDOC segment agains it definition. If additional segments exist then it thorws the error and document does not post.

Second, if you add additional segments, how you are planning to pass those details into document. The IDOC function module does not take care of these fields.

If you want additional segment, what you need to do is first create extension idoc of basic idoc. For this follow these steps.

Here for example you have basic idoc INVOIC02 and you want to add additional segments at header level - ZZE1EDK01 and line item level ZZE1EDP01

1. T.Code - WE31 : Create custom segments ZZE1EDK01 and ZZE1EDP01 with the fields you want and release these segments.

2. T.Code - WE30 : Create extension IDOC

- In WE20 enter extension IDOC name - ZZINVOIC02, select "Extension" option and hit "create" button. When it gives pop-up, select "create new" and enterd linked basis type as "INVOIC02". Enter proper description and save.

3. On the next screen of WE30, select the segment under which you want to add your additional segment. Save everything.

4. T. Code - WE82. Here you message extension idoc to basic idoc and message type.

- Go into change mode. Hit "New entries button" Enter Message type = "INVOIC", basic type = "INVOIC02" and extension type = "ZZINVOIC02".

You add these additional segments and data into your middleware itself. Even though you fill these segment with data, you cannot pass them to document without customizing the function module too.

Let me know what message type, process code, idoc type you are using and what you are trying to achieve. I may be able to help you then.

Regards,

Pratik Shah

former_member194669
Active Contributor
0 Kudos

Usually additional segments never adds to inbound IDoc. As per your requirement

bank address has already available in the system, then why adding to inbound IDoc?

If you want to send it back the same data, then add the segment at the time of outbound.

aRs