I've created several user tables in order to store new data about customers. But I also need to store the changes into the tables.
I've read about change documents, but I'm not very sure of how can I use these, for example what are the functions that I have to use or where to put this code in my program.
Any example of how to use this would be very appreciated
thanks in advance
Use the tables CDHDR and CDPOS to fetch the old and new values..
A sample code
**fetch header records from cdhdr table
INTO TABLE I_CDHDR
WHERE UDATE IN S_DATE AND
OBJECTCLAS EQ 'ADRESSE' AND "address change
TCODE EQ 'VA02' AND "tcode
CHANGE_IND EQ 'U'. "change type update(U)
**fetch the position records based on the cdhdr entries
IF NOT I_CDHDR IS INITIAL.
VALUE_NEW "new value
VALUE_OLD " old value
INTO TABLE I_CDPOS
FOR ALL ENTRIES IN I_CDHDR
WHERE CHANGENR EQ I_CDHDR-CHANGENR AND
TABNAME IN R_TFIELDS AND
FNAME IN R_FIELDS.
Note: R_TFIELDS is the table name stored in ranges table.
I mean changes to these table entries only..
R_FIELDS is the field name of the corresponding tables in R_TFIELDS.
You define as below in the data declaration.
*ranges r_fields for cdpos-fname.
RANGES: R_FIELDS FOR CDPOS-FNAME,
R_TFIELDS FOR CDPOS-TABNAME.
In the INIITIALIZATION event fill these ranges with the corresponding value...