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

Add pointers in BDCP_BEFORE_WRITE ?

Former Member
0 Likes
1,755

hello,

i would like to add pointers in BADI BDCP_BEFORE_WRITE for message HRMD_A so that, every time, i get all informations about an employee in my idoc.

i plan to user function CHANGE_POINTERS_CREATE but i'm fearing an infinite loop if i use CHANGE_POINTERS_CREATE inside BDCP_BEFORE_WRITE?

could you tell me if i'm wrong or not?

anyone has an exemple on how to add automatically change pointers?

best regards

5 REPLIES 5
Read only

Former Member
0 Likes
1,145

Hi Olivier,

I think it depends a bit what you're trying to achieve. In theory you could (ab)use the BAdI to actually add change pointers (by design I'm sure it's only supposed to be used to filter unwanted values, but depending on your scenario you might get away with simply adding new entries to the internal table CHANGE_POINTERS.

As you mention though, the functions for writing change pointers do call again the BAdI BDCP_BEFORE_WRITE. Therefore if you trigger generation of the change pointers from within the BAdI, you'd need some additional coding to prevent endless loops.

However, based on your short comment it is not clear though, if there's possibly better solutions. I.e. are you sure that you cannot configure the system to create the change pointers you want? Somehow you seem to be getting already change pointers as you're contemplating to utilize the BAdI BDCP_BEFORE_WRITE. So why exactly do you need to code it?

Best wishes, harald

Read only

Former Member
0 Likes
1,145

Hello Harald,

thank your for your response.

in fact, what i need is that, when an update of employee occurs, the generated idoc contains always some infotypes (0001for exemple)

is that possible?

best regards

Read only

0 Likes
1,145

Sorry, that's an area that I'd also need to investigate. Based on your approach it sounds as if the outbound IDoc would get generated based on the change pointer information. (I.e. change pointers would be serving the duplicate purpose of triggering the outbound IDoc and also indicating what changed; for the latter I'd expect in general more evaluation of change documents, but in your case it seems to be just change pointers?!)

Since change pointers don't really do any harm (ok, performance issues, storage space aside), I'd do some test runs where you basically add the change pointers you need directly to the table in BAdI BDCP_BEFORE_WRITE. So you'd need to test which values you could/would copy (e.g. do you still want a reference to change documents, even though you don't have one) and which you could leave empty.

Ideally there would be some better approach. My recommendation would be to check if that can be configured (hopefully you'll find some competent functional consultant) or otherwise to search for customer exits in the outbound IDoc generation function module. Once you have an exit, you could add the required segments there. If you don't find any suitable exit, you could still code your own change pointer evaluation module, which reads the outstanding change pointers, generates the IDocs (should be possible to call the standard SAP function module for that) and then add the missing segments that you always require.

Read only

0 Likes
1,145

ok

i will also investigate this :

1. replace RBDMIDOC with my own program

2. call RHALEINI from within this new program

regards

Read only

0 Likes
1,145

You could also check if you want to continue using RBDMIDOC and instead create your own function module for evaluating the change pointers. E.g. within BD60 you could link message type HRMD_A to another function module for evaluating the change pointers. Per default HRMD_A points to function module MASTERIDOC_CREATE_SMD_HRMD. If you check the function you will see that it follows a common pattern that is used within the SMD (Shared Master Data) tool. You probably looked at that path already, but I thought I briefly mention it nonetheless...