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: 

iDoc Field data level Filtering

Former Member
0 Kudos

Hi All,

My client has come up with a requirement where it involves dual instances and each instance running its own application. I have to get the data synchronized through ALE. One of the system is a centralized system and the other is decentralized. I have to do field level filtering, before pushing the idoc through. For eg, i have to move all the remittance whose vendor address belong US alone and not to any other country. Can anybody suggest a method for this it will be great.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Rajkumar,

In the ALE Distribution model, u can create filter for the required message type i.e u can set a condition on availble feilds for the message type.So, if that condition is met then only message will be send to the target system. This might help in solving ur problem.

****Reward points if useful

Regards,

Kiran Bobbala

7 REPLIES 7

Former Member
0 Kudos

Rajkumar,

In the ALE Distribution model, u can create filter for the required message type i.e u can set a condition on availble feilds for the message type.So, if that condition is met then only message will be send to the target system. This might help in solving ur problem.

****Reward points if useful

Regards,

Kiran Bobbala

Former Member
0 Kudos

Hi Rajkumar,

You need to configure your filters in BD64 for your message type by creating a model view and distributing it. If the field you are looking for is not available in BD64, you can add the required fields :

This is an example of a material master..likewise you can follow the steps for your scenario ....

You need to give custom code for this in a mandatory segment.

Take a field which is unused in E1MARAM for eg: SAISO or IHIVI ...if you're not using these fields...

then retrieve the plant details in E1MARAM segment and send that plant details to this field.

As in BD64, you will have only few fields defined for filters, you can create custom filters by declaring these new fields in BD95 and BD59.

Eg:

CASE SEGMENT_NAME.

WHEN 'E1MARAM'.

X_E1MARAM = IDOC_DATA-SDATA.

SELECT WERKS FROM MARC INTO L_SAISO WHERE MATNR = X_E1MARAM-MATNR.

X_E1MARAM-SAISO = L_SAISO.

IDOC-DATA-SDATA = X_E1MARAM.

ENDCASE.

Now, your plant is stored in SAISO ( a dummy field used for ur plant) in E1MARAM which is a mandatory segment.

Goto BD59 and BD95 and declare a new object type SAISO from table MARA. This field then gets populated in BD64 automatically and can be used as a filter.

In BD59, add the ALE Object Type SAISO , segment E1MARAM, and field SAISO.

In BD95, ALE Object Type SAISO, Table Name MARA and Field Name SAISO.

These two Tcodes are for declaring an object type and you can see this field in the distribution model.

Now, in BD64, give your plant value and that filters the IDOC.

Finally, goto BD64, under this field SAISO, give the value of your plant and the filter is active on the E1MARAM segment at the plant level.

Lemme know if this is not clear...shud be pretty much simple..

Reward if useful !

- Neeta.

Former Member
0 Kudos

Thanks neeta, I tried the steps you have told but the problem is i am dealing with the HR specific message type and when the changes are done. The information modified alone gets set in the chnage pointer and main filtering criteria, the country is not part of teh change pointer. So as a result the information is not filtered as per distribution model. But the code you had sent looks fine, but i am unaware as to where it has to be placed. Whether before change pointers or in BD21. It would be great if you can send me some info on that

0 Kudos

Hi Rajkumar,

The code I sent you has to be written in a userexit which triggers for every segment.

This triggers when you run BD21.

For material master which is an example provided in this case by me, the user exit is

" EXIT_SAPLMV01_002" in the Function Module "MASTERIDOC_CREATE_SMD_MATMAS".

Likewise, for HR, you can give your custom code for custom filters in a user exit which triggers for every segment ...check for your segment ...

Case segment_name.

when 'E1MARAM'.

-


Also, you said country is not specified as a change pointer. You can give your fields for which you want to trigger an IDOC whenever a change is made in BD52. If you include your field here, everytime the country is changed, the changes are stored in the change pointer tables. If your object doesnt exist in BD52, you can create one in SCDO.

Once you run RBDMIDOC or BD21, it reads the change pointer tables, triggers the FM , checks for filters if any, and creates an IDOC.

Hope you got me !

Let me know if you have any questions !

- Neeta.

0 Kudos

Hello Rajkumar,

Please note that data distribution in HR are designed a bit differently than MM or SD.

You haven't specified what data you are trying to distribute but I assume its either PA or PD infotype data which deals with message types HRMD_A or HRMD_B. The fact HR is different than logistic modules that you cannot set up field specific change pointers for PA tables, even if you create a new change document object through SCDO. However this is possible for PD tables via transaction BD52.

Part of your filtering can go in the Distribution Model (BD64) like infotype and subtype numbers but the field specific changes have to be triggered within the BD21 program via a BADI definition HRALE00OUTBOUND_IDOC using the method FILTER_VALUES_SET. Check the Sample Code for this method - it allows you to set the filter values for generic filtering but you have to use the parameters FILTER1 and FILTER2 within the E1PLOGI segment.

So, follow the steps below (see documentation of the BADI interface class)

1. Define Filters as ALE Object Types via BD95

2. Assign Filters to a Message Type via BD95

3. Determine the Values FILTER1 and FILTER2

4. Distribute Data According to the Filter Settings

Hope this helps,

Cheers,

Sougata.

Former Member
0 Kudos

Thank you all, I managed to do a little filtering in the BADI, HRALE00CHANGE_PTRS. But there seems to a new problem thats coming now. I am able to create change pointers for only few of the changes done in PA30. Change pointers are not getting created for the changes done in Organizational Assignment section alone. If i could generate change pointer for the same. Probably in BADI, i can add the change pointer irrespective of what changes are done by user, so that the personnel area would flow to my model to filter the iDoc based on the personnel area information. If you can suggest me some other way of filtering the information based on the personnel area, that will also be of great help.

Appreciate your time and effort... Thank you guys

0 Kudos

Hi Raj,

Can you send me the code that you have written in the Reciever method of Badi ?

Thanks in Advance,

Matsen