Application Development 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: 

Change Documents : Enabling

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.