How to find out Last Changed Fields for a line item of a PO

Dear All,
Pls let me know is there any FM or procedure to find the last changed fields for each line item of a PO. I should be able to get the details on the basis of Last changed Date. Can u pls guide me in this?

Hello,
Check the table CDHDR,CDPOS for PO items,
Check this code:
REPORT ZV_GET_LATEST_SO .
DATA: BEGIN OF ITAB OCCURS 0,
        OBJECTCLAS TYPE CDHDR-OBJECTCLAS,
        OBJECTID TYPE CDHDR-OBJECTID,
        CHANGENR TYPE CDHDR-CHANGENR,
        USERNAME TYPE CDHDR-USERNAME,
        UDATE TYPE CDHDR-UDATE,
        UTIME TYPE CDHDR-UTIME,
        TCODE TYPE CDHDR-TCODE,
        TABNAME TYPE CDPOS-TABNAME,
        TABKEY TYPE CDPOS-TABKEY,
        FNAME TYPE CDPOS-FNAME,
        CHNGIND TYPE CDPOS-CHNGIND,
      END OF ITAB.
TABLES: CDHDR,CDPOS.
DATA: LT_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,
LT_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
*REFRESH AUSG.
CLEAR CDHDR.
CLEAR CDPOS.
CDHDR-OBJECTCLAS = 'EINKBELEG'.
CDHDR-OBJECTID   = '0000001784'.  " Purchase order number
**SELECT A~OBJECTCLASS A~OBJECTID A~CHANGENR A~USERNAME A~UDATE A~UNAME
**B~TCODE
**B~TABNAME B~TABKEY B~FNAME B~CHNGIND INTO TABLE ITAB FROM CDHDR AS A
**INNER JOIN CDPOS AS B ON A~OBJECTCLASS = B~OBJECTCLASS
**                         A~OBJECTID    = B~OBJECTID
**                         A~CHANGENR    = B~CHANGENR
**                    WHERE OBJECTCLAS = 'VERKBELEG'
**                      AND OBJECTID = '0000001784'.
*SELECT * FROM CDPOS INTO TABLE LT_CDPOS WHERE OBJECTCLAS = 'VERKBELEG'
*                                    AND OBJECTID = '0000001784'.
*IF NOT LT_CDPOS[] IS INITIAL.
*  SELECT *
*  INTO   TABLE LT_CDHDR
*  FROM   CDHDR
*  FOR    ALL ENTRIES IN LT_CDPOS
*  WHERE  OBJECTCLAS = LT_CDPOS-OBJECTCLAS
*  AND    OBJECTID = LT_CDPOS-OBJECTID
*  AND    CHANGENR = LT_CDPOS-CHANGENR.
*ENDIF.
**  SORT ITAB BY OBJECTCLAS ODJECTID DESCENDING.
*LOOP AT ITAB.
*  WRITE: ITAB-UDATE."ITAB-UNAME.
*ENDLOOP.
*--- Interne Tabellen -------------------------------------------------
DATA: BEGIN OF ICDSHW OCCURS 50.       "Ausgabeaufbereitung
        INCLUDE STRUCTURE CDSHW.       "Zwischendatei
DATA: END OF ICDSHW.
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           = LT_CDHDR
     EXCEPTIONS
          NO_POSITION_FOUND = 1
          OTHERS            = 2.
LOOP AT LT_CDHDR.
  CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
    EXPORTING
*   ARCHIVE_HANDLE                = 0
      CHANGENUMBER                  = LT_CDHDR-CHANGENR
*   TABLEKEY                      = '00000000 '
*   TABLENAME                     = ' '
* IMPORTING
*   HEADER                        =
   TABLES
     EDITPOS                       = ICDSHW
*   EDITPOS_WITH_HEADER           =
* EXCEPTIONS
*   NO_POSITION_FOUND             = 1
*   WRONG_ACCESS_TO_ARCHIVE       = 2
*   OTHERS                        = 3
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  LOOP AT ICDSHW.
    IF ICDSHW-TABKEY+3(10) = '0000001784'
       AND ICDSHW-TABKEY+13(6) = '000001'.
    ENDIF.
  ENDLOOP.
ENDLOOP.
Vasanth

Similar Messages

  • How to find out last update date for business partner's marketing attribute

    How to find out last update date for business partner's marketing attribute??
    Im freshie for SAP Application and im assigned to find out last update date for marketing attribute changed
    which table is involved??
    Yours kindness will be appreciated
    thanks

    You can take a look at table AUSP as well as CRMD_AUSP_HIST.
    The "changed by" and "changed at" are logged on attribute level, not on attribute value level. When you change one specific value, the system does a "re-insert" of all existing values of this attribute.
    Take a look at the SAP notes 938426 and 966670  these may assit you in resolving the issue.
    Regards,
    William Laverde

  • How to find out last updatde timestamp for a table

    Hi All,
    I want to find out the last updated time stamp of a table. Is there some thing available with the sys tables. Is there something can be done with user_objects.
    Or, is there any need to write pl/sql code to get the last updated timestamp for a table.
    Please provide some inputs.
    regards,
    Naresh

    Hi Oleg,
    Select * from user_objects.I belieive it gives you the last_ddl_time not the time a update or delete was done.
    Not sure if we have this feature in any new release.
    I am working on Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    to the OP
    I will suggest if you planto audit then use the audit feature based on your DB version.
    Or to make it more simple have a column called modified_date and update this column whenever you update the record.
    Regards,
    Bhushan

  • How to get the "last changed by" for a set of function modules?

    How to get the "last changed by" for a set of function modules?
    is there any table to get it??

    See [this|Re: Date of creation of function module] I posted earlier.
    >TFDIR will give you the name of the function group program and the include number.
    >E.g. SAPLZFUNCGROUP Include 01.
    >From this you can construct the include name: LZFUNCGROUPU01.
    >You can look this up in TRDIR to find the creation date (CDAT) of the function module.
    In your case, you need unam and udat.
    matt

  • How to find out the manditary fields in an IDOC

    Hi,
    How to find out the manditary fields in an IDOC.
    For example MATMAS05 .
    For this 2 segments I want to find out the manditary fields.
    E1MARA
    E1MAKTM

    Hi,
             go to transaction WE30 and give the corresponding IDoc type and enter. Then you will get all segments for that IDoc type then double click on segment. A popup box will come in that it will show a check box whether it is a mandatory segment or not. And segment editor button will give all the field details.
    Regards

  • How to find out the changes made to a photo in numbers rather than in graphs..

    How to find out the changes made to a photo in numbers rather than in graphs..

    We need to know a lot more to help you. Please provide answers to the questions listed here: "FAQ: What information should I provide when asking a question on this forum?"

  • How to find out Last T-Codes by a Users in Last 24 Hurs?

    Dear experts
    how to find out Last T-Codes by a Users in Last 24 Hurs?
    Please Help
    Regrads
    Is STAD is only solution (or) any other easy way?
    Regards
    PR

    Hi,
    Maybe it's easier with this path :
    ST03N --> Expert Mode --> Day  --> choose your day
    Under analysis view double click on "Memory Use Statistics"
    You will get the list of transactions run that day.
    If you double click on a transaction you will get the list of users who used this transaction.
    If you select the User view, when you double click on a user, you will get the list of transctions this user launched this day.
    Many ways to use this ST03N transaction...
    Regards,
    Olivier

  • How to find out Max threads count for Custom Work Manager??

    Hi All,
    How to find out Max threads count for Custom Work Manager??
    I have created 1 WM & targeted it to a cluster of 2 MS. Later I created Max thread Constraint = 300 & assigned that to my WM.
    I need to check how many threads maximum were created by my WM after lets say 1 completed day.
    The idea behind that is to understand if .. 300 is enough or need to increase the same way as we do it for JDBC datasource like.. Active connections Max count.. etc.
    Any Idea?
    regards,
    Tanmay

    Hi Ashish,
    Thanks for your response.
    The monitoring page that you are suggesting does not indicate the max thread count reached for a particular WM.
    For example, If I have Sample WM with 300 Max Thread Constraint, is there a way for me to check how many threads have been used out of 300??
    Any pointers in this regard are appreciated.
    Thanks,
    Tanmay

  • Open field for customer line item

    Hi Guru
      I have some problem about open field for customer line item  post with posting key 09 and special GL , I open field at posting key 09 but the field still hidden  . How I can open field for used . Thank you

    Dear,
    Use transaction FBL5N and select Special G/L Transactions only and execute.....here bring posting key and filter the posting with 09.
    REgards,
    Chintan Joshi

  • How can I activate drill down report for planned line items please urgent?

    Hi Everyone,
    Please suggest me how can i activate drill down report for planned line items in internal orders. S_ALR_87012993. Please suggest me, I'll award full points. I am unable to do it in client system, which has already line items. I tried in my sys with new config it is working.
    Kind regards
    Arvey.

    Hi
    It is based on the reports attached in the Report Group - TCODE: GR53
    In the Report Group screen
    Press CONFIGURE – This is to attach any Drill Down reports.
    Press the “Insert Line” icon
    As is the screen may be used to insert a Report Writer report group. To add an ABAP, press “other report type”
    Double click on “ABAP Reports”
    Enter the name of the ABAP and ENTER
    <b>RCOPCA08                       Profit Center: Plan Line Items</b>
    VVR

  • How Can I Create One Entry Sheet For Multiple Line Items of A PO

    Please Tell Me How Can I Create One Entry Sheet For Multiple Line Items of A PO

    hi,
    It is not possible to create single Service Entry sheet for multiple PO line items. It is 1 to 1 relation.
    you have to make different service entry sheets for different item of service master.
    regards
    Manish Joshi

  • Need to know how to find the last execution time for a function module

    HI all
    I need to know
    1) How to find out the last execution time of the function module ?
      say for eg. I have executed a func. module at 1:39pm. How to retrieve this time  (1:39pm)
    2) I have created 3 billing document in tcode VF01 i.e 3 billing doucment no. would be created in SAP TABLE "VBRP" b/w 12am to 12:30 am.
    How to capture the latest SAP database update b/w time intervals?
    3) Suppose I am downloading TXT file using "GUI_DOWNLOAD" and say in 20th record some error has happened. I can capture the error using the exception.
    Is it possible to run the program once again from 21st records ? All this will be running in background...
    Kindly clarify....
    Points will be rewarded
    Thanks in advance

    1.Use tcode STAT input as Tcode of Fm and execute .
    2. See the billing documents are created in table VBRk header and there will always be Creation date and time.
    VBRk-Erdat "date ., u can check the time field also
    So now if u talk the date and time we can filter then display the records in intervals.
    3. with an error exeption how is my txt download finished .
    once exception is raised there will not be a download .
    regards,
    vijay

  • How to find out the GR Numbers for which IR has not been done

    Hi Sap Gurus,
    Can anybody tell me how to find out the G R Numbers for which Invoice Receipt has not been done. Any TC or ant standard process to find out.
    Thanks N Regards,
    Siddhartha

    Hi Siddarth,
    Solution :
            1) Go to SE16 - Table Name : EKBE (PO History)
            2) Field - BUDAT (Posting Date)
            3) Transaction event Type:
                             - 1 (Only GR's )
                             - 2 (Both GR and IR)
            4) We can fetch both GR Numbers and also PO Numbers for which IR has not been done if transaction event - 1.
    In addition to MB5S, you can try this also...

  • How to find out name of table for a structure.

    hello all,
                I want to find out name of table for a structure ADDR1_DATA. can anybody pls tell me how to find out it?
    Thanks,
    Ashu

    Hi Ashu,
    You write the structure name in se11
    after selecting the database table radio button
    click on the where used list button in the application tool bar.
    You will find the table name if it is used else where.
    Check out the website at:
    http://sap-idoc2edi-consulting.com/
    Read the blog at:
    http://blogs.ittoolbox.com/sap/ehadzipetros
    Regards,
    Jagadish

  • How to find out the Area Menu for a Report/ Table/Function Module

    Hi,
    Is there any procedure to find out the <b>"AREA MEANU"</b> for a Report/Table/Function Module...
    Or is there any Transaction code / Report is available to find out all the report for a particular "AREA MENU".
    Thank you for your quick response...
    Regards,
    Thiru
    <b></b>

    Hi,
    Check these below threads:
    user log in & log out time SAO
    How to find user log-out time ?
    Regards,
    Nitin

Maybe you are looking for