Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Table maintainence generator events.

Former Member
0 Kudos
64

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.

1 REPLY 1

s0003317177
Explorer
0 Kudos
37

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.