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

IDOC Segment field change

Shiva_Ram
Active Contributor
0 Likes
2,488

Hi,

Can anyone tell about how to change the field VALUE of IDOC type QALITY02,segment E1ADRM1,field PARTNER_ID? Currently the system is pulling the value from system address table, where as I need to pull from KNKK-KRAUS. Can the transaction code BD66 be used for this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,837

Something like this.


DATA: s_e1adrm1 LIKE e1adrm1.
LOOP AT int_edidd.
  CASE int_edidd-segnam.
    WHEN '...'.
    WHEN 'E1ADRM1'.
       MOVE int_edidd-sdata TO s_e1adrm1.
       make changes to S_E1ADRM1-PARTNER_ID.
       MODIFY int_edidd.
  ENDCASE.
ENDLOOP.

Hi,

Can anyone tell about how to change the field VALUE of IDOC type QALITY02,segment E1ADRM1,field PARTNER_ID? Currently the system is pulling the value from system address table, where as I need to pull from KNKK-KRAUS. Can the transaction code BD66 be used for this?

10 REPLIES 10
Read only

Former Member
0 Likes
1,837

Assuming this is with respect to outbound, I would use the user-exit at the end of IDOC_OUTPUT_QALITY02 to maintain the data in int_edidd as needed. I don't believe BD66 will work for this.

Read only

Former Member
0 Likes
1,837

Hi Shiva,

Go to the user exit for populating the segment E1ADRM1.

add your logic for fetching the KNKK-KRAUS value and assign it to the PARTNER_ID field.

Read only

0 Likes
1,837

Unforunately, there are no user-exits after individual segment addition so you need to wait until the data table is built completely.

Read only

0 Likes
1,837

Hi Michael,

Will the enhancement EXIT_SAPLQCE1_005 helps?

Thanks for all the feedback.

Read only

0 Likes
1,837

That's the one to which I am referring. Many IDoc functions have a recurring user-exit provided after each segment is added to the data table, but there are cases (like this one) where you only have access to the data at the end of the data table population.

Read only

0 Likes
1,837

EXIT_SAPLQCE1_005 is the last user exit that is triggered in this IDoc processing function module. You should be able to change the field value. You have to loop at the internal table INT_EDIDD and have a CASE INT_EDIDD-SEGNAM inside the loop. When segnam is your segment, you can make the changes to the field you want to. Declare a structure of your segment type, move INT_EDIDD-SDATA to that structure and then you can individually refer to the fields of that segment. Once you make the change, you can go back and modify the INT_EDIDD internal table.

Srinivas

Read only

0 Likes
1,837

I'm not sure of your familiarity level, but here's a brief guide to the logic:

1. Read (or loop) INT_EDIDD for SEGNAM = your segment

2. Move INT_EDIDD-SDATA to a structure defined like your segment

3. Change your field value

4. Update INT_EDIDD

Read only

Former Member
0 Likes
1,838

Something like this.


DATA: s_e1adrm1 LIKE e1adrm1.
LOOP AT int_edidd.
  CASE int_edidd-segnam.
    WHEN '...'.
    WHEN 'E1ADRM1'.
       MOVE int_edidd-sdata TO s_e1adrm1.
       make changes to S_E1ADRM1-PARTNER_ID.
       MODIFY int_edidd.
  ENDCASE.
ENDLOOP.

Read only

Former Member
0 Likes
1,837

Hi,

You can use Enhancement QCE10002 to change the values in the IDoc before dispatching it. This way you can change the value of this field.

Hope this helps

Vamsi

Read only

0 Likes
1,837

Hi,

Thank you all for the valuable suggestions.