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

Delete segments in IDOC

Former Member
0 Likes
5,601

Hi,

Is there any FM to delete a particular segment in an IDOC. for ex in DELVRY03 I want to delte segment E1EDL24 to process the IDOC.

Thanks.

Hi,

Is there any FM to delete a particular segment in an IDOC. for ex in DELVRY03 I want to delte segment E1EDL24 to process the IDOC.

Thanks.

6 REPLIES 6
Read only

Sm1tje
Active Contributor
0 Likes
2,215

And why would you want to delete this segment? There is no need to delete the actual segment since it is part of the standard IDoc definition. Does it contain any data that is not relevant to you, or does it give an error you can't handle?

Then I would suggest to find a user exit in which the data in this segment is initialized, or instead of using a standard function module for processing the data, create your own and process the IDoc yourself.

BTW: If you can not process the IDoc because of an error or whatever the reason maybe, then it might be better to solve this error before further processing the IDoc.

Read only

0 Likes
2,215

One should not try to delete the Segment in IDOC but try and reduce the IDOC

Read only

Former Member
0 Likes
2,215

Hi,

There are some standard function modules for removing segments, but I'm not sure if you'll find a useful one among them (since the ones I know usually rely on corresponding configuration). In general you could possibly avoid any coding by applying an appropriate IDoc segment filter (I suspect you're talking about inbound IDocs). Assuming that you're not having tons of different senders you could define a segment filter via transaction BD56. Here you'll have to maintain sender and recipient information and the segment (E1EDL24) that you want to filter. SAP applies upon receipt of the IDoc all ALE services, among them the segment filter you defined via BD56. As a result the IDoc stored on the database will not have the segment defined in BD56 and none of the corresponding child segments.

You can see that the filter was applied by looking at the status text for status 64, which should look something like this: Data filtered , No conversion , No version change . (Might look different for you, if you have other ALE services that run.)

So the advantage of this solution would mean that there's no requirement for coding, disadvantage is the configuration effort and possibly complaints about missing data (i.e. sometimes its better to manipulate the data structures in memory before processing instead of messing with the IDoc contents on database). However, if you truly don't need the information, this might be what you're looking for.

If you still want to code, you could grab a customer exit that provides the table with all IDoc data segments and then delete E1EDL24 and all its children (a more generic coding should find the child segments via the IDoc hierarchy information in PSGNUM.

Cheers, harald

Read only

0 Likes
2,215

Hi,

I cannot reduce the IDOC as I have to process the segments in the IDOC, update the Z table and then delete the segment. If I reduces the IDOC then I will lose the data which I want to update. The only way which I can think is in code I can check the PSGNUM and H LEVEL to delete all the child segments underneath E1EDL24. If someone has a better solution please let me know.

Regards,

Abhi.

Read only

Former Member
0 Likes
2,215

Are you trying to delete a segment from an IDoc basic type? Or are you trying to delete a segment of a processed IDoc, containing data?

The first makes no sense, as explained in above thread. You should keep your hands off of the standard SAP basic type.

The second makes no sense either. Processed IDocs should be archived or deleted.

Read only

a_ben1
Explorer
0 Likes
2,215

Hi
Have you already resolved this issue ? I need to delete a segment E1EDL24 and all the child segments underneath E1EDL24, But PSGNUM and HLEVEL in the IDOC_DATA table have initial values .
Thanks !