cancel
Showing results for 
Search instead for 
Did you mean: 

Modify

Former Member
0 Kudos

How does MODIFY command works in internal table without header line.

Following is the code I am using but it is not working:

LOOP AT lt_migo_badi_new INTO lt_migo_badi_wa.

MOVE i_line_id TO lt_migo_badi_wa-line_id.

MODIFY TABLE lt_migo_badi_new FROM lt_migo_badi_wa

TRANSPORTING

line_id WHERE line_id = '0000'.

ENDLOOP.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Try it without the WHERE condition. First of all WHERE is not required as the MODIFY statement is being called from within the loop. Secondly as per your WHERE condition, it will modify only for line_id = '0000' which won't be satisfied as you are moving some value to line_id just before the MODIFY statment. Also check whether sy-subrc = 0 immediately after MODIFY to ensure that it's working.

regards,

Madhavan

Former Member
0 Kudos

Hi,

MOdify statement depends on the type of tables you basically use. If you are changing the table using The table key, then use the following statement.

<b> MODIFY TABLE <itab>

FROM <wa> [TRANSPORTING <f1> <f 2> ...</b>].

If you are changing several lines using a condition, then use

<b>MODIFY <itab>

FROM <wa> TRANSPORTING <f1> <f 2> ... WHERE <cond>.</b>

The above commands are applicable for all table types.

for further reference click the link below

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm

If you are working on index tables then use the following to change single line..

<b> MODIFY <itab> FROM <wa> [INDEX <idx>] [TRANSPORTING <f1> <f 2> ... ].</b>

for further reference click the link below

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb37b2358411d1829f0000e829fbfe/content.htm

Regards,

Vara

Former Member
0 Kudos

Hi,

Use the following code.

Regards

Vinay

LOOP AT lt_migo_badi_new INTO lt_migo_badi_wa.

MOVE i_line_id TO lt_migo_badi_wa-line_id.

MODIFY lt_migo_badi_new FROM lt_migo_badi_wa

TRANSPORTING line_id WHERE line_id = '0000'.

ENDLOOP.

Former Member
0 Kudos

Hi,

What is the value of SY-SUBRC after the operation? Secondly, what is the type of your internal table (standard, sorted, hashed). The documentation says that: <b>If the table has the type SORTED TABLE or HASHED TABLE, the TRANSPORTING list may not contain key fields.

</b>

Regards