Skip to Content
author's profile photo Former Member
Former Member

Modify

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2005 at 04:56 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2005 at 08:50 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2005 at 10:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2005 at 01:04 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.