2024 Jun 10 1:44 PM - edited 2024 Jun 10 4:29 PM
Hi experts,
I have a field symbol like this
| MARA-MATNR | MARA-MTART | MARA-MAKTL |
| 1 | test_mtart1 | test_matkl1 |
| 2 | test_mtart2 | test_matkl2 |
| 3 | test_mtart3 | test_matkl3 |
and I want to change the MARA-MTART values but the problem is I can't pass the value from variable to the internal table, after <fs_mtart>- , I can't put the mara-mtart .
how can I pass the value if the component of itab is something like this -> MARA-MTART ?
My sample code
FIELD-SYMBOLS: <ft_mtart> TYPE table, "this is a standard declaration
<fs_mtart> TYPE any. "this is a standard declaration
DATA: lv_mtart TYPE mara-mtart.
"lets say the mtart is always 5
lv_mtart = '5'.
ASSIGN (lv_mtart) TO <fs_mtart>-mara-mtart. "not working
<fs_mtart>-mara-mtart = lv_mtart "not working
"I tried to create an internal table but not working
TYPES: begin of ts_mtart,
mtart TYPE mara-mtart,
end of ts_mtart.
DATA: ls_mtart TYPE ts_mtart
ASSIGN COMPONENT sy-index OF STRUCTURE ls_mtart TO <fs_mtart>-mara-mtart.
Request clarification before answering.
FIELD-SYMBOLS: <fs_mara> TYPE mara.
DATA: l_mtart TYPE mara-mtart.
l_mtart = '5'.
<fs_mara>-mtart = l_mtart.
" ¯\_(ツ)_/¯
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.