Skip to Content
avatar image
Former Member

Report for PO changes

hii,

is there any report or txn by which i can know the details of any changes made in PO.

abhishek

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

9 Answers

  • May 18, 2015 at 07:31 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2006 at 04:03 AM

    You can change the PO via transaction code ME22N

    The associated table for me22n is list as following:

    EKKO (po header)

    EKPO (po item)

    EKET (po schedule line)

    EKES (vendor confirmation)

    EKXX...

    you can do a search in the se11, to get all the table named like EKXX.

    Except the Head and Item table, every other tables is associated with a TAB in the bottom of ME22. For example, EKET is associated with 'Delivery Schedule'. You can use the PO NO and Item NO to combine their data.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      *Check the following code .

      REPORT ZPOCHANGE LINE-SIZE 132 NO STANDARD PAGE HEADING

      LINE-COUNT 065(001)

      MESSAGE-ID VR.

      TABLES: DD04T,

      CDHDR,

      CDPOS,

      DD03L,

      DD41V,

      T685T,

      VBPA,

      TPART,

      KONVC,

      EKKO.

      SELECT-OPTIONS: XUDATE FOR CDHDR-UDATE,

      XNAME FOR CDHDR-USERNAME,

      XEBELN FOR EKKO-EBELN,

      XLIFNR FOR EKKO-LIFNR.

      SELECTION-SCREEN SKIP.

      • TEXT-001 - Sorting Sequence

      SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.

      PARAMETERS: SUDATE RADIOBUTTON GROUP R1,

      SNAME RADIOBUTTON GROUP R1,

      SOBID RADIOBUTTON GROUP R1.

      SELECTION-SCREEN END OF BLOCK BLK1.

      DATA: WFLAG,

      WCHANGENR LIKE CDHDR-CHANGENR.

      DATA: INDTEXT(60) TYPE C.

      DATA: BEGIN OF ICDHDR OCCURS 50.

      INCLUDE STRUCTURE CDHDR.

      DATA: END OF ICDHDR.

      DATA: BEGIN OF ICDSHW OCCURS 50.

      INCLUDE STRUCTURE CDSHW.

      DATA: END OF ICDSHW.

      DATA: BEGIN OF EKKEY,

      EBELN LIKE EKET-EBELN,

      EBELP LIKE EKET-EBELP,

      ETENR LIKE EKET-ETENR,

      END OF EKKEY.

      DATA: BEGIN OF ITAB OCCURS 50,

      BEGIN OF EKKEY,

      EBELN LIKE EKET-EBELN,

      EBELP LIKE EKET-EBELP,

      ETENR LIKE EKET-ETENR,

      END OF EKKEY,

      CHANGENR LIKE CDHDR-CHANGENR,

      UDATE LIKE CDHDR-UDATE,

      UTIME LIKE CDHDR-UTIME,

      USERNAME LIKE CDHDR-USERNAME,

      CHNGIND LIKE CDSHW-CHNGIND,

      FTEXT LIKE CDSHW-FTEXT,

      OUTLEN LIKE CDSHW-OUTLEN,

      F_OLD LIKE CDSHW-F_OLD,

      F_NEW LIKE CDSHW-F_NEW,

      END OF ITAB.

      DATA: OLD_OBJECTID LIKE CDHDR-OBJECTID.

      FIELD-SYMBOLS: <F_OLD>, <F_NEW>.

      SELECT * FROM EKKO WHERE EBELN IN XEBELN AND

      LIFNR IN XLIFNR.

      CLEAR CDHDR.

      CLEAR CDPOS.

      CDHDR-OBJECTCLAS = 'EINKBELEG'.

      CDHDR-OBJECTID = EKKO-EBELN.

      PERFORM GETCHGDOCS.

      ENDSELECT.

      IF SUDATE = 'X'.

      SORT ITAB BY UDATE EKKEY-EBELN CHANGENR EKKEY-EBELP

      EKKEY-ETENR.

      ELSEIF SNAME = 'X'.

      SORT ITAB BY USERNAME EKKEY-EBELN CHANGENR EKKEY-EBELP

      EKKEY-ETENR.

      ELSE.

      SORT ITAB BY EKKEY-EBELN CHANGENR EKKEY-EBELP EKKEY-ETENR.

      ENDIF.

      LOOP AT ITAB.

      CLEAR: INDTEXT, EKKEY.

      CASE ITAB-CHNGIND.

      WHEN 'U'.

      INDTEXT(50) = ITAB-FTEXT.

      INDTEXT+51 = TEXT-020.

      CONDENSE INDTEXT.

      WHEN 'D'.

      INDTEXT = TEXT-021.

      WHEN 'E'.

      INDTEXT(5) = ITAB-FTEXT.

      INDTEXT+51 = TEXT-021.

      CONDENSE INDTEXT.

      WHEN 'I'.

      INDTEXT = TEXT-022.

      ENDCASE.

      RESERVE 4 LINES.

      IF WCHANGENR NE ITAB-CHANGENR.

      WCHANGENR = ITAB-CHANGENR.

      EKKEY = ITAB-EKKEY.

      WRITE:/ ITAB-UDATE UNDER 'Change Date',

      ITAB-UTIME UNDER 'Time',

      ITAB-USERNAME UNDER 'User Name',

      ITAB-EKKEY-EBELN UNDER 'PO No',

      ITAB-EKKEY-EBELP UNDER 'Item',

      ITAB-EKKEY-ETENR UNDER 'Sch No',

      INDTEXT UNDER 'Changes'.

      ELSEIF ITAB-EKKEY NE EKKEY.

      WRITE:/ ITAB-EKKEY-EBELP UNDER 'Item',

      ITAB-EKKEY-ETENR UNDER 'Sch No',

      INDTEXT UNDER 'Changes'.

      ENDIF.

      CASE ITAB-CHNGIND.

      WHEN 'U'.

      ASSIGN ITAB-F_OLD(ITAB-OUTLEN) TO <F_OLD>.

      ASSIGN ITAB-F_NEW(ITAB-OUTLEN) TO <F_NEW>.

      WRITE: / TEXT-023 UNDER 'Changes',

      <F_OLD>.

      WRITE: / TEXT-024 UNDER 'Changes',

      <F_NEW>.

      WHEN 'E'.

      ASSIGN ITAB-F_OLD(ITAB-OUTLEN) TO <F_OLD>.

      WRITE: TEXT-023 UNDER 'Changes',

      <F_OLD>.

      ENDCASE.

      SKIP.

      ENDLOOP.

      TOP-OF-PAGE.

      WRITE:/ SY-DATUM,SY-UZEIT,

      50 'P U R C H A S E O R D E R H I S T O R Y',

      120 'Page', SY-PAGNO.

      WRITE: / SY-REPID,

      60 'Purchase Orders Changes'.

      SKIP.

      ULINE.

      IF SUDATE = 'X'.

      WRITE:/001 'Change Date',

      014 'Time',

      024 'User Name',

      038 'PO No',

      050 'Item',

      057 'Sch No',

      065 'Changes'.

      ELSEIF SOBID = 'X'.

      WRITE:/001 'PO No',

      013 'Item',

      020 'Sch No',

      028 'Change Date',

      041 'Time',

      051 'User Name',

      065 'Changes'.

      ELSE.

      WRITE:/001 'User Name',

      015 'Change Date',

      028 'Time',

      038 'PO No',

      050 'Item',

      057 'Sch No',

      065 'Changes'.

      ENDIF.

      ULINE.

      FORM GETCHGDOCS.

      CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

      EXPORTING

      DATE_OF_CHANGE = CDHDR-UDATE

      OBJECTCLASS = CDHDR-OBJECTCLAS

      OBJECTID = CDHDR-OBJECTID

      TIME_OF_CHANGE = CDHDR-UTIME

      USERNAME = CDHDR-USERNAME

      TABLES

      I_CDHDR = ICDHDR

      EXCEPTIONS

      NO_POSITION_FOUND = 1

      OTHERS = 2.

      CHECK SY-SUBRC EQ 0.

      DELETE ICDHDR WHERE CHANGE_IND EQ 'I'.

      CHECK NOT ICDHDR[] IS INITIAL.

      LOOP AT ICDHDR.

      CHECK ICDHDR-UDATE IN XUDATE.

      CHECK ICDHDR-USERNAME IN XNAME.

      CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

      EXPORTING CHANGENUMBER = ICDHDR-CHANGENR

      IMPORTING HEADER = CDHDR

      TABLES EDITPOS = ICDSHW

      EXCEPTIONS NO_POSITION_FOUND = 1

      OTHERS = 2.

      CHECK SY-SUBRC EQ 0.

      LOOP AT ICDSHW.

      CHECK ICDSHW-TEXT_CASE EQ SPACE.

      MOVE-CORRESPONDING ICDSHW TO ITAB.

      MOVE-CORRESPONDING ICDHDR TO ITAB.

      MOVE ICDSHW-TABKEY+3 TO ITAB-EKKEY.

      APPEND ITAB.

      ENDLOOP.

      ENDLOOP.

      ENDFORM.

      *

      • END OF PROGRAM

      Regards

      Siddharth

  • avatar image
    Former Member
    May 11, 2006 at 04:04 AM

    in the transaction ME22N itself will have CHANGES in the menu. you can check this out.

    or you can go as below

    go to tables CDHDR: change document header

    CDPOS change document items

    in CDHDR , in TCODE field give your PO Transaction code

    ME22N.

    GO for the entries.

    take the document numbers from this table & give it in CDPOS.

    here you can see which PO number has changed which field & its old & new values.

    regards

    srikanth

    Add comment
    10|10000 characters needed characters exceeded

  • May 11, 2006 at 04:16 AM

    Hi Abhishek,

    You can use this FM to read PO document changes.

    <b>CHANGEDOCUMENT_READ_HEADERS</b> - Change document: Read change document header

    <b>CHANGEDOCUMENT_READ_POSITIONS</b> - Change document: Read change document items

    Please check this link for sample codes.

    http://www.sap-img.com/mm001.htm

    Hope this will help.

    Regards,

    Ferry Lianto

    Please reward points if helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2006 at 04:20 AM

    Abhishek,

    "CHANGE DOCUMENTS" in SAP Terminology

    1 The same thing which u are asking

    we had developed here. For Eg : Any change

    in the material master will be detected

    and a mail will be sent to the concerned

    employee.

    THIS WILL ALSO DETECT WHICH FILEDS HAVE CHANGED.

    IT CAN ALSO GIVE, The Old Value, And The New Value.

    2. This Mechanism is called CHANGE DOCUMENTS in

    SAP Terminology

    3. 2 Fuction Modules are Required.

    (They will fetch necessary data from CDHDR,CDPOS)

    CHANGEDOCUMENT_READ_HEADERS

    CHANGEDOCUMENT_READ_POSITIONS

    4. The First FM gives list of all

    records ( with change no) which have changed.

    5. Loop at the above and the second FM will

    provide the details (old-val, new-val) for

    each record.

    6. While using 1st Fm, i used docclass as 'MATERIAL'.

    BCOS

    the concept of change documents is applicable

    to other type of documents also (depends upon

    customization)

    7. In your case for purchase order,

    the change document is 'EINKBELEG'

    8. For further info see the tcode SCDO

    regards,

    amit m.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2006 at 04:40 AM

    Hi Abhishek,

    Call the function module "ME_CHANGES_READ" to get all the PO related doucument changes. Pass the document category and PO number then it get the PO change log data.

    Regards,

    Arun.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2006 at 05:33 AM

    HiAbhishek,

    If you want to know changes made in a Purchase order

    Go to ME23N

    Give any purchase order number

    Click on <b>Environment</b> in Main menu

    -> Click Header changes to view Header Changes

    -> Clikc Item Changes to View Item Changes

    You can also get the detalis of Purchase document changes from this table <b>EKBE</b>

    Regards,

    Kalyan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2006 at 05:55 AM

    Hi,

    You can also view the changes from a standard report

    Enter transaction <b>ME2N</b> Enter a Puchase document number

    and enter Scope of List as <b>ALLES</b>

    In the list you can see the changes made to the document.

    Kalyan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 18, 2015 at 03:03 PM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded