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

simple qa --- adding

Former Member
0 Likes
1,312

&----


*

& 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
Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,284

u give declaration

tables knmt.

and use the following

select single matnr kdmat

into (knmt-matnr , knmt-kdmat ).

Read only

0 Likes
1,284

i declare tables : knmt in the main

sorry i didn't mention

Read only

0 Likes
1,284

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

Read only

Former Member
0 Likes
1,284

Hi,

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

Read only

Former Member
0 Likes
1,284

Hi Liat,

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

except for the spelling of endslect should be endselect.

Read only

andreas_mann3
Active Contributor
0 Likes
1,284

Hi,

try that:

SELECT matnr

FROM knmt

APPENDING CORRESPONDING FIELDS OF TABLE itab2.

regards Andreas

Read only

Former Member
0 Likes
1,284

Hi Liat,

Did you include this program n your main program?

Read only

0 Likes
1,284

ravi yes.

Read only

Former Member
0 Likes
1,284

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

Read only

0 Likes
1,284

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é

Read only

0 Likes
1,284

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

Sudha