Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with Update CDPOS and CDHDR table

Former Member
0 Likes
1,496

Hello Friends,

I have a ztable for which i want to capture the change log. I understand this is not taking care by SAP directly . So i have created a change document object (SCD0) but still i am having some problem with the table updation . I have search SDN and try all the possibility i got but i failed every time .

In CDPOS table it is always updating the old value and new value fields is blank though i am passing both the value to the *WRITE_DOCUMENT function module .And there is no entry in CDHDR table .

I am giving the code snapshot for your attention .

        MOVE-CORRESPONDING : /lgc/sdtvs98 TO WA_/LGC/SDTMCCT_NEW,

                             /LGC/SDTMCCT TO WA_/LGC/SDTMCCT_OLD.

       APPEND:WA_/LGC/SDTMCCT_NEW TO /LGC/SDTMCCT_NEW,

              WA_/LGC/SDTMCCT_OLD TO /LGC/SDTMCCT_OLD.

       LS_OBJECTID = /lgc/sdtvs91-kunnr.

CALL FUNCTION '/LGC/CCGWWMCCT_WRITE_DOCUMENT' IN UPDATE TASK

  EXPORTING

    objectid                      = LS_OBJECTID 

    tcode                         = 'XXXX'

    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_CCGWWMCCT          = 'U'

   UPD_LGC_SDTMCCT               =  'U'

  tables

*    icdtxt_ccgwwmcct              = lt_cdtxt

    xlgc_sdtmcct                  = /LGC/SDTMCCT_NEW"NEW

    ylgc_sdtmcct                  = /LGC/SDTMCCT_OLD"OLD

         .

COMMIT work.

Please have a look into the code and let me know if i missed something . 

Thanks In Advace,

Satya

Hello Friends,

I have a ztable for which i want to capture the change log. I understand this is not taking care by SAP directly . So i have created a change document object (SCD0) but still i am having some problem with the table updation . I have search SDN and try all the possibility i got but i failed every time .

In CDPOS table it is always updating the old value and new value fields is blank though i am passing both the value to the *WRITE_DOCUMENT function module .And there is no entry in CDHDR table .

I am giving the code snapshot for your attention .

        MOVE-CORRESPONDING : /lgc/sdtvs98 TO WA_/LGC/SDTMCCT_NEW,

                             /LGC/SDTMCCT TO WA_/LGC/SDTMCCT_OLD.

       APPEND:WA_/LGC/SDTMCCT_NEW TO /LGC/SDTMCCT_NEW,

              WA_/LGC/SDTMCCT_OLD TO /LGC/SDTMCCT_OLD.

       LS_OBJECTID = /lgc/sdtvs91-kunnr.

CALL FUNCTION '/LGC/CCGWWMCCT_WRITE_DOCUMENT' IN UPDATE TASK

  EXPORTING

    objectid                      = LS_OBJECTID 

    tcode                         = 'XXXX'

    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_CCGWWMCCT          = 'U'

   UPD_LGC_SDTMCCT               =  'U'

  tables

*    icdtxt_ccgwwmcct              = lt_cdtxt

    xlgc_sdtmcct                  = /LGC/SDTMCCT_NEW"NEW

    ylgc_sdtmcct                  = /LGC/SDTMCCT_OLD"OLD

         .

COMMIT work.

Please have a look into the code and let me know if i missed something . 

Thanks In Advace,

Satya

2 REPLIES 2
Read only

Azeemquadri
Contributor
0 Likes
1,205

At the data element level for /lgc/sdtvs91-kunnr is the checkbox for change document set.

It is under further characteristics tab .

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,205

In CDPOS table it is always updating the old value and new value fields is blank though i am passing both the value to the *WRITE_DOCUMENT function module .And there is no entry in CDHDR table .

Are you sure, you have orphan records in CDPOS without header in CDHDR, if yes raise an OSS message, looks like a severe bug ?

Regards,

Raymond