SCDO - Change Document

Hye,
Facing problem with the change document with update status. The tables CDHDR & CDPOS are getting updated , however my custom table ZEMPTABL is not getting updated with new values.
The steps for creation i followed is as:
1) Custom table : ZEMPTABL with Change document ticked for data elements
2) SCDO - Object created.
3) My program which calls function module for write document:
REPORT  ZMSR_TRACKCHNG_CUSTOMTBL.
TABLES : ZEMPTABL.
DATA : GS_EMPTABL LIKE ZEMPTABL,
       LS_EMPTABL LIKE ZEMPTABL.
DATA : T_CDTXT TYPE STANDARD TABLE OF CDTXT WITH HEADER LINE.
BREAK-POINT.
SELECT SINGLE * FROM ZEMPTABL INTO GS_EMPTABL
  WHERE EMPNUM = '101'.
LS_EMPTABL = GS_EMPTABL.
GS_EMPTABL-EMPNUM = '101'.
GS_EMPTABL-EMPNAME = 'TET'.
T_CDTXT-TEILOBJID = 'ZTEST_TABL_CHNG'.
T_CDTXT-TEXTART = 'TEST'.
T_CDTXT-TEXTSPR = 'EN'.
T_CDTXT-UPDKZ = 'U'.
APPEND T_CDTXT.
CALL FUNCTION 'ZTEST_TABL_CHNG_WRITE_DOCUMENT'
  EXPORTING
    OBJECTID                         =  'ZTEST_TABL_CHNG'
    TCODE                            =  SY-TCODE
    UTIME                            =  SY-UZEIT
    UDATE                            =  SY-DATUM
    USERNAME                         =  SY-UNAME
   PLANNED_CHANGE_NUMBER            = ' '
   OBJECT_CHANGE_INDICATOR          = 'U'
   PLANNED_OR_REAL_CHANGES          = 'U'
   NO_CHANGE_POINTERS               = 'U'
   UPD_ICDTXT_ZTEST_TABL_CHNG       = 'U'
    N_ZEMPTABL                       =  GS_EMPTABL   "new values
    O_ZEMPTABL                       =  LS_EMPTABL  "old values
   UPD_ZEMPTABL                      = 'U'
   LV_OPT                           = ' '
  TABLES
    ICDTXT_ZTEST_TABL_CHNG           =  T_CDTXT
COMMIT WORK.
WAIT UP TO 3 SECONDS.
Can anyone let me know why the table is not getting updated with new values

You should have TWO function modules to call, like
* Update Database Table(s)
CALL FUNCTION 'ZTEST_TABL_CHNG_UPDATE' IN UPDATE TASK
     EXPORTING
          n_zemptabl                 = gs_emptabl  "new values
          o_zemptabl                 = ls_emptabl  "old values
          upd_zemptabl               = 'U'.
* Insert Change Document(s)
CALL FUNCTION 'ZTEST_TABL_CHNG_WRITE_DOCUMENT' IN UPDATE TASK
     EXPORTING
          objectid                   = 'ZTEST_TABL_CHNG'
          tcode                      = sy-tcode
          utime                      = sy-uzeit
          udate                      = sy-datum
          username                   = sy-uname
          planned_change_number      = ' '
          object_change_indicator    = 'U'
          planned_or_real_changes    = 'U'
          no_change_pointers         = 'U'
          upd_icdtxt_ztest_tabl_chng = 'U'
          n_zemptabl                 = gs_emptabl  "new values
          o_zemptabl                 = ls_emptabl  "old values
          upd_zemptabl               = 'U'
          lv_opt                     = ' '
     TABLES
          icdtxt_ztest_tabl_chng     = t_cdtxt.
COMMIT WORK.
Regards
Raymond

Similar Messages

  • Change Document Object - SCDO

    I have created a new Change Document Object for a Z table(say ZXXX). When Generating Update program for this change document, a new structure is generated VZXXX that has ZXXX as include. This structure does not have a Package assigned to it and therefore can not be transported.
    Does anyone has encountered this problem? Any urgent help is appreciated.
    Thanks
    Amit.

    Hi,
    try report RSWBO052 to change device class
    A.

  • How to use change document object ?

    Friends,
    I am learning to use the Change Document object for one of my Z table. I have created a change doc object using SCDO. I have now written a test report in which i am issuing the SELECT statement for fetching old and new values from the Z table and passing them to the FM generated by SCDO.
    I am not able to see the changes in the CDHDR and CDPOS tables. I am doubtful abt the values being passed to the FM. Here are the values i am passing:
    CALL FUNCTION 'YTEST_WRITE_DOCUMENT'
      EXPORTING
        objectid                      = 'YTEST'
        tcode                         = 'se38'
        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_YTEST               = 'U'
        n_ztest_cle                   = wa_ztest_cle
        o_o_ztest_cle                 = o_ztest_cle
      UPD_ZTEST_CLE                 = ' '
      tables
        icdtxt_ytest                  = itab_cdtxt.
    Is the object ID the same as the Change Document Object name ??
    Please help.
    Thanks,
    Ram.

    Well, i found a way out for the problem i was facing. I was not setting the "UPD_ZTEST_CLE " FM parameter. When i set it to 'U', the changes got reflected in the CDHDR and CDPOS tables.
    Can i reward myself as i solved this by myself ???

  • Problem with Change Document FM  - Not all fields are tracked in CDPOS

    Hello everybody,
    Using transaction SCDO and following necessary steps described in forum, I have created a change document ZFBR to track changes of a table ZFBR. The problem is, the generated FM ZFBR_WRITE_DOCUMENT does not track changes of some fields of the table (inserts are always ok, problem is with updates). After some debugging I realized that the FM DDIF_NAMETAB_GET was returning the table DFIES_TAB where the LOGFLAG was empty for some fields (which are not tracked) so that changes of these fields were not visible in table CDPOS. However, fields with LOGFLAG = 'X' are tracked succesfully (changes are visible in table CDPOS).
    I did not specify any fields to be get logged or not during the steps in SCDO (can we do such a specification anywhere?), does anyone know why the field LOGFLAG has the value '' (space)?
    Best regards;
    Ozcan.

    Hi again,
    The problem has been solved.
    The data elements used in a table are the reason for the problem I have described above. When displaying the details of a data element, under tab "Further Characteristics" , the "Change Document" checkbox has to be selected to enable change document tracking. I have copied the problematic data elements with Z prefix and made the necessary enabling. I have replaced the data elements with their Z equivalents.
    Best regards.
    Ozcan.

  • Change Pointers - adding a new field to existing Change Document

    Hi,
    We have a requirement to capture the changes made to the Material object through the transaction C223. The changes to field MKAL-PRFG_F have to be captured.
    There is an exisitng Change Document Object - MATERIAL. This is included in Message Type MATMAS. These are the steps we have done:
    1. In SCDO - added the Z structure to the Change Document Object - Material. [Z structure contains the field MKAL-PRFG_F. Change pointer option is checked for this Data element.
    2. Created a Z Message Type with reference as MATMAS.
    3. In BD52 - we have listed the fields for the new Z Message Type created.
    4. The Change Pointers - reactivated after the steps are done.
    The changes to the field MKAL-PRFG_F through C223 Tcode are not recorded in BDCPV table.
    Have we missed any steps here?
    Thanks,
    Pallavi

    HI,
    I don't think a new zmessage type is required in this case.. is the structure added to MARA table??The change document programs are there which triggers the iodcs... In SCDO transaction code , click on generation info for MATERIAL.. You will find the includes. The FM MATERIAL_WRITE_DOCUMENT creates entries in CDHDR and CDPOS, if we maintain entries in BD52 , the entries wil be written in BDCP and BDCPS tables.
    Try to add your structure in MARA table as append strucre and then you can debug the IDOC from WE19 and use the FM "MASTERIDOC_CREATE_SMD_MATMAS" and then you also need to switch on Update Debugging on, to debug the changes in update FM   MATERIAL_WRITE_DOCUMENT.
    Please see if the change is reflected or not....
    ELSE.
    may be you need to create a new entry in SCDO and do all the ALE configurations for change pointers.
    Please find the link for change pointers and also you can get lot of information on change pointers in SCN.
    http://help.sap.com/saphelp_nw70/helpdata/EN/12/83e03c19758e71e10000000a114084/content.htm
    Regards,
    Nagaraj

  • Problem in multiple item for change document objects

    hi gurus,
    I have created change document object in tcode SCDO . It had giveN function module /TMW/CHG_OBJ1_WRITE_DOCUMENT.
    CDPOS AND CDHDR tables are updated with changed data. now i am trying to display all old and new data in se38 program.
    here my problem is when ever i changed multiple  item data , my program showing first item details only . I need to show all item data when ever i changed parallel . please help me where is my problem .
    thank you

    I think this is issue with function module generated thru SCDO Please check in your function module inside that the following function modules are used
    CALL FUNCTION 'CHANGEDOCUMENT_OPEN'
    CALL FUNCTION 'CHANGEDOCUMENT_MULTIPLE_CASE'
    CALL FUNCTION 'CHANGEDOCUMENT_CLOSE'
    if not then there may be issue with SCDO

  • Creation of change document to trigger workflow.

    Hi,
    I need to trigger a workflow when there is a change in the PO line item (EKPO). For this, I can use the standard change object EINKBELEG, but this only bears the purchasing document number as the key. hence when ever a change event is triggered in the custom BO, the key is just the PO#. This should be not the case.
    The key field should be a combination of the purchasing document number and the line item number, hence I created a custom change object ZEINKBELEG refering to EKPO and generated it too. The steps in SCDO, SWED, SWEC has already been handled. But the custom event in the business object does not get triggered. I need some help regarding this.
    Precisely speaking, if there is a change in the line item value (in ME22N). The business object event should trigger.
    Thanks,
    Sukumar.

    Hey Sukumar,
    Do one thing  instead of creating  custom change document. create a new  event in bus2012 using condition editor of SWEC only create a event only when there is a change in EKPO. that resolves your issue..  just a suggestion

  • Log change documents in EKPO

    Hi Experts,
    I wish to thank anybody replying this message first.
    I have some questions to be cleared, may be you can provide me some help.
    To log changes on specific fiekds from a custom table, one has to use SCDO to generate change object and fct modules.
    These fct modules shoudl be called from program to log changes in tables CHDR and CDPOS.
    In the process of modifying a PO (me22n), I have several additional custom fields added in SAP table EKPO. These fields are available in PO trhough a custom tab on PO screen. I want to log the changes on these custom fields. The data elements of these fields are checked within change document check box. I modify the PO on several fields including custom fields , examine the content of CHDR and CDPOS and then find out that changes are logged for SAP EKPO fields modified but not for the EKPO custom fields.
    So here is my question:
    Do I have to call the generated changed document fct modules from an user exit or BADI prior to saving to have  the log changes or SAP handle it automatically ? If Yes, then which user exit or BAdi should I use ?
    Thank you for your time
    Dean Q.

    I found that SAP log the changes aumatically
    Thank u all

  • Change documents for hr fields

    Hi All,
    I have a requirement in which we need to get the changes happening at field level in some Employee related (like PA0002) HR master data. We have checked that related fields, in those data elements check box is not enabled. For those changes we need to create interface program.
    I already created change document object in scdo T-code. For triggering the generated function module there is no relevant user-exit.
    For this we found one way of keeping the event trigger at database table level, and we found that we need to keep the form routine AB. But we don’t have any idea about the process methodology.
    Could you please tell me how to write the code in that related process routines in the standard tables? Or if there is another way is available to trap the changes at field level.
    Thank You.
    Regards,
    Srinivas.
    Edited by: Mike Pokraka on Aug 19, 2008 3:47 PM

    Hi ,
    Were you able to solve this problem , I am facing the same right now , Please advice .
    Sudheer

  • Change Documents

    Hi Experts,
    I know the transaction SWEC. Here We Can Give the Change Document for bossiness Object.
    My Question is What is Change Document. Its a Program or Abap Class or anything Else?
    We have Some standard Change documents like EINKBELEG for Purchase Order. Now I want to create a Change Document? Is it Possible?.
    Possible means whats the Transaction Code?
    Thanks in Advance.
    Points Will Be Surely Rewarded.

    Yes, you can create a new change document type (in transaction SCDO which you may already have used to browse the existing types). I have never changed or created any change document types myself, so I can't give you any useful advice.
    However, I think you are more likely to get an answer in one of the ABAP Development forums. I think you are stuck with the "ABAP, General" forum. You should search for existing threads first though.

  • Using a change document for Z table maintenance generatro to log changes

    Hi Forum,
    I have created a a change document for one of the Z tables now I want to use it in the table maintenance generator of this table so that any changes made to this table using maintenance generator are logged in table CDHDR and CDPOS.
    I am using the event 02     After saving the data in the database
    and have created a new FORM..ENDFORM for this event and it is working fine till here.
    But I am unable to find any table or structure where the information of the action performed in maintenance generator is kept for eg. what action was performed like add, delete or change and on how many records and contents of those records.
    I can update the tables CDHDR and CDPOS only if I have the above information.
    Please guide me as to where can I find all this information within the maintenenace generator program?
    Thank you,
    Anubhav

    Hello Anubhav,
    Are you calling the change document function module in your save event ? The function module needs to be first created using SCDO for your Z table, select the fields on which you want to track the changes.  Auto generate the programs for this change object. Once the FM is generated, you will have to call this FM in your SM30 event.
    The change document tracking also needs to be enabled at the data element level..
    Regards,
    Jay

  • Change pointer - Change Document  - IDOC

    Hi,
    I have to capture changes occurring to master data (customers' table )and to distribute them via the IDOC interface (customers' IDOC)  .
    My steps:
    1. SCDO - create change document object and bind customers' table, generate update function
    2. WE31 - develop customers segments with same customers' table structure
    3. WE30 - develop new IDOC type
    4. WE81 -  create new message type
    5. WE82 - assign message type to IDOC type
    6. SW01 - build business object for supertype IDOCAPPL
    7. BD105 - supported object determonation
    8. BD104 -  assign message type to business object
    9. BD52 - define change-relevant fields
    10 .????
    It does not work. I didn't find one help for my purpose.
    Have any idea how to do it?
    Thank you very much.
    Best regards, Natalia.

    Hi,
    Yes I mark my message type in BD50 and in BD64 (Distr.model)
    May be I do extra operations?
    Thank you, Natalia.

  • Regarding change document creation

    hi all
    I created the change document  & there i mentioned the master data table name TCJ1T (Project types)
    Updation to this table is done via standard tcode SPRO
    but my log entirs are not going in CDPOS , CDHDR
    now my question is :
    by creating the change document, when i run the standard tcode where exactly  the change document will be called to log the entries

    Hi
    Where you have created the change doc?
    in <b>SCDO</b> tcode
    Activate the object after creation and giving the table name
    Once it is created entries should come into CDHDR and CDPOS tables.
    Reward points if useful
    Regards
    Anji

  • Change Document program Generation

    Hi all,
    We are trying to capture changes to several ECC tables. We want to capture any change to that table. We want to know what kind of change (Insert, delete or update) and then the key of the record that has changed. Our goal is to capture the most updated information from a table after a change.  In order to achieve that we are using a process in which change document objects are created and changes are logged as change document in CDHDR and CDPOS tables. I have generated a program to extract data from CDPOS and CDHDR table. The following link describes the whole process of change log enablement
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2a/fa015b493111d182b70000e829fbfe/frameset.htm
    a. Created a Change Document Object /TEST/ZXXXXXXXXXXXXX using transaction SCDO and assigned the tables to that Object.
    Following function modules and generated parts are automatically generated, followed the above SAP Help document.
    Include programs and function modules
    Data declaration, TOP...................... /TEST/FZXXXXXXXXXXXXCDT
            Consisting of............................. /TEST/FZXXXXXXXXXXXXCDF
               and....................................... /TEST/FZXXXXXXXXXXXXCDV
    Update function module..................... /TEST/ZXXXXXXXXXXXX_WRITE_DOCUMENT
    Call updates function module................ /TEST/FZXXXXXXXXXXXXXCDC
    I have included the generated /TEST/FZXXXXXXXXXXXXXCDT and /TEST/FZXXXXXXXXXXXXXCDC
    to the main program of function module SAPLZxxxxx.  But I am getting syntax error in the Include /TEST/FZXXXXXXXXXXXXXCDC xxxxxx variable is not in the main program.
    I need some help on this:
    a.       As per SAP response what steps are left?
    b.       Is there any other configuration step that we need to perform? The attached document talks about transactions SWED, SWEC and SWO1 in appendix D: Connecting Change document to work flow. We would like to understand if it will be relevant to our enablement work or can we by pass this and still be able to enable the change document logging for our tables
    Any help is greatly appreciated...
    Thanks,
    Mili.

    Instead of the main program SAPLxxx, try to put include /TEST/FZXXXXXXXXXXXXXCDT  into the TOP include of the main program. TOP include porgram name would be like LxxxxTOP. Try to compile it again.
    Regards,
    Naimesh Patel

  • Change Document Objects

    Hi All,
         I am new to this topic
         While created Object for couple of Customization tables (Header & details table) from Tcode SCDO, I can get INCLUDS & Function Modul. My doubt is, Is it necessary to use the INCLUDE in my report, If yes, How can I use the INCLUDE?
        Plz provide any docus for using the FM & related example code
    Thanks in advance.

    hI,
    Yes u need to use them in ur program to expilictly update the change document header and item tables (CDHDR,CDPOS)..The Function module in the include updates these tables....in update task.
    Regards,
    Nagaraj

Maybe you are looking for

  • Blue Screen of Death on Sync

    I am experiencing an issue with Itunes where my computer (Windows Vista SP2) crashes to Blue Screen when syncing my iPod Touch or iPhone4.  It happens every time but not always at exactly the same time.  Though it is always during teh file sync (apps

  • IPhoto 6 and Kodak EasyShare 5.2.2

    Is anyone using the excellent software from Kodak called "EasyShare"? Latest version for Mac is 5.2.2 although version 6 is out for windoze and "soon" for Mac. I like EasyShare because since Feb 2004 when I got my first Kodak Camera, I could import v

  • ITune can;t find my songs

    I have a library of over 400 songs all with ratings which I have spent lots of time on. I moved the folder containing all of my songs to a seperate hard drive, and now in my library most of my songs have a "!" beside them. How can I tell iTune where

  • XAER_RMERR with oracle thin 9.0.1.4 and wls 6.1 sp3

    I am trying to use Oracle Thin 9.0.1.4 Driver in a distributed Transaction and while trying to call connection.createStatement() I am getting the following error. RootCause=[java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has o

  • Email messages not being sent

    For the past several weeks I can not sent outgoing messages via my [email protected] email account. I get incoming messages but when I send something it appears in my sent folder but people don't receive my message at all?  I have a Macbook pro retina, re