10-25-2006 6:58 PM
Hi,
I have created couple of Z tables. 2 Z tables has price fields.I need to capture changes for price fields using change documents. I have created change document object, generated the program, set the change document flag on data element and i run SM30 and make changes for price. In CDHDR & CDPOS a record is created with blank values. If it is a text field it captures the value_new and value_old correctly.
Did anyone come across this problem before. If so any workaround solution. In debug i found that field symbol values when copied to CDPOS-VALUE_NEW & CDPOS-VALUE_OLD fields is blank.
I would appreciate any insight on this problem.
10-25-2006 7:30 PM
FM CHANGEDOCUMENT_PREPARE_POS can be used to format old/new values before printing.
Another thing to check if your change indicator is 'U', sometimes SAP creates 2 records (I & D) instead of U.
One more thing - try to test manually the FM created by SAP to create CDHDR/CDPOS records. If by manual test CDHDR/CDPOS are populated fine - you need to check your settigns for change document OR call FM <your object>_WRITE_DOCUMENT in teh maintenance view of your table.
10-25-2006 7:30 PM
FM CHANGEDOCUMENT_PREPARE_POS can be used to format old/new values before printing.
Another thing to check if your change indicator is 'U', sometimes SAP creates 2 records (I & D) instead of U.
One more thing - try to test manually the FM created by SAP to create CDHDR/CDPOS records. If by manual test CDHDR/CDPOS are populated fine - you need to check your settigns for change document OR call FM <your object>_WRITE_DOCUMENT in teh maintenance view of your table.
10-25-2006 10:45 PM
I am calling my function module in the maintenance view of my table right now. I have 2 events created from se54. One captures data before save and one creates change docs after save. I see that change doc record is created with change indicator 'U'.
Let me try the FM first and then manual run. Thanks for quick reply.
10-31-2006 3:03 PM
Hi,
I see that FM "CHANGEDOCUMENT_PREPARE_POS " is used to edit change documents while printing out, i cannot edit "change documents" in system rt? I am still having the problem updating price values into change document line items. Any other ideas? In include "LSCD0F01" for FM "CHANGEDOCUMENTS_MULTIPLE_CASE", at line 681-682
at following statements CDPOS-VALUE_OLD = <F_OLD>.
CDPOS-VALUE_NEW = <F_NEW>. problem occurs.
<f_old> has 1000 value for "10.00" USD and <f_new> has 1500 value for "15.00" but when it tries to copy these values to CDPOS-VALUE_OLD and CDPOS-VALUE_NEW blank values are moved.
Let me know if i can populate values using any other method?
10-31-2006 4:23 PM
Hi,
are you sure that blank values are moved ?
VALUE_OLD & VALUE_NEW have length 254, I don;t think you can display this lenght in debug and your values can be aligned to the right in those fields.
You can try to see in debug VALUE_OLD+240(14).
Have you tried to use CHANGEDOCUMENT_PREPARE_POS to reformat your values or CHANGEDOCUMENT_READ to see if it formats your values correctly.
I suppose your fields in Z table are defined as currency fields (CURR) and have corresponding currency key fields.
10-31-2006 6:24 PM
Hi,
In debug i see that values are rt justified. Thanks for the info..I didnt notice that field length is 254. Using S_P9C_18000249 transaction i find that values exist.
Thanks,
12-14-2006 2:34 PM
Hi Kalyan,
I need the same change document procedure for Z table.
Can I have procedure to maintain the change documentes for z table.
But data will be inserted/updated into this table through one z transaction.
Thanks and Regards,
Sadasiva Rao.
12-14-2006 3:17 PM
Using SCDO transaction create a change document object for the table to which change documents need to be tracked for. It generates a function module and structure to use for updating change docs.
You can then use the function module usually named "Z*WRITE_DOCUMENT"(generated by SAP) to update change docs.
Are you planning to update change docs from custom program or from table maintenance?
12-15-2006 6:48 AM
Hi Kalyan,
Planning to update change docs from custom program , is there any different procedure for it.
Thank You,
Sadasiva Rao.
12-15-2006 2:42 PM
Nope custom program is straight forward just use the function module generated by SAP in your program and it does the job for you..