‎2010 Oct 28 6:03 AM
Hi Experts,
I have got a requirement to keep log of MM invoice creation date and time (RBKP-CPUDT, CPUTM)
because the creation date/time is over write when change status from parked to posted invoice.
I found that some tables e.g. RSEG keep insert log (CDPOS-FNAME = KEY and CDPOS-CHNGIND = 'I').
Please suggest how can i enable insert log for table RBKP.
Thank you in advance
Kaew.
‎2010 Oct 28 9:42 AM
For insertion of new records, only key fields are stored in change document, so look for following documents, record updating (before image) if none found, the database value is the correct one.
Some remarks
- RBKP and RSEG change documents are stored in same object INCOMINGINVOICE
- Check via SE11 if CPUDT and CPUTM are checked for change document (data element, dafault is not) - be aware that those fields are used in many tables (but usually not-updated, so no database increase for most tables)
- There is an option to keep whole data for deleted records (before image), but don't know any for insertion (after image)
My proposal
- Set change document flag on for both data elements
- Read CPUDT/CPUTM from database
- Search for change document on INCOMINGINVOICE object
A more "technical" solution would be to add a call to function INCOMINGINVOICE_WRITE_DOCUMENT, in some MM invoice BADI when inserting record (Like BADI INVOICE_UPDATE~CHANGE_IN_UPDATE or CHANGE_BEFORE_UPDATE) - You could also use those kind of BADI to fill any appended fields like a ZZCPUDT.
Regards,
Raymond
‎2010 Oct 28 6:09 AM
Hi Pankaew A,
The only way to get the log in CDHDR/CDPOS, you have to do data element changes. Under "Further Characteristics" tab, there is a check box "Change document". If it is checked then what ever changes happening to the data, system will record.
To achieve that you have to use access key and change the standard data element. Discuss with your functional Consultant and with your client as well, whether it is that much necessary?
Thanks & Regards,
Faheem.
‎2010 Oct 28 9:34 AM
Dear Md Faheem,
Thank you for your suggestion. For this solution I'm not sure whether it will effect all tables which have field CUPDT/CPUTM or not.
This solution will be ok if we can scope to keep only insert-change-delete CPUDT/CPUTM from table RBKP.
Refer to http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP-DataChangeTrackerforCustom+Tables
Thanks,
Kaew.
‎2010 Oct 28 6:13 AM
1/se11
2/table name:RBKP
3/Click on display button
4/Click on button: Technical settings
5/Click on change icon
6/Click on box: Log data changes
7/Save table changes
‎2010 Oct 28 9:37 AM
Dear Jan Hoblik,
Thanks for your suggestion, my concern for this solution is database size of table CDPOS and CDHDR 'cos table RBKP is all MM invoice data.
Thanks,
Kaew.
‎2010 Oct 28 9:42 AM
For insertion of new records, only key fields are stored in change document, so look for following documents, record updating (before image) if none found, the database value is the correct one.
Some remarks
- RBKP and RSEG change documents are stored in same object INCOMINGINVOICE
- Check via SE11 if CPUDT and CPUTM are checked for change document (data element, dafault is not) - be aware that those fields are used in many tables (but usually not-updated, so no database increase for most tables)
- There is an option to keep whole data for deleted records (before image), but don't know any for insertion (after image)
My proposal
- Set change document flag on for both data elements
- Read CPUDT/CPUTM from database
- Search for change document on INCOMINGINVOICE object
A more "technical" solution would be to add a call to function INCOMINGINVOICE_WRITE_DOCUMENT, in some MM invoice BADI when inserting record (Like BADI INVOICE_UPDATE~CHANGE_IN_UPDATE or CHANGE_BEFORE_UPDATE) - You could also use those kind of BADI to fill any appended fields like a ZZCPUDT.
Regards,
Raymond