I am using table maintaince generator in single step , I am using events for updating the back ground entries like created by and changed by and I am using the total structure , the Table is getting updated in case of create and if the same entry is being modified in same screen the value it is over wrriting and the created field in the data base it is not populating for this i am using the event befor save .
below is the code that i have used .
LOOP AT total INTO l_wa_total.
IF l_wa_total-action EQ 'N'.
l_wa_total-createdon = sy-datum .
l_wa_total-createdby = sy-uname .
IF l_wa_total-action EQ 'U'.
l_wa_total-changedon = sy-datum .
l_wa_total-changedby = sy-uname .
MODIFY TOTAL FROM l_wa_total.