2007 Jul 20 10:49 AM
Hi.
please look at this code, its giving runtime error like this 'Error in an ABAP/4 statement when processing an internal table'. how to correct this.
loop at lv_order1.
select single werks from s886 into werks where pkunag = lv_order1-cust.
if sy-subrc <> 0.
MESSAGE w008(ykmessage) WITH zporder-cust.
write 😕 'Customer Code', lv_order1-cust,' is not Present'.
skip.
else.
modify lv_order2 from lv_order1.
endif.
select single maktx from makt into maktx where matnr = lv_order1-matnr.
if sy-subrc <> 0.
MESSAGE w003(ykmessage) WITH lv_order1-matnr.
write 😕 'Material Code',lv_order1-matnr,' Not Present'.
skip.
else.
modify lv_order2 from lv_order1.
endif.
endloop.
2007 Jul 20 11:00 AM
Hi Prajwal,
Your statement
<b>modify lv_order2 from lv_order1.</b>
is trying to modify the whole lv_order2 internal table with the data of lv_order1 header. Is that what you want. If not plz include a <b>where clause</b> or <b>move lv_order1</b> header data <b>to lv_order2</b> header data and then <b>append lv_order2</b>.
<b>
Reward points if this helps you,</b>
Kiran
2007 Jul 20 10:55 AM
Please check if data definition is correct.
Tables:werks,
maktx.
and Lv oder1 has a headerline...?
as u were trying to modify lv_order2 from lv_order1.
Regards,
Reema.
2007 Jul 20 11:02 AM
2007 Jul 20 10:58 AM
Hi
You need to check whether you have declared the table s886
and how u have declared your internal table- with header line or w/o it.
regards
dinesh
2007 Jul 20 10:58 AM
Hi,
Don't use select statement within loop ... endloop.Better use read table statement
Reward points if helpful.
Regards.
Srikanta Gope
2007 Jul 20 11:00 AM
Hi Prajwal,
Your statement
<b>modify lv_order2 from lv_order1.</b>
is trying to modify the whole lv_order2 internal table with the data of lv_order1 header. Is that what you want. If not plz include a <b>where clause</b> or <b>move lv_order1</b> header data <b>to lv_order2</b> header data and then <b>append lv_order2</b>.
<b>
Reward points if this helps you,</b>
Kiran
2007 Jul 20 11:06 AM
hi kiran.
s i want to modify the table with the data of lv_order1 header
2007 Jul 20 11:08 AM
check if lv_order1 has the same type of lv_order2.
regards,
Reema.
2007 Jul 20 11:09 AM
check if lv_order1 has the same type of lv_order2.
else try using "append "
Regards,
Reema.
2007 Jul 20 11:17 AM
2007 Jul 20 11:12 AM
Hi,
Do not modify internal table directly.
use the following syntax to slove problem.
loop at lv_order1.
select single werks from s886 into werks where pkunag = lv_order1-cust.
if sy-subrc <> 0.
MESSAGE w008(ykmessage) WITH zporder-cust.
write 😕 'Customer Code', lv_order1-cust,' is not Present'.
skip.
else.
<b>move-corresponding lv_order1 to lv_order2.
append lv_order2.
clear lv_order2.</b>
endif.
As such there is not any problem in select statement. try this and check the output.
<b>Rewards if useful.</b>
Regards,
Kinjal