02-22-2010 6:20 AM
Hello,
This SM30 event coding is really bugging me. In the event 18 I put following code
if <action> = 'U'.
zcustomtable-date = sydatum.
zcustomtable-uname = sy-uname.
modify zcustomtable.
endif.
However while this does not work, the coding was ok for event 05 when I said as following
if <action> = 'N'.
zcustomtable-date = sydatum.
zcustomtable-uname = sy-uname.
modify zcustomtable.
endif.
So I changed the code to following
if <action> = 'U'.
extract+41(10) = sy-datum.
extract+49(12) = sy-uname.
modify extract index sy-tabix.
total+41(10) = sy-datum.
total+49(12) = sy-uname.
modify total index sy-tabix.
endif.
now what is happeneing in this case is although the correct placement in sy-uname is not happeneing but it shows me on the screen the values who is chaning and when, when i press the Save button and then go to SE12 to see whether really it has saved the data, it is not doing so. Can somebody help me understand where I am going wrong?
Thanks in advance
02-22-2010 9:52 AM
Hi,
You can use event 01(before save) and write your code there.
Tables in this event will be <vcl_extract> and <vcl_total>. There won't be any variable named <action>.
You have to figure out the postion of the action in global tables(vcl_extract> and <vcl_total>). eg. <wa_vcl_extract>+48(1) = 'U'.
Regards,
Seema Naharia
02-22-2010 6:32 AM
Hello,
I think this code should used in Event#01. Why are you using Event#18 ?
Also i think the constants you are using does not look correct. From SAP documentation:
The field symbols which show the processing status of the entries in the internal tables TOTAL and EXTRACT can take the following constant values:
GELOESCHT flagged for deletion
NEUER_EINTRAG: New entry
AENDERN: changed entry
UPDATE_GELOESCHT: entry first changed and then flagged for deletion
NEUER_GELOESCHT: entry first newly created, not yet saved, and then flagged for deletion
ORIGINAL: the same as the database status
BR,
Suhas
Edited by: Suhas Saha on Feb 22, 2010 12:02 PM
02-22-2010 9:52 AM
Hi,
You can use event 01(before save) and write your code there.
Tables in this event will be <vcl_extract> and <vcl_total>. There won't be any variable named <action>.
You have to figure out the postion of the action in global tables(vcl_extract> and <vcl_total>). eg. <wa_vcl_extract>+48(1) = 'U'.
Regards,
Seema Naharia
02-24-2010 11:26 AM