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: 

CDPOS initial values when CHNGIND = 'I'.

0 Kudos

Hello ABAPers, I'm trying to write a report showing the changes of a particular record. I would like to show the initial values and all the subsequent changes. The changes are pretty easy and obvious. The initial record in CDPOS is recorded as FNAME = KEY and chngind = 'I'. If I catch this prior to values being changed, then I can capture the original values. Is there a function module that does this for me?

In the meantime I have tried to do a dynamic select using the TABNAME and the corresponding TABKEY by using "ASSIGN wa_ref->* TO <wa>".... Im getting a short dump when assigning the TABKEY value to <wa>. UC_OBJECTS_NOT_CONVERTIBLE.

Any way that works is fine with me...any suggestions?

5 REPLIES 5

matt
Active Contributor
0 Kudos

You really need to share your code. Just the relevant parts please,

raymond_giuseppi
Active Contributor
0 Kudos

AFAIK the Initial records values 'I' are not saved in change document. IMHO you should process the other way, first read current values from database, and then change documents to determine previous values. Note that most of the time 'D' delete change document wont save data either, if a flag was not set in SCDO for the change object generation.

0 Kudos

Raymond, thanks for your response. I'm trying to go forward by using ABAP. See my pseudo code above. Do you have any idea why I would only receive this error on the MARA table?

Post your actual code or explain how you defined and assigned wa_ref and <wa>.
Hint: You could also use some FM like CHANGEDOCU_KEY_CHAR2ANY and CHANGEDOCU_KEY_ANY2CHAR to convert the TABKEY value from/to table structure fields.

0 Kudos

Matthew, I move the reference of a structure of the table in CDPOS to a field symbol <wa>. I have verified that the structure is correct at this point.

Then I simply move my it_cdpos-tabkey to <wa>. This is where I get the UC_OJBECTS_NOT_CONVERTIBLE.

But, the short dump only occurs if the table is MARA ( So far in my testing ).

The follow tables work great: KNA1, KNB1, KNBK, KNVI, KNVP, KNVV, LFA1, LFB1, LFBK, LFM1, WYT3.

THANKS

Jayden