SAP IDocs. Change Pointers

SAP IDocs. Change Pointers

💡
Версия на русском: SAP IDocs. Указатели изменений

Explanation of the Topic

Any change in HR master data can serve as a trigger for creating a change pointer, which is then transformed into an IDoc. This mechanism can be used when there is a need to continuously (not just once) transfer personnel changes to external systems (whether HR or non-HR systems). Let's take a simple example of generating a change document after editing a PA infotype.

Solution

Start by opening the relevant section in the IMG via transaction SALE:

IDoc Interface / Application Link Enabling (ALE)Modelling and Implementing Business Processes Master Data Distribution

1. Activate Change Pointers - Generally

See Activate Change Pointers

By performing the Activate Change Pointers - Generally setting, you essentially enable the change document creation mechanism in the SAP system.

Once this setting is activated, change documents will be stored in table BDCP2.

2. Activate Change Pointers for Message Types

This setting specifies for which message types change documents should be created.

Message types can be created/viewed in transaction WE81

3. Reduce Change Pointers for Message Type


For each message type, you can define additional processing logic for generating its change document by implementing the BAdI BDCP_BEFORE_WRITE.

For example, you might want to temporarily disable change document creation while running a custom program that modifies HR infotypes. The method FILTER_BDCPV_BEFORE_WRITE is there to help!

When creating the implementation, don’t forget to select the appropriate message type.

4. Create IDocs from Change Pointers


Once a change document has been created, an IDoc must be generated.
This is done by the RBDMIDOC program. All you need to do is configure a variant and schedule the program to run in the background. You can do this via the setting: Create IDocs from Change Pointers → Define Variants

5. Testing: Generating the Change Document


In the video snippet below, the sequence of actions is shown that trigger the BDCP_BEFORE_WRITE BAdI implementation and the subsequent creation of a change document. You can then use the generated key to find the corresponding entry in table BDCP2.

0:00
/0:47

6. Testing: Generating the IDoc


Run the RBDMIDOC program for the relevant message type.

0:00
/0:32

The IDoc is successfully created. You can view its contents in transaction WE02.

Note: Once the RBDMIDOC program has run and the IDoc is successfully created, the corresponding key record in table BDCP2 will be marked as processed (BDCP2-PROCESS = X).

P.S. Never use the ABAP constructions shown in the examples in this post (e.g., break username). Using such constructs negatively affects your karma—and not just yours. Cheers!