2013 Oct 23 2:47 PM
Hi experts,
I am using WORKORDER_UPDATE and I need to change a field but since it is importing table, it is not allowed to be changed . Is there any way that would enable me to change the data at it_header?
This is my code:
LOOP AT it_header INTO wa_header.
wa_header-refnr = 'abc'.
MODIFY it_header FROM wa_header TRANSPORTING refnr.
ENDLOOP.
I also tried field symbols but i encountered a short dump.
loop at it_header assigning <fs_header>.
<fs_plko>-refnr = 'abc'.
endloop.
Let me know any suggestions. Thank you!
2013 Oct 23 3:42 PM
Hi
You can use the field-symbol but I don't know which method you're using
Max
2013 Oct 24 8:51 AM
Hi,
Try using sy-index.
LOOP AT it_header INTO wa_header.
wa_header-refnr = 'abc'.
MODIFY it_header FROM wa_header INDEX sy-index TRANSPORTING refnr.
ENDLOOP.
2013 Oct 24 8:56 AM
Hi,
To modify internal tables, instead of using MODIFY statement, you should always use field symbols.
The field symbol must be of internal table type. Define the field symbol before you use them.
Please try below code:
loop at it_header assigning <fs_header>.
<fs_header>-refnr = 'abc'.
endloop.
Thanks!
2013 Oct 24 9:02 AM
Hi,
Use the index ( since you are in a loop it will be sy-tabix)to update it..
LOOP AT it_header INTO wa_header.
wa_header-refnr = 'abc'.
MODIFY it_header FROM wa_header INDEX sy-tabix TRANSPORTING refnr.
ENDLOOP.
2013 Oct 24 9:09 AM
Hi
What exactly do you want to acheive via which tcode?
Thanks
Nabheet