07-08-2005 2:22 PM
Hi,
I have a table which is a part of Change documents Object in SCDO object. but none of the fields for this table is enabled for change documents (the tab further characterisitcs of the data element has a field Change Document which is disbaled).
Will just enabling this, set this ready for creation of change documents in the table CDHDR.
I actually tried this on a Z object and it did not work.
I created a table, set it up in SCDO transaction. And even enabeld change doucment for this data element.
Can somebody help ?
Should there be some coding ? Should i run trigger some program ?
Prashanth.
07-11-2005 2:17 PM
The Changedocument-FMs look if the Change Document Flag is set. So you have to set the flag even if you are programming your Change documents by yourself.
Regards,
Hans-Jürgen
07-08-2005 3:40 PM
Hi Prashanth,
take a look at function group SCD0. There are some function modules you have to use writing your own change documents. Changing the flag on the data element isn`t enough. When you use the "where used-list" button on CHANGEDOCUMENT_OPEN you got a lot of programs from which you can extract a template.
Regards,
Hans-Jürgen Forberger
07-11-2005 5:10 AM
OK, Thanks for your answer.
So, my next question is....
Is setting the Change Document flag in the Data Element necessary ? Or is it sufficient if I just do the coding ?
What does enabling the Change Document Flag for the data element do ?
Prashanth.
07-11-2005 2:17 PM
The Changedocument-FMs look if the Change Document Flag is set. So you have to set the flag even if you are programming your Change documents by yourself.
Regards,
Hans-Jürgen
07-11-2005 4:25 PM
Hi,
Unless and until the Change document flag is set in the data element of the fields in the tables, the change history will NOT be recorded/updated.
To view the Change document flag,
Go to SE11 -> Enter Data element name -> Click on Further characteristics tab(in 4.7D) -> Make sure the change document flag is set.
I've created variouse custom objects as well as the system objects to track. It's been found that the fields with change document flag with blank were not updated in the change history tables(CDHDR & CDPOS).
Hope this helps.
Gopakumar
10-05-2007 5:49 PM
Hi GopalKumar,
I tried creating a change document on my Ztable by doing following steps:
1) checked the change document flag in the data element of the field whose changes i want to capture
2) For the Ztable i checked the log changes flag in the Technical Settings
3) Created the Change Document Object in SCDO giving my Ztable
4) Generated the Program for Change DocObject in SCDO
5) In the Program where i am inserting new records to my Ztable I have included the INCLUDE files generated by SCDO, and also called the FORM routine generated by SCDO before the insert statement/commit work.
My Problem is that I still dont get records in CDHDR and CDPOS tables for my change document object.
Am I missing something??
If you have sample code of how to call the FORM routine in your report program/module pool can you please share , as I understand you have experience of creating cutsom change document objects.
Thanks in advance
Purva
11-20-2008 7:09 AM
Hi,
In your custom program, after saving all the details into the table(after commit work).
you have to call function module which was generated by SCDO.
Prerequisites: In Data element, flag need to be set.
Make sure while generation of function modules in scdo, you should get
X<TABLENAME> indicates new values
Y<TABLENAME> indicates old values
In case you are inserting new record. you need to pass object_change_indicator 'I'.
In case you are modifing the existing record. you need to pass object_change _indicator 'U'.
Find below the sample code
CALL FUNCTION 'XXXX_WRITE_DOCUMENT'
EXPORTING
OBJECTID = c_cd_item_change_document(object id created in SCDO)
TCODE = Sy-Tcode
UTIME = Sy-Uzeit
UDATE = Sy-Datum
USERNAME = Sy-Uname
PLANNED_CHANGE_NUMBER = ' '
OBJECT_CHANGE_INDICATOR = c_Ci_Update ('U')
PLANNED_OR_REAL_CHANGES = c_Ci_Real_Changes ('R')
NO_CHANGE_POINTERS = ' '
UPD_ICDTXT_ZFSEI03_CLAIMS = c_Ci_Update
UPD_ZFSEI03_CLAIMS = c_Ci_Update
IMPORTING
CHANGENUMBER =
TABLES
ICDTXT_ZFSEI03_CLAIMS = t_Text_Changes
XZFSEI03_CLAIMS = Pt_Claims_New_Values
YZFSEI03_CLAIMS = Pt_Claims_Old_Values.
IF SY-SUBRC <> c_Ex_No_Errors.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks
07-12-2005 10:39 AM
Hi Prashanth,
The followig link from the SAP library gives you all the information that you need regarding Change Documents -
http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa015b493111d182b70000e829fbfe/frameset.htm
Just go through it and get back if you have further doubts.
Regards,
Anand Mandalika.