‎2008 May 22 11:09 AM
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
‎2008 May 22 11:14 AM
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
‎2008 May 22 11:14 AM
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
‎2008 May 22 12:21 PM
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
‎2008 May 22 1:18 PM
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.