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

WORKORDER_UPDATE change IT_HEADER

Former Member
0 Likes
1,168

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!


5 REPLIES 5
Read only

Former Member
0 Likes
842

Hi

You can use the field-symbol but I don't know which method you're using

Max

Read only

Former Member
0 Likes
842

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.

Read only

Former Member
0 Likes
842

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!

Read only

Former Member
0 Likes
842

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.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
842

Hi

What exactly do you want to acheive via which tcode?

Thanks

Nabheet