on 08-15-2022 12:50 PM
I have below table in which some records have field MSTYP and MESSAGE empty. while most records already have MSGTYP and MESSAGE filled.
I need to fill those empty records in a single go(if possible) with MSTYP = 'E' and MESSAGE = "Error".
Of Course I can do LOOP AT table ASSIGNING(<fs>), and also maybe FOR loop but then each field needs to be written/mapped in code in for loop.
Please suggest fastest way to do this.
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MATNR,
MTART TYPE MTART,
"...85 more fields
MSGTYP TYPE MSGTYP,
MESSAGE TYPE CHAR128,
END OF TY_MARA.
DATA: lt_mara TYPE TABLE OF TY_MARA.
Hi Shailesh, can't you just
LOOP AT lt_mara ASSIGNING FIELD-SYMBL(<fs_mara>) WHERE mstyp IS INITIAL.
<fs_mara>-mstyp = 'E'.
<fs_mara>-message = 'Error'.
ENDLOOP.
HTH,
Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you also wrote "but then each field needs to be written/mapped in code in for loop" - you dont need to map all 85 fields - just the two fields you want to change. but maybe I misunderstood you.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.