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

modify statement problem

hi all,

my modify statement is not working proerply. can any one help me in this regard...

IF NOT i_vetvg IS INITIAL.

SELECT mblnr mjahr bwart FROM mseg

INTO TABLE i_gr

FOR ALL ENTRIES IN i_vetvg

WHERE ebeln EQ i_vetvg-vbeln.

LOOP AT i_gr INTO wa_gr.

CASE wa_gr-bwart.

WHEN '643'.

wa_final-gr = wa_gr-mblnr.

MODIFY i_final FROM wa_final index sy-tabix TRANSPORTING gr.

WHEN '101'.

wa_final-in_gr = wa_gr-mblnr.

MODIFY i_final FROM wa_final index sy-tabix TRANSPORTING in_gr.

ENDCASE.

ENDLOOP.

ENDIF.

i_gr exapmle data

1 2009 643

2 2009 101

5 2009 643

6 2009 101

here my second modify statement is not working. first statemet is working perfectly.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2009 at 07:16 PM

    Hi Senthil,

    Try this your problem will be solved:

    Assign sy-tabix to a local variable and the use it .

    Also check the number of records in i_final, is that index persent?

    Edited by: Harsh Bhalla on Nov 14, 2009 12:49 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2009 at 06:19 PM

    i cant say for sure, becuase i am not sure what is is you are trying to do, but what is in i_final at the beginning of all of this? you are looping over i_gr and modifying i_final using the tabix from i_gr.. this assumes that i_gr and i_final are identical GOING IN to your loop, or it wont work.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 13, 2009 at 06:23 PM

    Hello,

    What is the structure of i_final? Even i think the problem is because of using the modify statement using sy-tabix which may not yield desireable results. If you have any common field between i_final and i_gr, the results would be more accurate

    Vikranth

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 14, 2009 at 08:20 PM

    Hi Senthil Kumar,

    please post code as

    code

    where and how do you populate itab i_final? How do you know that sy-tabix of table i_gr always matches i_final.

    This does not look like good programming.

    Regards,

    Clemens

    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.