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: 

How to remove line item idoc segment hierarchy before idoc creation?

Former Member
0 Kudos

Hi All,

I have a requirement to remove certain PO line item idoc segments based on some conditions, before the idoc is created.

I am writing the code inside IDOC_OUTPUT_ORDCHG function module (using enhancement spot).

The problem here is that I am unable to get the segment hierarchy (PO line item has a lot of idoc segments linked to each other). (The hierarchy fields PSGNUM and SEGNUM in the internal table INT_EDIDD are not filled.) I need to remove all segments related to a PO line item. For example, if PO line item 2 is not required, I need to remove all the segments related to it.

I know the PO line item detail to be removed from the idoc, but unable to find all the related line item segments, as some of them don't even have PO line item as its field.

Please suggest how to solve this issue.

Thanks,

Arun Mohan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

User Exit EXIT_SAPLEINM_001 is called just before routine fuellen_idoc_inttab (which fills up the IDOC segments) in IDOC_OUTPUT_ORDCHG. Read the XEKPO table and delete the entries you do not want to send out. That way, the IDOC detail segments for those materials will not be processed.

5 REPLIES 5

Former Member
0 Kudos

Hi All,

Any ideas on the above issue?

Thanks,

Arun Mohan

0 Kudos

U can try if Segment Reduction Works BD53 or segment filtering Bd56

0 Kudos

You can use Idoc reduction method or try creating filter at distribution model level.

Former Member
0 Kudos

Hi,

I would remove the items before the Idoc is created. Look for the CUSTOMER-FUNCTION calls in IDOC_OUTPUT_ORDCHG and make a CMOD enhancement of MM06E001. It should be EXIT_SAPLEINM_011 where you can reduce the EKPO table.

/Michael

Former Member
0 Kudos

User Exit EXIT_SAPLEINM_001 is called just before routine fuellen_idoc_inttab (which fills up the IDOC segments) in IDOC_OUTPUT_ORDCHG. Read the XEKPO table and delete the entries you do not want to send out. That way, the IDOC detail segments for those materials will not be processed.