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: 

simple qa --- adding

Former Member
0 Kudos

&----


*

& Include zzzzzzz

&----


data : begin of itab2 occurs 0,

matnr like knmt-matnr,

kdmat like knmt-kdmat,

maktx like makt-maktx,

matkl like mara-matkl,

bismt like mara-bismt,

end of itab2.

select matnr

into knmt-matnr

from knmt.

if sy-subrc = 0.

itab2-matnr = knmt-matnr.

append itab2.

endif.

endselct.

i get err

"statment is not accessible.

11 REPLIES 11

hymavathi_oruganti
Active Contributor
0 Kudos

u give declaration

tables knmt.

and use the following

select single matnr kdmat

into (knmt-matnr , knmt-kdmat ).

0 Kudos

i declare tables : knmt in the main

sorry i didn't mention

0 Kudos

The code you have pasted above will not work, because the sy-subrc check should come AFTER the endselect, and not before.

Maybe that is the error?

Hope this helps.

Sudha

Former Member
0 Kudos

Hi,

May be put start-of-selection statement before select statement

former_member181962
Active Contributor
0 Kudos

Hi Liat,

I copy-pasted yoour code and it is giving no error for me.

except for the spelling of endslect should be endselect.

andreas_mann3
Active Contributor
0 Kudos

Hi,

try that:

SELECT matnr

FROM knmt

APPENDING CORRESPONDING FIELDS OF TABLE itab2.

regards Andreas

former_member181962
Active Contributor
0 Kudos

Hi Liat,

Did you include this program n your main program?

0 Kudos

ravi yes.

Former Member
0 Kudos

i mad this alone

data : begin of itab2 occurs 0,

matnr like knmt-MATNR,

kdmat like knmt-kdmat,

maktx like makt-maktx,

matkl like mara-matkl,

bismt like mara-bismt,

end of itab2.

and i get the same err

0 Kudos

do as andreas mann already proposed:

SELECT matnr

FROM knmt

APPENDING CORRESPONDING FIELDS OF TABLE itab2.

this most likely what you want to.

Regards

René

0 Kudos

Can you paste the error in some detail? For eg, which module/include, line no, etc?

Sudha