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 filtering (orders/orders05)

Former Member
0 Likes
6,397

Good morning,

I'm not very familar with Idoc's but have one questiion:

We are using message type orders with orders05 for transferring SAP purchase orders to a specific port.

In the Idoc there is a segment included (E1EDPT1 GRUN) which contains a purchase order text. This is just needed for printouts or emails to the supplier.

When we are transferring the po via EDI this specific segment shouldn't be transferred.

Example:

E1EDP01

- E1EDP20

- E1EDP19 001

- E1EDP19 014

- E1EDPT1 GRUN

-- E1EDPT2

-- E1EDPT2

-- E1EDPT2

How can this be easily done?

Cheers

Wolf.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,599

Hi Oliver,

thanks for your recommendation.

Will give Userexits  EXIT_SAPLEINM_011 or  EXIT_SAPLEINM_002 a try.

Best regards

Wolf.

18 REPLIES 18
Read only

Former Member
0 Likes
5,599

Hi,

Add a condition in a appropriate user exit for a orders05  and clear the value in field E1EDPT1-GRUN.

Regards,

Shruti D

Read only

0 Likes
5,599

Hi,

thanks for your response, I thought about a solution with idoc filters or reduced idocs, but I don't know exaclty how it works.

Cheers

Wolf.

Read only

0 Likes
5,599

Hi Wolfgang,

You can create an idoc style in WE32 in which you can filter out this segment. Assign this style in the partner definition in WE20.

Best regards,

Oliver

Read only

0 Likes
5,599

Hi Oliver,

thanks for your reply. This is going for sure into the right direction 🙂

This will exclude all segments E1EDPT1, right?

How can I exclude just E1EDPT1 GRUN with the text-id TDID = GRUN?

Cheers

Wolf.

Read only

0 Likes
5,599

Hi Wolfgang,

Yes, using an idoc style would remove this segment unconditionally independent of any qualifier.

If this is not what you want I also would use an user exit that deletes this segment and its children. In this case see what Sujeet already mentioned.

Best regards,

Oliver

Read only

Former Member
0 Likes
5,599

This message was moderated.

Read only

SujeetMishra
Active Contributor
0 Likes
5,599

Hello,

You can do it in User-exit EXIT_SAPLEINM_002.

Regards,

Sujeet

Read only

Former Member
0 Likes
5,599

Hi Wolf,

The IDOC filters can be created using transactions BD59 and BD95. After creating filters you can set the filter in transaction BD64.

While you are creating a filter, you have two options :

1) The IDOC itself would not pass

2) The IDOC is passed, but the segment of that IDOC will not be passed.

You can find both options by searching for the transactions BD59 and BD95.

Thanks,

Sumit

Read only

0 Likes
5,599

Had a look into BD59 (assignment of object type to message) and BD95 (ALE object type), but didn't understand the meaning?

Read only

0 Likes
5,599

BD56 is used to filter the idoc segments.

If a particular system is not interested in receiving  specific segments you can filter this by specifying the details in BD56.

Type corresponds to type of sending system or receiving system(LS for logical system)

Specify the list of segments to be filtered under column segment type.

Please note that mandatory segments cannot be filtered.

Regards,

Sumit

Read only

0 Likes
5,599

Need to select existing object type (based on table and field) from BD59 and then assign it to messsage type in BD95.

So if you want to set up filter based on Customer Number then your setting in BD95 will look like

then in your distribution model you get a chance to set filter based on this field and perticular customer value

   

Read only

0 Likes
5,599

But this is for filtering the complete IDOC. If you put filter like this, then whole IDOC will be blocked.

Transaction BD56, is used for segment filtering.

Read only

Former Member
0 Likes
5,599

Hello,

I am not suggesting anything different from what others have already suggested. Just informing about my views on the approach suggested by others.

  1. WE32 approach will allow you to either add or remove E1EDPT1. Cant remove only one type of text. So if you create a view without PT1 seg, no text will be transferred
  2. Second approach of using exit is better. But make sure that you delete the PT1 n PT2 segments. do not initialize it. this may result in issues at receiving end. ( As you are very familiar with idocs you may be aware of this already )

BR,

Mrugesh

Read only

Former Member
0 Likes
5,599

No I'm very confused 😞

One says use BD59, then BD95, then BD64, others recommend to use BD56 instead?

Another option WE32 cannot be used as it excludes every E1EDPT1 segment.

Does someone has a step by step explanation how to exclude E1EDPT1 GRUN segment?

Last option I want to use is a Userexit.

Thanks in advance.

Read only

0 Likes
5,599

I dont want to preach but i think best solution is to test these option on your own in your sand box system.

Read only

0 Likes
5,599

Hi Wolfgang,

From my EDI/idoc experiences I would recommend to implement this filtering in an userexit. In this case either in enhancement spot ES_BADI_ME_EDI, method PROCESS_IDOC_COMPLETE or in SMOD enhancement MM06E001, EXIT_SAPLEINM_011. Both are called when SAP has finished creating the standard idoc and you can apply any changes here.

I personally prefer to see such changes to standard idoc processing at one glance in one place in the system (if that is feasable) instead of loooking up customizing here and there. But, of course, that is my personal preference.

I don't know how you want to process the idoc further down in the process but if you send it to an EDI converter for mapping then you could filter out these segments there.

Best regards,

Oliver

Read only

Former Member
0 Likes
5,600

Hi Oliver,

thanks for your recommendation.

Will give Userexits  EXIT_SAPLEINM_011 or  EXIT_SAPLEINM_002 a try.

Best regards

Wolf.

Read only

kurt_wagner
Explorer
0 Likes
5,599

Hi Reader

before you start development (as suggested here) please check your customizing in t166k, t166p, t166a.

When not selected there the text ID will not get sent in the idoc.

Cheers!