Capturing Changes in OM Infotypes

Changes to the OM infotypes can be retrieved using standard function module ‘RH_CDOC_READ’, but before using this function module, to ensure that the changes are logged in for OM infotypes, customization needs to be done using table through SM30.

Below is the step-by-step procedure on what needs to be done to retrieve OM infotype changes:

  1. For this enter table T77CDOC_CUST, and press maintain to create new entries for which the change s will be logged in the change tables.

Untitled.jpg

2.  Create the entries for the OM infotypes for which you need to capture change data in the change document tables as below:

  1. Object type need to be specified if you want to log data for specific object types, for eg. O (organization unit), S (position), C (job code), etc. To log entries of all object type save ‘*’.
  2. Infotype column specifies for which OM infotypes, log need to be maintained.
  3. Subtype refers to the subtype of the corresponding infotype.‘*’ takes all subtypes into consideration.

11.JPG

3. To cross check that our configuration has been successfully implemented, run the report RHCDOC_DISPLAY (Display Change Documents) through se38 as      follows:

Capture.JPG

Executing will give you the changes in OM infotypes that occurred within specified date in the alv as below:

Capture.JPG

4. This output is generated from standard SAP program, however sometimes we need to develop a custom program which contains customer specific fields apart from the field in report output, or want a outbound file in some specific format (say .csv). In such cases we need to write a custom code for retrieving the changes.

We can use SAP standard function module ‘RH_CDOC_READ’ to get the change result into internal tables of type CDHDR and CDPOS, and then other derails can be fetched out looping across these internal tables:

Capture.JPG

Here, changes are logged into internal tables gt_cdhdr and gt_cdpos which are table type of CDHDR and CDPOS.

5. On testing the function module above for object type ‘S’ and some date range, the below output is received:

Capture.JPG

Capture.JPG

This function module is particularly important to get the changes from OM infotypes for a particular period and then getting other required details so as to get any required information.

I have attached the program with appropriate comments which uses the above function module to get the details in an alv format, however this can also be used to get the outbound file generated in the application server using ‘OPEN DATASET’ statement.

Selection screen and output screen shot of the program is below:

Capture.JPG

Capture.JPG

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.