Capturing Purchase Order Data Using IDoc Change Pointer Concept:
Below illustration explains how we can capture Daily Changes/Creation/Deletion of Purchase Order Using IDoc Change Pointer concept.
This document will help you to maintain some basic configuration of Change Pointer before calling function module “CHANGE_POINTERS_READ” to get all the changes of purchasing documents for a particular period.
This document is not restricted to purchasing document changes only; you can have your change document object class as per your requirement.
Note: Partner Profile /Distribution Model (Transaction Code WE20/BD64) is not covered in this document, you can maintain these profiles before implementing change pointer concept.
Change Pointer Configuration:
Step 1: Activate Change Pointers Generally (BD61).
Go-to Transaction code BD61 and Activate Change Pointers.
Step 2: EDI: Logical Message types (WE81).
Create Message Type using transaction Code WE81.
Step 3: Activate Change Pointers for Message Type (BD50).
Create one New Entry for the same Message type which we have created in Step 2 using Transaction Code BD50. And Check Active Option as shown in below screen shot to activate the Change Pointers for Message Type ZPURCHDOC.
Step 4: Change Document Object (SCDO).
Here, you can create your own Change Document Object using Transaction Code SCDO. Currently we are using Standard Purchasing Document’s Change Document Object “EINKBELEG”.
In the same way you can have MATERIAL (Material Master), ORDERBUCH (Source List) etc.
Step 5: Change Document Items for message type (BD52).
Maintain the Change Pointer fields for which you are going to consider your purchasing document as a change using Transaction Code BD52.
Example: Here we are considering Purchasing Document Category (BSTYP) & Purchase Order Quantity (MENGE) as a pointer.
Changes will get captured once any above field’s value will get changed. And it will get captured using Standard function Module “CHANGE_POINTERS_READ”
You can call above function module in your program to capture the changes for a particular duration.
CALL FUNCTION ‘CHANGE_POINTERS_READ’
change_document_object_class = ‘EINKBELEG’ “Step 4
creation_date_low = lastrun_date-low “Creation Date start
creation_time_low = ‘000000’ “Creation Time start
creation_date_high = lastrun_date-high “Creation date end
creation_time_high = ‘240000’ “ Creation Time end
message_type = ‘ZPURCHORD’ “Step 2
change_pointers = lt_po_chng_ptr “Output table
error_in_date_interval = 0
error_in_time_interval = 0
OTHERS = 0.
All the changes is stored in table BDCP2, you can check the changes which is being captured because of above configuration in table BDCP2 , BDCP2 gets updated in background every time system gets change pointers event triggered for field BSTYP & MENGE.
Purchase Order Creation:
To caption creation data when purchase order will get created, you can maintain below value using Transaction Code BD52 (Step 5).
Field value “KEY” indicates creation of the record in the same table.
For deletion you can maintain field LOEKZ in Step 5.