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:Β 

table.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

10 REPLIES 10

Former Member
0 Kudos

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.

0 Kudos

HI Reema .

lv_order1 has headerline . its still giving error.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Don't use select statement within loop ... endloop.Better use read table statement

Reward points if helpful.

Regards.

Srikanta Gope

Former Member
0 Kudos

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

0 Kudos

hi kiran.

s i want to modify the table with the data of lv_order1 header

Former Member
0 Kudos

check if lv_order1 has the same type of lv_order2.

regards,

Reema.

Former Member
0 Kudos

check if lv_order1 has the same type of lv_order2.

else try using "append "

Regards,

Reema.

0 Kudos

thanks to all

Former Member
0 Kudos

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