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

Dynamic assignment

Former Member
0 Likes
479

I have 10 internal tables. I want to assign a value of 'X' to every field in the tables. (these are BAPI 'X' tables indicating the fields need to be updated. I want to update all fields so I want to set all fields to 'X'.

how can I do this dynamically.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
424

Hi,

Try this.


DATA s_bapi_marax TYPE  bapi_marax.

FIELD-SYMBOLS: <fs> TYPE ANY.
DO.

  ASSIGN COMPONENT sy-index OF STRUCTURE s_bapi_marax TO <fs>.
  IF sy-subrc EQ 0.
    MOVE 'X' TO <fs>.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.

1 REPLY 1
Read only

Former Member
0 Likes
425

Hi,

Try this.


DATA s_bapi_marax TYPE  bapi_marax.

FIELD-SYMBOLS: <fs> TYPE ANY.
DO.

  ASSIGN COMPONENT sy-index OF STRUCTURE s_bapi_marax TO <fs>.
  IF sy-subrc EQ 0.
    MOVE 'X' TO <fs>.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.