Skip to Content

CDPOS initial values when CHNGIND = 'I'.

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?

Add comment
10|10000 characters needed characters exceeded

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

  • 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.



1 Answer

  • Posted on Feb 28, 2017 at 06:48 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.