How to use CDHDR and CDPOS tables

Hello Gurus,
How can the data be extracted from CDHDR and CDPOS tables ?
For example, I want to find the changes for the material master, what is the object need to be given in the OBJECT value etc..
I tried to use restricting the transaction MM02 and the date valid from and to, but it is taking longer time.
Appreciate, if you can provide the objects which can be used to track the changed data like Production orders etc..
Thanks
Aadhya

Hi Aadhya,
For the Change Document Object (OBJECTCLAS), you can use the following item:
MATERIAL = material master
ORDER = production order/maintenance order
EINKBELEG = purchasing document
VERKBELEG = sales document
The Object Value (OBJECTID) is usually the object's number, such as material number, production order number, etc.
Get the Document Number (CHANGENR) and go to CDPOS to see the changes detail.
Regards,
Julian

Similar Messages

  • CDHDR and CDPOS tables are not updated

    Hi,
    When I am trying to change (or delete) Project definitions or WBS elements (changed all its related data which have change document ticked in its data element) those changes are not captured in CDHDR and CDPOS tables.
    Here in our system PROJ object class exists in SCDO t-code and has all its generated programs, but still not able to find changes in CDHDR and CDPOS tables.
    Can anybody plz let me know if I am missing anything or PROJ is not the appropriate object class or does BASIS team need to do any configuration to capture change documents in CDHDR or CDPOS tables because I do not see not even one record with PROJ object class in those tables.
    Appriciated for quick response.
    Regards,
    M, Manohar

    Hi Manohar,
    Even we have project system in my project.We are able to see the changes and we did not done any settings for that.Just check with your basis people else raise an oss note.I did not see any sap notes also related to that.
    Regards,
    Madhu.

  • Use of CDHDR and CDPOS Table in Query

    Hi all,
    I am having requirement where i need to fetch the data from the CDHDR and CDPOS by passing the release indicator from EKKO.
    I would like to know whether the performance will b the issue with this as the CDHDR and CDPOS are the tables which consist of Huge data.
    Pls let me know what will b the impact on performance and other things..
    Regards
    KK

    Hi,
    Pls chk this links, might be helpful;
    https://forums.sdn.sap.com/click.jspa?searchID=5749799&messageID=1456945
    Re: Delta - Records changed directly in table
    Generic delta queue for CDHDR
    LBWE, delta extraction without BW
    http://www.sap123.com/showthread.php?t=47
    Regards
    CSM Reddy

  • How to Update CDHDR and CDPOS for a ZTable.

    Hi Gurus,
    I have created a change document to update tables CDHDR and CDPOS ,which updates these tables when i insert a new record to my ZTABLE.Insertion of a new record is working fine,but when i update a existing record the CHANGEID COLUMN in CDPOS table is 'D'.
    Can anyone expalin be why this is happening.
    Regards,
    Venu.

    Hi Gautam,
    Below is the code i have written. i guess, i have passed write values, if not let me know.
    Hope u have worked on it.if possible can u send me the code.
    CALL FUNCTION 'MAKTX_WRITE_DOCUMENT'
            EXPORTING
              objectid                      = 'MAKTX'
              tcode                         = 'Z100'
              utime                         = sy-uzeit
              udate                         = sy-datum
              username                      = sy-uname
      PLANNED_CHANGE_NUMBER         = ' '
      object_change_indicator       = 'U'
      PLANNED_OR_REAL_CHANGES       = ' '
      NO_CHANGE_POINTERS            = ' '
             upd_icdtxt_maktx              = 'U'
             upd_zchg_doc                  = 'U'
            TABLES
              icdtxt_maktx                  = itab3
              xzchg_doc                     = itab1     "New Values
              yzchg_doc                     = itab2     "Old Values
    Regards,
    Venu.

  • How to use cfloop and a table together

    let us say that I had a query that would return the first
    name of an ever changing number of people. I would then like to
    display each name in its own <td> at five <td> per row,
    then start the next row. keeping in mind that sometimes I might
    have less than 5 names and most of the time more than 5 with no
    maximum. Can you give me some ideas on how to handle my cfloop
    creating the needed <td>#name#</td>.

    This finishes Ian's code
    <tr>
    <cfloop query="nameQry">
    <td>#firstName#</td>
    <cfif currentrow is recordcount>
    </tr>
    <cfesleif nameQry.currentRow MOD 5 EQ 0>
    </tr><tr>
    </cfif>
    </cfloop>
    </tr>
    I believe all that will do is add an extra </tr> tag to
    the last row.
    The last closing </tr> is handled with the one that
    comes after the loop
    block.
    The issue I was pointing out was that, if you have 12
    records, my code
    will create three rows but the last row will only have two
    cells in it.
    Not five like the others. This may not generate a desirable
    display.
    If one wanted 5 cells in the list row, three of them empty,
    further
    logic will be required.

  • Reg : CDHDR and CDPOS.......

    HiAll,
    I need to capture the date at the schedule line level which was changed at sometime.
    I know that I have to go to CDHDR and CDPOS tables to capture the changes.
    But in order to access those tables, we need the object and key some fields .
    For schedule lines what are the values do we need to pass?
    Any suggestions are helpful.
    Thanks and Regards
    Abhilash.

    Hi Dude,
    REPORT z_alv_cdhdr_cdpos.
    *This ALV report displays tables CDHDR and CDPOS *
    TYPE-POOLS slis. " Global ALV types
    * constants
    CONSTANTS : c_x VALUE 'X',
    c_eb9 TYPE syucomm VALUE '&EB9',
    c_refresh TYPE syucomm VALUE '&REFRESH'.
    * types
    TYPES :BEGIN OF ty_s_cdhdr.
    INCLUDE TYPE cdhdr.
    TYPES :checkbox TYPE xfeld,
    END OF ty_s_cdhdr,
    BEGIN OF ty_s_cdpos.
    INCLUDE TYPE cdpos.
    TYPES : checkbox TYPE xfeld,
    END OF ty_s_cdpos.
    * internal tables
    DATA : gs_cdhdr TYPE cdhdr, " Change document header
    * Layout for ALV
    gs_layout TYPE slis_layout_alv,
    * Change document header
    t_cdhdr TYPE TABLE OF ty_s_cdhdr.
    * selection screen design
    SELECT-OPTIONS : s_objcls FOR gs_cdhdr-objectclas OBLIGATORY,
    s_objtid FOR gs_cdhdr-objectid,
    s_chngnr FOR gs_cdhdr-changenr,
    s_usrnam FOR gs_cdhdr-username DEFAULT sy-uname,
    s_udate FOR gs_cdhdr-udate DEFAULT sy-datum,
    s_time FOR gs_cdhdr-utime,
    s_tcode FOR gs_cdhdr-tcode,
    s_plncnr FOR gs_cdhdr-planchngnr,
    s_chngno FOR gs_cdhdr-act_chngno,
    s_wsplnd FOR gs_cdhdr-was_plannd,
    s_chngid FOR gs_cdhdr-change_ind.
    SELECTION-SCREEN SKIP.
    PARAMETERS p_max TYPE numc3 OBLIGATORY DEFAULT '200'.
    * start-of-selection .
    START-OF-SELECTION.
    PERFORM f_read_data.
    * end-of-selection .
    END-OF-SELECTION.
    PERFORM f_display_cdhdr.
    *Form f_read_data
    FORM f_read_data.
    *Read Change document header
    SELECT * INTO TABLE t_cdhdr
    UP TO p_max ROWS
    FROM cdhdr
    WHERE objectclas IN s_objcls
    AND objectid IN s_objtid
    AND changenr IN s_chngnr
    AND username IN s_usrnam
    AND udate IN s_udate
    AND utime IN s_time
    AND tcode IN s_tcode
    AND planchngnr IN s_plncnr
    AND act_chngno IN s_chngno
    AND was_plannd IN s_wsplnd
    AND change_ind IN s_chngid.
    ENDFORM. " F_READ_DATA
    *Form f_display_cdhdr
    FORM f_display_cdhdr.
    DATA :ls_event_exit TYPE slis_event_exit,
    lt_event_exit TYPE slis_t_event_exit.
    gs_layout-zebra = c_x.
    gs_layout-colwidth_optimize = c_x.
    gs_layout-group_change_edit = c_x.
    gs_layout-allow_switch_to_list = c_x.
    gs_layout-box_fieldname = 'CHECKBOX'.
    *Activate 'More' button
    CLEAR ls_event_exit.
    ls_event_exit-after = c_x.
    ls_event_exit-ucomm = c_eb9. " More
    APPEND ls_event_exit TO lt_event_exit.
    *Activate refresh button
    CLEAR ls_event_exit.
    ls_event_exit-after = c_x.
    ls_event_exit-ucomm = c_refresh. " Refresh
    APPEND ls_event_exit TO lt_event_exit.
    *Display ALV
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-cprog
    i_callback_user_command = 'USER_COMMAND'
    i_callback_pf_status_set = 'PF_STATUS_SET'
    i_structure_name = 'CDHDR'
    is_layout = gs_layout
    it_event_exit = lt_event_exit
    i_save = 'A'
    TABLES
    t_outtab = t_cdhdr.
    ENDFORM. " F_DISPLAY_CDHDR
    *FORM USER_COMMAND *
    FORM user_command USING u_ucomm TYPE syucomm
    us_selfield TYPE slis_selfield. "#EC CALLED
    *Macro definition
    DEFINE m_sort.
    add 1 to ls_sort-spos.
    ls_sort-fieldname = &1.
    ls_sort-up = c_x.
    append ls_sort to lt_sort.
    END-OF-DEFINITION.
    DATA :
    ls_cdhdr TYPE ty_s_cdhdr,
    ls_sort TYPE slis_sortinfo_alv,
    lt_sort TYPE slis_t_sortinfo_alv,
    *Change document items
    lt_cdpos TYPE TABLE OF ty_s_cdpos.
    CASE u_ucomm.
    WHEN '&IC1' OR c_eb9.
    PERFORM check_marked USING us_selfield.
    *Read Change document items
    LOOP AT t_cdhdr INTO ls_cdhdr WHERE checkbox = c_x.
    SELECT * APPENDING TABLE lt_cdpos
    FROM cdpos
    WHERE objectclas = ls_cdhdr-objectclas
    AND objectid = ls_cdhdr-objectid
    AND changenr = ls_cdhdr-changenr.
    ENDLOOP.
    m_sort 'CHANGENR'.
    *Display ALV
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-cprog
    i_structure_name = 'CDPOS'
    is_layout = gs_layout
    it_sort = lt_sort
    i_save = 'A'
    TABLES
    t_outtab = lt_cdpos.
    WHEN c_refresh.
    PERFORM f_read_data.
    us_selfield-refresh = c_x.
    ENDCASE.
    ENDFORM. " USER_COMMAND
    *Form CHECK_MARKED
    *What has been marked in t_cdhdr
    FORM check_marked USING us_selfield TYPE slis_selfield.
    FIELD-SYMBOLS :
    TYPE ty_s_cdhdr.
    READ TABLE t_cdhdr TRANSPORTING NO FIELDS
    WITH KEY checkbox = c_x.
    IF NOT sy-subrc IS INITIAL AND
    NOT us_selfield-tabindex IS INITIAL.
    READ TABLE t_cdhdr INDEX us_selfield-tabindex ASSIGNING .
    -checkbox = c_x.
    ENDIF.
    ENDFORM. " CHECK_MARKED
    *FORM PF_STATUS_SET *
    FORM pf_status_set USING ut_extab TYPE slis_t_extab. "#EC CALLED
    *Display 'Refresh' button and 'More' button
    DELETE ut_extab WHERE fcode = c_refresh
    OR fcode = c_eb9.
    SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
    EXCLUDING ut_extab.
    ENDFORM. " PF_STATUS_SET
    * how to use the function module
    *--- how to use the function module CHANGEDOCUMENT_READ_HEADERS
    REPORT zchange_headers .
    DATA: BEGIN OF it_cdhdr OCCURS 0.
    INCLUDE STRUCTURE cdhdr.
    DATA: END OF it_cdhdr.
    PARAMETERS: begdate LIKE cdhdr-udate ,
    enddate LIKE cdhdr-udate ,
    begtime LIKE cdhdr-utime ,
    endtime LIKE cdhdr-utime .
    INITIALIZATION .
    begdate = sy-datum .
    enddate = sy-datum .
    begtime = '000001' .
    endtime = '235959'.
    CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
    EXPORTING
    date_of_change = begdate
    objectclass = 'EINKBELEG' "Object Class T-Code: SCDO
    time_of_change = begtime
    username = sy-uname
    date_until = enddate
    time_until = endtime
    TABLES
    i_cdhdr = it_cdhdr
    EXCEPTIONS
    no_position_found = 1
    wrong_access_to_archive = 2
    time_zone_conversion_error = 3
    OTHERS = 4.
    IF sy-subrc NE 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF sy-subrc = 0.
    LOOP AT it_cdhdr.
    WRITE:/ it_cdhdr-objectclas,
    it_cdhdr-objectid,
    it_cdhdr-changenr,
    it_cdhdr-username,
    it_cdhdr-udate,
    it_cdhdr-utime,
    it_cdhdr-tcode.
    ENDLOOP.
    ENDIF.

  • Plant code like with CDHDR and CDPOS

    Hi Expert
    I have created a report to see the changes made for the following document from CDHDR and CDPOS tables and cluster respectively
    I want to know where I can find the Plant code in these above tables and if so how can i link with the above tables
    I need to display the report with range by plant code, document no, udate and parameter username
    regards

    hi,
    check this code
    TABLES : MARC.
    DATA :BEGIN OF GI_MARC OCCURS 0,
          MATNR LIKE MARC-MATNR,
          WERKS LIKE MARC-WERKS,
          DISPO LIKE MARC-DISPO,
          END OF GI_MARC.
    DATA : CHAR TYPE I,
           COUNT TYPE I,
           VAR TYPE I.
    DATA : BEGIN OF GI_FINAL OCCURS 2000,
           MATNR LIKE MARC-MATNR,
           DISPO LIKE MARC-DISPO,
           USERNAME LIKE CDHDR-USERNAME,
           UDATE LIKE CDHDR-UDATE,
           UTIME LIKE CDHDR-UTIME,
           TCODE LIKE CDHDR-TCODE,
           TABNAME LIKE CDPOS-TABNAME,
           TABKEY  LIKE CDPOS-TABKEY,
           FNAME  LIKE CDPOS-FNAME,
           VALUE_NEW  LIKE CDPOS-VALUE_NEW,
           VALUE_OLD   LIKE CDPOS-VALUE_OLD,
           CHANGENR LIKE CDHDR-CHANGENR,
           END OF GI_FINAL.
    DATA : MATNR LIKE MARC-MATNR,
           DISPO LIKE MARC-DISPO,
           USERNAME1 LIKE CDHDR-USERNAME,
           UDATE1 LIKE CDHDR-UDATE,
           UTIME LIKE CDHDR-UTIME,
           TCODE LIKE CDHDR-TCODE,
           CHANGENR LIKE CDHDR-CHANGENR.
    DATA : GI_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE.
    DATA : GI_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    DATA : OBJECTCLAS LIKE CDHDR-OBJECTCLAS VALUE 'MATERIAL',
           OBJECTID LIKE CDHDR-OBJECTID,
           USERNAME LIKE CDHDR-USERNAME VALUE 'RSS-SPE',
           UDATE LIKE CDHDR-UDATE VALUE '20070101',
           CHANGE_IND LIKE CDHDR-CHANGE_IND VALUE 'U'.
    type-pools: slis.
    data: gt_slis_fcat type slis_t_fieldcat_alv.
    data: gt_fieldcat type slis_t_fieldcat_alv.
    *data: gt_fieldcatall type slis_t_fieldcat_alv.
    data: g_repid like sy-repid.
    data: gs_layout type slis_layout_alv.
    gs_layout-zebra             = 'X'.
    gs_layout-colwidth_optimize = 'X'.
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-110.
    SELECT-OPTIONS :  P_DISPO FOR MARC-DISPO.
    SELECT-OPTIONS : RECORDS FOR CHAR.
    SELECTION-SCREEN : END OF BLOCK B1.
    START-OF-SELECTION.
    perform process_data.
    perform f_fieldcat_init using gt_fieldcat[].
    perform alv_display tables gi_final using gt_fieldcat[].
    form process_data.
      SELECT MATNR WERKS DISPO FROM MARC INTO TABLE GI_MARC
                                WHERE DISPO IN P_DISPO
                                AND WERKS = '1011'." Becoz we hav to chk the
    the changes made in the material while extendin tht matrl frm 1011 to
    *other plant.
      IF NOT GI_MARC[] IS INITIAL.
        IF NOT RECORDS-LOW IS INITIAL .
          IF NOT RECORDS-HIGH IS INITIAL.
            DESCRIBE TABLE GI_MARC LINES COUNT.
            IF RECORDS-HIGH < COUNT.
              DELETE GI_MARC FROM RECORDS-HIGH TO COUNT.
            ENDIF.
            IF RECORDS-LOW <> 1.
              IF RECORDS-LOW <> 0.
                DELETE GI_MARC FROM 1 TO RECORDS-LOW.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      LOOP AT GI_MARC.
        CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
          EXPORTING
            INPUT              = GI_MARC-MATNR
         IMPORTING
           OUTPUT             = GI_MARC-MATNR
    EXCEPTIONS
      LENGTH_ERROR       = 1
      OTHERS             = 2
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        OBJECTID = GI_MARC-MATNR .
        CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
          EXPORTING
      ARCHIVE_HANDLE                   = 0
           DATE_OF_CHANGE                   = UDATE
            OBJECTCLASS                      = OBJECTCLAS
            OBJECTID                         = OBJECTID
      TIME_OF_CHANGE                   = '000000'
           USERNAME                         = USERNAME
      LOCAL_TIME                       = ' '
      DATE_UNTIL                       = '99991231'
      TIME_UNTIL                       = '235959'
          TABLES
            I_CDHDR                          = GI_CDHDR
         EXCEPTIONS
           NO_POSITION_FOUND                = 1
           WRONG_ACCESS_TO_ARCHIVE          = 2
           TIME_ZONE_CONVERSION_ERROR       = 3
           OTHERS                           = 4
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
             EXPORTING
                  TEXT = 'Processing'.
        IF NOT GI_CDHDR[] IS INITIAL.
          LOOP AT GI_CDHDR.
          MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
          MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
          MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
          MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
          MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
          MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
            VAR = 1.
            CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
              EXPORTING
                INPUT              = GI_FINAL-MATNR
                IMPORTING
               OUTPUT             = GI_FINAL-MATNR
             EXCEPTIONS
               LENGTH_ERROR       = 1
               OTHERS             = 2
            IF SY-SUBRC <> 0.
            ENDIF.
            OBJECTID = GI_FINAL-MATNR ."to ensure that objid is in proper
    *format
            SELECT *
                   FROM CDPOS
                   INTO TABLE GI_CDPOS
              PACKAGE SIZE 100
              FOR ALL ENTRIES IN GI_cdhdr
                   WHERE OBJECTID = OBJECTID
                     AND CHANGENR = GI_CDHDR-CHANGENR
                     AND OBJECTCLAS = OBJECTCLAS
                     AND CHNGIND =  CHANGE_IND." only those values will b
    *takn which have been modified nd nt created
            IF SY-SUBRC = 0.
              LOOP AT GI_CDPOS.
          MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
          MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
          MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
          MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
          MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
          MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
                MOVE GI_CDPOS-TABNAME TO GI_FINAL-TABNAME.
                MOVE GI_CDPOS-TABKEY TO GI_FINAL-TABKEY.
                MOVE GI_CDPOS-FNAME TO GI_FINAL-FNAME.
                MOVE GI_CDPOS-VALUE_NEW TO GI_FINAL-VALUE_NEW.
                MOVE GI_CDPOS-VALUE_OLD TO GI_FINAL-VALUE_OLD.
                  APPEND GI_FINAL.
                  CLEAR GI_FINAL.
               ENDIF.
                VAR = VAR + 1.
       ENDSELECT.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
              CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
             EXPORTING
                  TEXT = 'Processing'.
        ENDIF.
      ENDLOOP.
      endform.
    form f_fieldcat_init using lt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv.
       clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'MATNR'.
      ls_fieldcat-seltext_l    = 'Material number'.
    ls_fieldcat-tabname      = 'GI_final'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'DISPO'.
      ls_fieldcat-seltext_l    = 'mrp controller'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'USERNAME'.
      ls_fieldcat-seltext_l    = 'Username'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'CHANGENR'.
      ls_fieldcat-seltext_l    = 'Change Number'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'UDATE'.
      ls_fieldcat-seltext_l    = 'modified date'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'UTIME'.
      ls_fieldcat-seltext_l    = 'MODIFIED TIME'.
      append ls_fieldcat to lt_fieldcat.
    clear ls_fieldcat.
    ls_fieldcat-fieldname    = 'UDATE'.
    ls_fieldcat-seltext_l    = 'MODIFIED DATE'.
    append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TCODE'.
      ls_fieldcat-seltext_l    = 'TRANSACTION CODE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TABNAME'.
      ls_fieldcat-seltext_l    = 'TABLE NAME'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TABKEY'.
      ls_fieldcat-seltext_l    = 'TABLE KEY'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'FNAME'.
      ls_fieldcat-seltext_l    = 'FNAME'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'FVALUE'.
      ls_fieldcat-seltext_l    = 'FVALUE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'VALUE_NEW'.
      ls_fieldcat-seltext_l    = 'NEW VALUE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'VALUE_OLD'.
      ls_fieldcat-seltext_l    = 'OLD VALUE'.
      append ls_fieldcat to lt_fieldcat.
    endform.                    " f_fieldcat_init
    form alv_display tables  gi_final using gt_fieldcat .
      call function 'REUSE_ALV_LIST_DISPLAY'
       exporting
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = ' Material list '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
         is_layout                      = gs_layout
         it_fieldcat                    = gt_fieldcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        tables
          t_outtab                       = gi_final
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.
    regards
    siva

  • To fetch from CDHDR and CDPOS using FM CHANGEDOCUMENT_READ_RANGES

    Hi all,
    Please let me know how to fetch the Details from  CDHDR and CDPOS using Function Module  CHANGEDOCUMENT_READ_RANGES. If possible Clear me with an Example. It has to fetch the datas of Table KNVV
    KNV1 etcc.... Separately for the Corresponding Table Selected In Report..
    With regards,
    Sudhakar Govndaraj.

    Hi Sudhakar,
    cdhdr-objectclas = 'MATERIAL'.
      cdhdr-objectid   = t_mara-matnr.
      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 period.
        CHECK icdhdr-username IN name.
        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-matnr.
          APPEND itab.
        ENDLOOP.
      ENDLOOP.
    Please refer the blog
    /people/erwan.lebrun/blog/2007/03/09/documents-how-to-track-changes-through-abap
    Edited by: Rahul Babukuttan on Nov 26, 2010 11:38 AM

  • Problem in updating  table's CDHDR and CDPOS

    Hello Expert's ,
    I have created one z' transaction code to update the  VIEW  name ZV_PO which is the combination of three tables: EKKO, EKPO and EKKN. These tables are getting updated with the changed values. But one thing the sap standard tables CDHDR and CDPOS are not getting updated .
    Can any one please tell me , whether updating on VIEW's will not make update in the sap standard tables CDHDR and CDPOS as the activition log will not be there in VIEW's compared to table's and how to make it the changes reflected in the table's CDHDR and CDPOS.
    Points will be rewarded 100%.
    Thanks in advance .
    Ashok
    Edited by: ASHOK on Mar 17, 2008 11:56 AM

    Hi Thomas,
    Thanks for your reply . Can you please little bit brief about view maintanance and the transaction SCDO object EINKBELEG.
    When i looked into the transaction SCDO  i could seen the following tables ,
    EKEK
    EKES
    EKET
    EKKN
    EKKO
    EKPA
    EKPO
    KONVC
    Kindly Liitle brief about your solution .
    Assured Points 100% !
    Thanks in advance for your support!
    With Best Regards,
    Ashok

  • Condition information is not reflecting in tables CDHDR and CDPOS

    Hi,
    When a Purchase order condition information is changed or created, the changes are not reflecting in the table CDHDR and CDPOS.
    Please can someone suggest a solution .

    Hi Raj
    When there are any changes in the conditions, the overall difference will be reflected in field <b>EFFWR i.e Effective Value of Item.</b> Please check...
    Kind Regards
    Eswar

  • Merging BSEG ,CDHDR and CDPOS.

    How can i merge BSEG which is a cluster table,CDHDR and CDPOS(Cluster Table)??

    >
    sumanth reddy wrote:
    YOU CAN MERGE THE FIELDS  THROUGH INNER JOIN.
    BSEG is a cluster table so u can not use an inner join on it.
    кu03B1ятu03B9к

  • Price change in Schedule agreement but not updated in CDHDR and CDPOS

    Hi Experts
    We have change price in  SA ,please see the below screen shot. But these changes not update in CDHDR and CDPOS. We can see current rate in ME33L.
    Please guide how to update these changes.
    Regards
    Parkash Chand

    Generally in standard, the changes logs are saved into table CDPOS and CDHDR.
    Its working fine in my system.
    Can you see the changes log with regards to document number by running program RSSCD200.
    Go to SE38 or SA38, enter the program RSSCD200 then press execute.
    Enter * in object class and enter the document number
    Then press execute. You can find more details into the wiki content Steps to enable logging of changes in change documents - Code Gallery - SCN Wiki

  • Question on CDHDR and CDPOS

    Hi,
    Currently we have a generic datasource on CDHDR for a limited TCODE.
    Now the requirement is to include the line items as well.
    When I use document number to fetch the line items. It has one to many relationship.
    Could you please advise what should be the solution to get the informaiton from both CDHDR and CDPOS..
    Thanks in advance
    Muiz

    Hi,
    There are two way to do that.
    1:  Create a data base view on both the table. And use the view for creating the generic DS in RSO2.
    2:  Create a FM base generic data source. In the FM you can use join condition to fetch the data from Both the table.
    3:  Query base generic data source is not advisable here.
    Thanks

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to use perform and endperform in scripts

    Can anybody cleaerly explains me how to use perform and endperform in scripts with an example to add something extra dynamically to the standard script (like rvorder01).
    thanks in advance.
    regards
    anil.

    Check this example:
    In form
    PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'
    USING &EKKO-EKORG&
    USING &EKPO-WERKS&
    USING &EKKO-EKGRP&
    USING &EKKO-BSTYP&
    CHANGING &COMPNAME&
    CHANGING &SENDADR&
    CHANGING &INVCADR&
    CHANGING &COMPADR&
    CHANGING &COVERLTR&
    CHANGING &SHIPADR&
    CHANGING &REMINDER&
    CHANGING &REJECTION&
    CHANGING &POSTADR&
    CHANGING &LOGO&
    ENDPERFORM
    In program
    FORM READ_TEXTS TABLES IN_PAR   STRUCTURE ITCSY
                           OUT_PAR  STRUCTURE ITCSY.
      DATA : L_EKORG TYPE EKORG,
             L_WERKS TYPE WERKS_D,
             L_BSTYP TYPE BSTYP,
             L_EKGRP TYPE BKGRP.
      READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .
      CHECK SY-SUBRC = 0.
      L_EKORG = IN_PAR-VALUE.
      READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .
      CHECK SY-SUBRC = 0.
      L_WERKS = IN_PAR-VALUE.
      READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .
      CHECK SY-SUBRC = 0.
      L_EKGRP = IN_PAR-VALUE.
      READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .
      CHECK SY-SUBRC = 0.
      L_BSTYP = IN_PAR-VALUE.
      CLEAR Z08M1_ORG_TEXTS.
      SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
                                              AND WERKS = L_WERKS
                                              AND EKGRP = L_EKGRP
                                              AND BSTYP = L_BSTYP.
      IF SY-SUBRC NE 0.
        SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
                                               AND WERKS = L_WERKS
                                               AND EKGRP = L_EKGRP
                                               AND BSTYP = SPACE.
      ENDIF.
      READ TABLE OUT_PAR WITH KEY 'COMPNAME'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'SENDADR'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'INVCADR'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'COMPADR'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'COVERLTR'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'SHIPADR'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'REMINDER'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'REJECTION'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'POSTADR'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.
      MODIFY OUT_PAR INDEX SY-TABIX.
      READ TABLE OUT_PAR WITH KEY 'LOGO'.
      OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.
      MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Check and let me know if u face any problem.
    Regards

Maybe you are looking for

  • Help! movies i bought in the itunes store willl not sync to my iphone

    I recently purchased rocky from the itunes store. As soon as the movie finished downloading, I attempted to put it on my iphone, but when i did this an error message appeard which said that rocky could not be copied onto my iphone because it cannot b

  • FCP PROJECT WONT OPEN DUE TO BORIS TITLE PLUG IN

    Not sure if anyone else has had this but have been working on a project in the fcp 7.0.1 for 4 weeks now with no trouble at all and have just tried to open it. It will not open at all and keep coming up with an error log with the following title: FIN

  • Set Password for VIs Programmatically

    Hi Experts, I would like to create a VI for setting passwords to my VIs. My VIs are palced in llbs... That's peace of cake, but I want to save the VI too in order to password-protection take effect. I found a property node, "save for previous version

  • Using SUM BY to limit result of 3 union queries (11g)

    Hey guys, First time posting here (btw, I've tried changing my handle name via edit profile here to no success! Ugh!). I need to modify a report that's built off of 3 union queries.  Here's a simplified table version of the union result: Label Year C

  • FM FOR AUTOINCREMENTATION OF PK

    HI to all, I ve a requirement to fetch data from the DB Table and want to increment it in the screen. So that when i m opening it for the next time it will show me the next value where to insert the data.