Joining vbak to cdhdr table for document changes

Hi Expert
I am hanging for a week in this project please need some advice
I want to join vbak table with cdhdr and select
vbak.vkbur (plant) and want to show that vkbur in the internal table of it_cdhdr
so as to select only those plant belong to vkbur so how can I join base on the below coding................
REPORT ZCHGDOC
NO STANDARD PAGE HEADING LINE-SIZE 120.
WRITE: sy-title, 40 'Page', sy-pagno.
ULINE.
TABLES: CDHDR,
         CDPOS,
         t001w,
         "VKBUR,
         "VBELN,
         VBAK,
         VBAP.
SELECTION-SCREEN BEGIN OF BLOCK DOCUMENT WITH FRAME TITLE TEXT-701.
SELECTION-SCREEN END OF BLOCK DOCUMENT.
SELECT-OPTIONS:
                 V1 FOR VBAK-VKBUR,
                 S_WERKS for T001W-werks,
                 objectid for  cdhdr-objectid,
                 udate for cdhdr-udate.
PARAMETER: USERNAME LIKE CDHDR-USERNAME.
DATA: BEGIN OF IT_VBAP OCCURS 0,
         OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
         OBJECTID LIKE CDHDR-OBJECTID,
         VBELN LIKE VBAP-VBELN,
          END OF IT_VBAP.
DATA: BEGIN OF IT_CDHDR OCCURS 0,
         OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
         OBJECTID LIKE CDHDR-OBJECTID,
         CHANGENR LIKE CDHDR-CHANGENR,
         USERNAME LIKE CDHDR-USERNAME,
         UDATE LIKE CDHDR-UDATE,
         UTIME LIKE CDHDR-UTIME,
         FNAME LIKE CDPOS-FNAME,
         TABNAME LIKE CDPOS-TABNAME,
         TABKEY LIKE CDPOS-TABKEY,
         VALUE_NEW LIKE CDPOS-VALUE_NEW,
         VALUE_OLD LIKE CDPOS-VALUE_OLD,
END OF IT_CDHDR.
DATA: WA LIKE LINE OF IT_CDHDR.
DATA: WA LIKE LINE OF IT_CDPOS.
DATA: BEGIN OF IT_CDPOS OCCURS 0,
         OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
         OBJECTID LIKE CDHDR-OBJECTID,
         CHANGENR LIKE CDHDR-CHANGENR,
         TABNAME LIKE CDPOS-TABNAME,
         TABKEY LIKE CDPOS-TABKEY,
         FNAME LIKE CDPOS-FNAME,
         VALUE_NEW LIKE CDPOS-VALUE_NEW,
         VALUE_OLD LIKE CDPOS-VALUE_OLD,
END OF IT_CDPOS.
Move-corresponding it_cdhdr to wa.
Move-corresponding it_cdpos to wa.
SELECT OBJECTCLAS
        OBJECTID
        CHANGENR
        USERNAME
        UDATE
        UTIME FROM CDHDR
        INTO CORRESPONDING FIELDS OF TABLE IT_CDHDR
WHERE OBJECTCLAS = 'VERKBELEG' or
      objectclas = 'BETRIEB'
      ORDER BY UDATE.
WHERE OBJECTCLAS = 'VERKBELEG'
OR OBJECTCLAS = 'BETRIEB' ORDER BY UDATE.
Filter data based upon Plant selection criteria.
IF NOT S_WERKS[] IS INITIAL.
DELETE IT_CDHDR WHERE NOT OBJECTID IN S_WERKS.
ENDIF.
IF IT_CDHDR[] IS NOT INITIAL.
   SELECT OBJECTCLAS
          OBJECTID
          CHANGENR
          VALUE_NEW
          VALUE_OLD
          FNAME
          TABNAME
          TABKEY
          FROM CDPOS
          INTO CORRESPONDING FIELDS OF TABLE IT_CDPOS
          FOR ALL ENTRIES IN IT_CDHDR
          WHERE
          OBJECTCLAS = IT_CDHDR-OBJECTCLAS
          AND OBJECTID = IT_CDHDR-OBJECTID
          AND CHANGENR = IT_CDHDR-CHANGENR.
          "or tabname = 'VBAP'.
   SORT IT_CDPOS BY OBJECTCLAS OBJECTID CHANGENR.
ENDIF.
Add tables CDPOS DATA TO CDHDR.
DATA: INDEX TYPE i.
LOOP AT IT_CDHDR.
   INDEX = SY-TABIX.
   READ TABLE IT_CDPOS WITH KEY OBJECTCLAS = IT_CDHDR-OBJECTCLAS
   OBJECTID = IT_CDHDR-OBJECTID
   CHANGENR = IT_CDHDR-CHANGENR BINARY SEARCH.
   IF SY-SUBRC = 0.
     IT_CDHDR-VALUE_NEW = IT_CDPOS-VALUE_NEW.
     IT_CDHDR-VALUE_OLD = IT_CDPOS-VALUE_OLD.
     MODIFY IT_CDHDR INDEX index TRANSPORTING value_new value_old.
   ENDIF.
   WRITE:/ SY-DATUM,SY-UZEIT,
          50 'DOCUMENT CHANGE REPORT',
         80 'Page', SY-PAGNO,
"  WRITE: / SY-REPID
          50 'DETAIL REPORT BY PLANT '.
   SKIP.
   ULINE.
*& T O P - O F - P A G E *
WRITE:/ 'UDATE:' ,SY-DATUM.
FORMAT COLOR 4 INTENSIFIED on.
Write: /35                           ' DOCUMENT CHANGES REPORT '.
   WRITE: /5 'DOCUMENT-NO'.
20 'TABNAME', 30 'TEXT_CASE', 50 'FNAME'.
   WRITE: /5 'DATE',  20 'FNAME', 45 'CHANGE-NO',65 'OLD-VALUE',80 'NEW-VALUE',95 'USER-NAME'.
   ULINE.
   LOOP AT IT_CDHDR INTO WA.
   on change of wa-objectid.
   Write: / wa-objectid UNDER'DOCUMENT-NO' ."color col_key.
   ENDON.
ULINE.
     " CDPOS-tabname UNDER'TABNAME', CDPOS-TEXT_CASE UNDER'TEXT_CASE',CDPOS-fname UNDER'FNAME'. "color col_key ,
     write: / wa-udate dd/mm/yyyy under'DATE' NO-GAP,wa-fname under'FNAME' NO-GAP,wa-changenr under 'CHANGE-NO',
     wa-value_old under'OLD-VALUE' LEFT-JUSTIFIED NO-GAP,
     wa-value_new under'NEW-VALUE' LEFT-JUSTIFIED NO-GAP ,wa-username under'USER-NAME' NO-GAP.
ENDON.
Move-corresponding it_cdhdr to wa.
*Write: / wa-objectid UNDER'DOCUMENT-NO' "color col_key.
*" CDPOS-tabname UNDER'TABNAME', CDPOS-TEXT_CASE UNDER'TEXT_CASE',CDPOS-fname UNDER'FNAME'. "color col_key ,
*write: / wa-udate dd/mm/yyyy under'DATE' NO-GAP,wa-utime under'TIME' NO-GAP,wa-changenr under 'CHANGE-NO',
ltrim(wa-value_old) under'OLD-VALUE' NO-GAP,
*wa-value_new under'NEW-VALUE' NO-GAP ,wa-username under'USER-NAME' NO-GAP.
   ENDLOOP.
ENDLOOP.

Hai everybody.
I am new to this forum. i got a job in abap recently. The below is my requirement.I want solution for this one. Anybody plz help me.
The change logs were captured in DBTABLOG for table ZWPRFRUND (in transaction ZWPG).
The only report which is currently used to get the change logs is RSVTPROT
Now my requirement is,
we need to display the change logs in the form of ALV.
We should divert the changes to CDHDR table instead of DBTABLOG, then we can use the RSSCD100 to display change logs.
The Important items for the change LOG needed in case of changes to table in “ZWPG” are,DATE ,TIME,USER,FIRST NAME,FILED NAME,OLD VALUE,NEW VALUE
The above fields need to be displayed in the grid. In the above list “FIELD NAME” denotes any field of the table in the transaction in “ZWPG”
Thanks & Regards,
Sujatha.T.

Similar Messages

  • Table for "documents change" with statuses

    Hi,
    I need a table where all the status changes for a service order (ticket) are stored (with dates).
    I know of CDHDR table, but there are no entries for statuses?
    Any idea?
    Thank you,
    Borut

    Thanks!
    I think this table will do the job.
    Kind regards,
    Borut

  • Tables for PIR change documents

    Dear Experts ,
    I need to know the tables for PIR change documents , as shown in t code ME14.
    Can anyone please let me know the same ?
    Regards
    Anis

    Hi,
    Check below tables
    CDHDR- Change document Header
    CDPOS- Change socument Item
    SAM

  • Log for document change details

    Hi,
    I am able to get the document change date in BKPF. But I am looking for detail log for document change. In which table i can get this.
    Thanks

    Hi,
    check tables CDHDR and CDPOS, maybe you find what you are looking for.
    BR Christian

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • What are the tables for documents in PP Orders

    Hi all,
    What are the tables for Document Items (type D) in PP orders ?
    Regards,
    Magda

    Welcome to SCN, please refer to the rules of engagement, link at the top of every forum, please search before asking basic questions.
    Thread locked.
    Thomas

  • Tables for Documents&doc. type assigned to Equipment master

    Hi
    I need a table for Documents&d oc. type assigned to Equipment master .I have tried in ITOB, EQUI, DRAW. i could not find this
    Thanks
    Seenu

    hi
    yes you can use object key, it  is the one which relates with the equipment ( object key <b>EQUI</b>)
    regards
    thyagarajan

  • Tables for PO changes and message output

    Hi Experts
    I wish to capture the changes in PO in the respective change out put. For this purpose, i need to fetch the relevant infmrmation applicable for the change output.
    Please let me know the appropriate tables for:
    -PO changes -item and header
    -PO message output
    Warm regards
    ramSiva

    Hi,
    Please check the following link :
    [Re: PO not showing Header Changes Log]
    Hope it helps,
    Best regards
    Amit Bakshi

  • Table for Delivery changed data

    Dear Gurus
    There is a requirement to create a z report based on delivery details. As according to the business process, the delivery weight is changed by z activities somedays after creation of delivery. Is there any table from which i can get the previous (old) value of weight which is now replaced by new weight value. (As this can be seen in delivery change data details, it shows the previous weight value and new weight value but i cant find the table for it)
    Thnx in advance
    Deepak Mehmi

    Hi
    Since Lakshmipati has already answered the question just to add on in CDHDR with VL02N you can find the object class as LIEFERUNG for any change in net weight. You can query in CDPOS with object class as LIEFERUNG as Object class and Object Id as the delivery number (with preceeding zeros-to make it 10 digits). The FNAME would be BTGEW for gross weight and NTGEW would be for net weight. The VALUE_NEW would give the new value and VALUE_OLD would give the old value.
    Thanks
    Indranil

  • Table for Document assigned to WBS

    In which table Document and WBS assignment is captured?
    Thx

    Hello,
    PRPS is separate table for WBS element. If you want to see it in DMS then check in object link field name in DRAW.
    Hope you are aware about the standard objects in SAP and their respective tables.
    Regards,
    Ravindra

  • Table for document type Number Range interval

    Hi,
    I want to know the number range interval for document type in the production system but I do not have authorisation for SPRO in the prd system.
    Kindly let me know the table name to check this number range interval for the document type.
    Table T003 stores only the number range and not the interval.
    Thanks
    Suresh

    Hi,
    The table which has document types is T003 but the number ranges are stored in a Structure IRDP. The number ranges are maintained directly in the production system.
    regards,
    radhika
    Edited by: kolipara radhika on Aug 25, 2008 6:01 AM

  • Table for documents

    hi experts
    iam doing report, i want to no in which table all sap documents are stored( iam talking about all modules not for one module))

    get specific.
    SAP has hundred of different documents and at least as much tables for them.

  • Tables for CJ40 - change cost

    Hi Gurus,
    Which is the table for CJ40 --> actuivity input?
    In this field we enter sender cost Ctr and Sender Act.Typ. Is there any table for same for PS?
    thanks in advance.
    NArender.

    In SE16, PROJ, only project header details are provided.
    In CJ40, we plan cost for each and individual WBS element. For a particular WBS element, if I plan cost with "activity input", system pops up following columns: Sender cost center, Sender activity type, and quantity. Quantity will be valuated with KP27 entries.
    So my question is: in which table this data will be saved (WBS element --> Sender cost center --> sender activity type) ?
    Regards,
    Narender.

  • Table for po changes

    Hi,
       The changes in po item level and po changes at header level which table is maintained
          Thanks and Regards
            Anil

    Hi
    CDHDR - Change document header
    CDPOS - Change document items in addition to that following tables are used for Purchasing.
    EBAN - Purchase requisition: items
    EBKN - Purchase Requisition: account assignment 
    STXH - SAPScript Text Header
    STXL - SAPScript Text Lines
    EKKO - Purchasing document header 
    EKPO - Purchasing Document: Item
    EKET - Purchasing Document: Delivery Schedules
    MDBS - Material View of Order Item/Schedule Line (good to find open PO's)
    EKKN - Account assignment in purchasing document 
    EORD - Purchasing Source List
    EIPA - Order price history record 
    EKAB - Release documentation 
    EKBE - Purchasing document history 
    EKBZ - Purchasing document history: delivery costs 
    EKPB - "Material to be provided" item in purchasing document 
    ESKL - Account assignment specification for service line 
    ESKN - Account assignment in service package 
    ESLH - Service package header data 
    ESLL - Lines in service package 
    ESSR - Service entry sheet header data 
    ESUC - External services management: Unplanned limits for contract item 
    ESUH - External services management: unplanned service limits header data 
    ESUP - External services management: unplanned limits for service packages 
    ESUS - External services management: Unplanned limits for service types
    EINA - Purchase Info Record: General
    EINE - Purchasing info record: purchasing organization data 
    KONP - Condition Item
    KONH - Condition Header
    Thanks & Regards
    Anilkumar Dalai

  • Report or table  for the changed sales orders

    Hi Friends,
      Does anyone know of the standard report with which we can track all the sales orders where the changes have been made in particular date range?
      If not standard report then atleast the table or the structure where the value is stored.
    I know that we can track the orders one by one but I am looking for a list of orders.
    Thanks in advance.
    Regards
    Karan

    Hi,
    Try CDHDR for header and CDPOS for items.
    The only trick here is finding the object.
    Reward points if useful
    Regards,
    Amrish Purohit

Maybe you are looking for

  • Problem deploying a web application to oc4j in Unix

    Hi! I would like to ask for someone's help on a problem I encountered while accessing a web app deployed to oc4j in Unix. Before deploying the application in Unix, I tried it on a Windows2000 server and it worked fine. I copied the same files (classe

  • IMovie fails every time I try to open it since I updated Tiger

    What is going on? I just received my Final Cut Express 3.5 update. Before I could install it, my computer required me to upgrade Tiger to V. 10.4.8. So I upgraded, installed Final Cut Express, which works great. Now every time I try to open an iMovie

  • Error installing Salesforce Chatter via Adobe Air

         I've been trying to install Salesforce Chatter on a users computer and keep receiving the error, "Sorry an error occurred. The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the

  • My iMac 2009 model won't start.

    My iMac 2009 model won't start. Was working fine the night before, tried to on it but still no response. I also tried unplugging and plugging into the main switch plus other power points several times , doesn't work either. Please assist as most of w

  • ABAP/4 processor: LOAD_PROGRAM_LOST error

    Hi, One of my job got failed , the errer message wwhich iam getting is "ABAP/4 processor: LOAD_PROGRAM_LOST" can anybody tell me wht could be the reason for this Thanks Yogesh Gupta