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

Help me.

Former Member
0 Likes
502

Hi Experts,

Please help me to solve it out:

SELECT ETENR WMENG FROM VBEP INTO WA_I_VBAP_VBEP FOR ALL ENTRIES

IN I_VBAP_VBEP1 WHERE VBELN = I_VBAP_VBEP1-VBELN AND POSNR =

I_VBAP_VBEP1-POSNR.

MODIFY I_VBAP_VBEP1 FROM WA_I_VBAP_VBEP WHERE VBELN =

WA_I_VBAP_VBEP-VBELN AND POSNR = WA_I_VBAP_VBEP-POSNR.

ENDSELECT.

In this select, I am using work area of the internal table that I am also using with FOR ALL ENTRIES IN . How can I modify the internal table from workarea of this internal table. It is asking for INDEX.

Thanks in advance.

Deepak

1 ACCEPTED SOLUTION
Read only

prasanth_kasturi
Active Contributor
0 Likes
484

hi,

insted of using an select ... endselect

first fill the values into the internal table......using all entries

then using

loop at <itab> into wa

use modify

endloop

reward if helpful

prasanth

3 REPLIES 3
Read only

prasanth_kasturi
Active Contributor
0 Likes
485

hi,

insted of using an select ... endselect

first fill the values into the internal table......using all entries

then using

loop at <itab> into wa

use modify

endloop

reward if helpful

prasanth

Read only

Former Member
0 Likes
484

hi deepak

The code itself shows that pulling the data into WA using all entries is wrong.

First u need to pull all the data in to internal table then loop on the base table and read this new table entries and according to that modify ur table.

hope this ll be helpful

Thanks & Regards

vinsee

Read only

Former Member
0 Likes
484

hi,

try this.

take one temp internal table,

fetch all ur records into that table using for all entries.

SELECT ETENR WMENG FROM VBEP INTO table I_VBAP_VBEP_temp FOR ALL ENTRIES

IN I_VBAP_VBEP1 WHERE VBELN = I_VBAP_VBEP1-VBELN AND POSNR =

I_VBAP_VBEP1-POSNR.

then loop through ur internal table

loop at I_VBAP_VBEP1 into WA_I_VBAP_VBEP.

l_tabix = sy-tabix.

read able I_VBAP_VBEP1_temp with key vbeln = WA_I_VBAP_VBEP-vbeln posnr = WA_I_VBAP_VBEP-posnr.

if sy-sub rc = 0.

modify I_VBAP_VBEP1 FROM WA_I_VBAP_VBEP_temp index l_tabix.

endif.

endlop.

regards,

muralidhar.