Application Development 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: 

Modify + shot dump

Former Member
0 Kudos
252

Hello,

While updating an internal table I am getting the following exception, would be nice if some one help me to figue it out, what happend here...

here is the code I am using to update an internal table...

read table lt_incomp_calib_wa

into ls_incomp_calib_wa

index ls_sel_rows-index.

check sy-subrc eq 0.

lv_gltgv = ls_incomp_calib_wa-gltgv.

If lv_gltgb gt lv_gltgv.

ls_incomp_calib_wa-gltgb = lv_gltgb.

MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa.

"TRANSPORTING gltgb.

Endif.

when I try to do mobidy, if gives me exception..... and here is the exception details...

Possible reasons:

1. The relevant ABAP/4 statement does not include the addition

"...INDEX...", although the statement is not

inside a "LOOP...ENDLOOP" loop processing this table.

2. The relevant ABAP/4 statement was called from within a

"LOOP...ENDLOOP" loop after a DELETE

"\PROG=/CBP/SAPMUA0302_WARU\DATA=LT_INCOMP_CALIB_WA".

Thanks in advance,

15 REPLIES 15

former_member181962
Active Contributor
0 Kudos
200

The statement,

MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa.

should have a index addition

like this

MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa <b>index lv_index</b>.

lv_index should have the line number of the internal table for which you want this changes to occur.

0 Kudos
200

You are modifying the table not in the loop, so you should mention the index value.

so the statement should come like this

MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa index lv_index.

instead of

MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa.

Alex

former_member188685
Active Contributor
0 Kudos
200
MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa index sy-tabix.

mention the index along with modify..

thanks

vijay

suresh_datti
Active Contributor
0 Kudos
200

Hi Haider,

Add INDEx to the MODIFY statement ie

MODIFY lt_incomp_calib_wa from ls_incomp_calib_wa index ls_sel_rows-index.

Regards,

Suresh Datti

0 Kudos
200

Hello,

Thanks to all of you for your kind replies, the problem solved.

PS: As all answers are more or less same, hard to figure it out, to whom I reward the points

0 Kudos
200

first come first serve

0 Kudos
200

Hello friends,

I am facing more or less the same problem again but this time I am inside the loop, so where is the actuall problem in my code:

Loop at lt_selected_rows into ls_selected_rows.

if lv_gltgv is initial.

lv_gltgv = ls_selected_rows-gltgv.

endif.

If lv_gltgb gt lv_gltgv.

ls_alv_waru-gltgv = lv_gltgv.

ls_alv_waru-gltgb = lv_gltgb.

ls_alv_waru-new = 'X'.

Endif.

MODIFY lt_alv_waru from ls_alv_waru.

Endloop.

PS: I am receving the same exception as mentioned in my first post !

0 Kudos
200

Hi Haider,

Let me tell you one thing, MODIFY in a LOOP...ENDLOOP doesnt require an index or a where cluase when you modify the same table which you are looping and it needs an INDEX or a WHERE clause if you are modifying someother table.

In the below case you are looping at lt_selected_rows and modifying lt_alv_waru. Put a where clause for the key.

Regards,

Srikanth

0 Kudos
200
data: l_tabix type sy-tabix.
Loop at lt_selected_rows into ls_selected_rows.
l_index = sy-tabix.
if lv_gltgv is initial.
lv_gltgv = ls_selected_rows-gltgv.
endif.

If lv_gltgb gt lv_gltgv.

ls_alv_waru-gltgv = lv_gltgv.
ls_alv_waru-gltgb = lv_gltgb.
ls_alv_waru-new = 'X'.

Endif.

MODIFY lt_alv_waru from ls_alv_waru index l_index.
Endloop.

0 Kudos
200

hi,

thanks for your reply.

Actually both internal tables ( lt_selected.. and lt_alv..) are from the same structure, and dont have any key! ( In structure cant specified the keys or ? so how I can put there where key clause inside the loop ?

Thanks for your help ...

0 Kudos
200

By key what Srikanth meant was those fields that uniquely identify the particular row that you are trying to modify. You are tyring to modify some row of the internal table. You have to tell the system which row by either specifying the WHERE clause or the INDEX.

Srinivas

0 Kudos
200

try this........

MODIFY table lt_alv_waru from ls_alv_waru transporting gltgv gltgb new.

0 Kudos
200

Hello,

MODIFY table lt_alv_waru from ls_alv_waru transporting gltgv gltgb new.

I have have tried this statement, but gave me the same error.

0 Kudos
200

Hi Haider,

Can you please paste the whole code telling what are you tring to do. By concept you will have a key or an index for sure logically. May be I will help you identify that.

Regards,

Srikanth

0 Kudos
200

Hi Srikanth,

Its very kind of you,

I have now solved the problem and using the following statement..

MODIFY lt_alv_waru from ls_alv_waru Transporting gltgv gltgb new

where bname = ls_selected_rows-bname.

many thanks for your help and points goes to you