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

Need to populate segment in E1ADRM1

Former Member
0 Likes
5,627

Hi Gurus,

I am new to Idocs.

My issue is : In the segment E1ADRM1 there are two qualifer i.ee E1ADRM1 WE and E1ADRM1 LF .but in my case only E1ADRM1 WE is coming but not the second one for which the idoc is failing.

I need to add the logic of appending E1ADRM1 LF

4 REPLIES 4
Read only

Former Member
0 Likes
2,843

Hi,

if it is a business issue then you should look why the LF Partner is missing.

If you need to add some records in the IDoc then look for the relevant Exit or use BADI:IDOC_DATA_INSERT

But take care of this BADI. You have to restrict your processing of this BADI by the use of partner and idoc type or some other fields. This BADI willbe processed for EVERY CREATED IDoc !

Edited by: Gordon Breuer on Oct 27, 2008 11:19 AM

Read only

0 Likes
2,843

Hi,

This scenario is for Inbound Idoc.the message type is PROACT and the basic type is PROACT01.

`The Technical detailed design includes making modifications in the Function Module IDOC_INPUT_PROACT through SAP supplied Customer Function CUSTOMER-FUNCTIONu2019002u2019 which maps to User Exit FM EXIT_SAPLWVMI_002.

Two data needs to be populated to the segments E1ADRM1 and E1ADRE1.

In the segment E1ADRM1 we need to populate:

u2022 E1ADRM1-PARTNER_Q u2013 this will be constant u201CLFu201D

u2022 E1ADRM1- PARTNER_ID u2013 the value of E1ADRM1-PARTNER_ID is taken which is

already present in the IDOC (for Partner qualified u2018WEu2019).This value is passed as key to the

read the table KNA1-KUNNR to fetch KNA1_LIFNR.

Similarly, in the segment E1ADRE1 we need to populate:

u2022 E1ADRE1- EXTEND_Q u2013 this is hard coded to u2018300u2019.

u2022 E1ADRE1- EXTEND_D u2013 this is equal to the E1ADRM1-Partner ID .

Read only

0 Likes
2,843

Hi,

The user exit you mentioned has a parameter IDOC_DATA_ITEMS. You will have to loop at this table and insert the segment you want immediately after the E1ADRM1 segment with qualifier 'WE'.

Note : The E1ADRE1 is the child of E1ADRM1 with qualifier 'LF'

Something like this


data  : e1adrm1 LIKE e1adrm1.
data :  e1adrm1_lf like e1adrm1.
data : E1ADRE1 like E1ADRE1.
data : l_extend_d like E1ADRE1- EXTEND_D
data : l_customer_we_edi like kna1-kunnr.

loop at IDOC_DATA_ITEMS.
case idoc_data_items-SEGNAM.
when 'E1ADRM1'.
move idoc_data_items-sdata to e1adrm1.
CASE e1adrm1-partner_q.
   WHEN 'WE'.
    l_customer_we_edi = e1adrm1-partner_id.
   " select KNA1 using the customer_we_edi.
 " move 'LF' to e1adrm1_lf-partner_q.
   " move the related data to e1adrm1_lf
   " move the data from e1adrm1_lf to   IDOC_DATA_ITEMS- sdata 
  " Insert idoc_data_items.
  " In the same manner insert for other segment also.
  endcase.	
endcase.

endloop.

Hope this helps.

regards,

Advait

Read only

Former Member
0 Likes
2,843

Hi,

Is this an inbound or Outbound IDoc you are refering to ?

For which Idoc and message type is this ?

For Outbound side It could be that the Vendor is not maintained in that document and thus the LF (Vendor) is missing in the IDoc

For Inbound side, the data might be not coming from the source system and thus you will need to check there.

regards,

Advait