2010 Oct 03 5:10 PM
In table maintainence generator I have a requirement like if user enters key field customer as '*' and enters group as CS and accno as 12345 then all the entries of the table belonging to the group CS irrespective of customer should be updated the accno as 12345.
I am trying to write code for this in the event before save but am not able to modify the data.
Can anyone give an idea or a code snippet for this.
2010 Oct 03 7:34 PM
This is part of my code. I'm filling user and date of last change.
FORM beforeSave.
FIELD-SYMBOLS <ztab> TYPE zds_xx.
DATA: f_index LIKE sy-tabix.
CLEAR: ztab.
LOOP AT total.
ASSIGN <vim_total_struc> TO <ztab>.
IF <action> = aendern.
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc EQ 0.
f_index = sy-tabix.
ELSE.
CLEAR f_index.
ENDIF.
<ztab>-datupd = sy-datum.
<ztab>-usrupd = sy-uname.
MODIFY total.
CHECK f_index GT 0.
extract = total.
MODIFY extract INDEX f_index.
ENDIF.
ENDLOOP.
tcode = sy-tcode.
utime = sy-uzeit.
udate = sy-datum.
username = sy-uname.
sy-subrc = 0.
endform.