Skip to Content

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.

SDN1.JPG

Step 2:  EDI: Logical Message types (WE81).

     Create Message Type using transaction Code WE81.

SDN1.JPG

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.

SDN1.JPG

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.

SDN1.JPG

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.    

SDN1.JPG

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’

    EXPORTING

         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

    TABLES

        change_pointers                                 = lt_po_chng_ptr           “Output table

    EXCEPTIONS

       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).

SDN1.JPG

Field value “KEY” indicates creation of the record in the same table.

Deletion:

For deletion you can maintain field LOEKZ in Step 5.

Regards,

Sujeet Mishra

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Christophe BOUDINET

    Thanks for these informations. Very usefull.

    I tried to caption creation data for Outbound Delivery (LIEFERUNG LIKP KEY) & Sales Order (VERKBELEG VBAK KEY) documents. But when i created documents, i have any entries in BDCP2 table unless i make a change.

    Example :
    I create an Sales Order :
    – any data in BDCP2
    I modifiy this Sales Order :
    – I show this data :
    ZORDERS05 5100873 LIPS 1150900001665001001 KEY 20161215150136 20161215150136 EXT_XXX LIEFERUNG 0900001665 3874831 I

    => line with “I” (insert) code modification is added

    Any idea to show “Insert” line as soon as document is created ?

    (0) 

Leave a Reply