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

Writing ChangeDocuments for Insert

Former Member
0 Likes
454

Hi,

I have a big problem with writing change documents for Z* table during insert (update and delete are working as aspected ). I generate the function modules and fill the parameters. After testing i found values in cdhrd and cdpos. But i can not find the values which I have inserted. There is only the the key but i need the other data as well (the "new" values for every field - like in update or delete case).

Example:

MANDANT 010

OBJECTCLAS ZPTGSF_SCODE

OBJECTID ABCDEFGHI

CHANGENR 18487152

TABNAME ZPTGSF_SCODE

TABKEY ABCDEFGHI

FNAME KEY

CHNGIND I

TEXT CASE 1

UNIT OLD

UNIT NEW

CUKY OLD

CUKY NEW

VALUE NEW

VALUE OLD

But i need the real values and not only the key -

any idea?

Thanks in advance Stefan

1 ACCEPTED SOLUTION
Read only

prasenjit_sharma
Active Contributor
0 Likes
404

Hi,

When you create a record the first time, i.e., for INSERTs, the CDHDR and CDPOS does not store all of the fields and it just stores the KEY fields so that the records can be read from the database. So you now have record and key to the record.

Now afterwards for update, it will store the fields changed with old and new value so that you know the history of the change. You can see the record and find out what has been changed, when it has been changed and who changed it.

Hope this helps.

Regards

Prasenjit

2 REPLIES 2
Read only

Clemenss
Active Contributor
0 Likes
404

Hi Stefan,

this is due to the change records concept: If you INSERT a record into database, CDHDR/CDPOS record when you inserted what key data. Until changed, the other fields data (attributes) are present in the table itself, this is where you can read them.

The old/new data are provided for all fields as soon as you change the contents - the key is never changed.

Regards,

Clemens

Read only

prasenjit_sharma
Active Contributor
0 Likes
405

Hi,

When you create a record the first time, i.e., for INSERTs, the CDHDR and CDPOS does not store all of the fields and it just stores the KEY fields so that the records can be read from the database. So you now have record and key to the record.

Now afterwards for update, it will store the fields changed with old and new value so that you know the history of the change. You can see the record and find out what has been changed, when it has been changed and who changed it.

Hope this helps.

Regards

Prasenjit