Application Development and Automation 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: 
Read only

Table maintainence generator events.

Former Member
0 Likes
410

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.

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
Read only

StD11
Participant
0 Likes
383

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.