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: 

Filter IDOC MATMAS04 by plant

Former Member
0 Kudos

Hi all,

I have configured an idoc in order to send information of materials to an external warehouse. But this warehouse is only from a specific plant, for only one company. When other companies create their materials, my idoc matmas04 is activated anyway, but this material (idoc) must not be send to this external warehouse. Is there a way to filter the activation of change pointers, in order to activate it only for materials of a specific plant?

Is it possible to create a Z FM copying the standard MASTERIDOC_CREATE_SMD_MATMAS, and create a filter here?

Thanks in advance. Reward points to helpful answers.

14 REPLIES 14

Former Member
0 Kudos

Hi Julio,

No need to copy FM. Just go to BD64 and there create a filter based on the plant in the distribution model itself.

Regards,

Atish

0 Kudos

Hi ,

you need to do create a filter for plant in BD64 ,

You can proceed with following transactions to do so ..............

2.2.2. Maintain object type for message type (BD59) Client independent

The ALE objects are used to create links between IDocs and applications objects, to control the serialisation, to filter messages in the customer model and to use listings.

For our own message type and IDoc you must maintain object types for the links.

If you want to check the serialisation for the message type, then you must maintain object types for the serialisation. If no serialisation object has been maintained for a given message type, then the serialisation will not be checked for this message type.

To add an object type to our message type, follow these next few steps:

• Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types)

• Type in your message type ZINVRV and press enter

• Click on New entries

• Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR

• Save and exit.

You have now created an object that we’ll use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.

We now need to add our new message type to the distribution model.

2.3. Configuring the Distribution Model

This task is performed on your ALE reference client.

2.3.1. Manual Configuration (BD64) Client dependent

To manually configure the customer distribution model, read the ALE configuration procedure, and follow these steps:

• Perform the Maintain customer distribution model directly function. (ALE -> Distribution customer model -> Maintain customer distribution model directly)

• Specify the customer model you want to maintain and the logical system that is to be the sender of the messages OR create a new model. (Create model ALE with logical system ALELS1C400)

• Choose the receiving systems to which the sending system must forward message type ZINVRV to.

• For each receiving logical system allocate the message type necessary for communication to the receiving systems as per ALE configuration procedure.

• Create filter objects (in our case LIFNR as the object type with the associated vendor number, 0000018001 with leading zeros, in the object area) for the message types.

• Save the entries.

0 Kudos

I followed your instructions... but it didn't work.

Question: i noticed that segment E1MARCM is not coming into the idoc, does this have influence in the filter defined in BD64? I already have in BD59 the appl. object WERKS associated with E1MARCM-WERKS...

0 Kudos

Julio,

BD64 should work to filter based on Plant....or try BD56 to Maintain IDoc Segment Filters...

Chandra.

ferry_lianto
Active Contributor
0 Kudos

Hi,

I don't think you need to setup BD59.

You only to need to create data filtering (BD64).

For example in message type MATMAS if you only enter the plant code(s) that you want to go in the filter of E1MARCM. Don't enter the plant code(s) that you don't want to go. Give it try ...

Regards,

Ferry Lianto

0 Kudos

Ok... well, i'm giving up...

Just let me explain what i'm doing, you guys tell me if i'm wrong:

I have two materials:

m1 -> plant 0001

m2 -> plant 0002

I configured all related to idoc matmas04. In BD59 there is a row with

WERKS E1MARCM 1 WERKS 3 4

Then in BD64,

My interface

-> My system

-> The Warehouse

-> mastmas

-> data filter active

Inside the filter:

Filter group

-> Plant

-> 0001

In this point, i suppose if i modify data from material m1 and m2, then run rbdmidoc program, the number of idocs generated MUST be one... but always generate the two idocs, no matter what plant the material is. And the idocs contains only two segments:

E2MARAM005

E2MAKTM001

That's all my test... Am i missing something here? maybe with configuration of idoc?

0 Kudos

To filter based on the field value you need to use the below transactions.

BD95 - Create the New Entry of ALE Object Type and give the table name and field name for which you need to set the filter.

BD59 - enter the message type

And then give the ALE Object type which was created throug BD95 and give the segment name for the same field you want to filter the values.

BD64 - Create the new distribution model and once you add the message type then create the filter and while creating the filter, the field which you have configured using BD95 AND BD59 will appear in the filtering criteria. Then you can set the value for the field.

Hope it helps.

<REMOVED BY MODERATOR>

Thanks,

Srinivas

Edited by: Alvaro Tejada Galindo on Apr 8, 2008 1:30 PM

0 Kudos

BD95, the row

WERKS MARC WERKS

It's ok. Well i think this idoc is out of business, no way to filter it!

0 Kudos

Hi Julio,

It will generate two IDOCS its correct. BUT it will send only one IDOC based on the filter in BD64. This filter will not restrict creation of IDOC but it will restrict which IDOC to be sent.

Regards,

Atish

0 Kudos

My resulting idoc is a text file. The text file is reaching the warehouse server :s

Maybe if my idoc were send by RFC could be as you said... I don't know...

0 Kudos

Hi,

Then you can use BADI or User-Exit in the FM of IDOC to restrict the data.

Regards,

Atish

ferry_lianto
Active Contributor
0 Kudos

Hi,

You may want to use/explore user exits in FM MASTERIDOC_CREATE_SMD_MATMAS to filter specific plant(s).

Regards,

Ferry Lianto

0 Kudos

Ok.. there is one. FM EXIT_SAPLMV01_002. But how can i make a filter here?

I think this user exit is used for extension of idoc matmas*, maybe z-segments.

If i try to make a 'select werks from marc' in this u-exit, the idoc generation shows me an error... :s hahaha

0 Kudos

Hi Julio

I have the same problem - I want to suppress the creation of IDocs depending on plant (WERKS)

1) A filter in BD64 on plant only suppresses the E1MARCM-segments with different plants, but the IDoc is still created

2) EXIT_SAPLMV01_002 is in my opinion for manipulation of segments e.g. adding Z-segments

Please let me know if you found a solution, I will also do.

Regards

Markus