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

Select statement

Former Member
0 Likes
1,255

Hi All,

I have a situation where I need to select few fields from a std table to my internal table based on certain crtiteria and one of the criteria is if the field indicator is "X" then it should not insert the data in the internal table, can you please tell me how to write this statement. my table name is it_tab abd std table let say xyz and the field name is "OPEN".

so the statement should be:

select * from xyz into tabke it_tab

where name = 'ravi' and

bukrs = c_bukrs and

open ne 'X'.

is the above statement right?

Thanks,

Rajeev Gupta

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,225

looks ok to me. what is the problem?

12 REPLIES 12
Read only

Former Member
0 Likes
1,225

Hi,

Your stmt is correct. But make sure that the it_tab structure is same as the table structure.

Thanks,

Senthil

Read only

Former Member
0 Likes
1,227

looks ok to me. what is the problem?

Read only

0 Likes
1,225

Thanks for your replies... I was just cross checking !!!

Thanks,

Rajeev

Read only

0 Likes
1,225

Hi When I tried to run this statement it gav eme following error:

REPORT/PROGRAM statement missing, or program type is (include). How can make the chnage now.

Thanks,

Rajeev

Read only

0 Likes
1,225

Go to ->Attributes then change the Program type to executable program and activate it

Read only

0 Likes
1,225

Thanks for the reply but this is defined as an include program, don't you think it will create some problem !!!!

Thanks,

Rajeev

Read only

0 Likes
1,225

You cant execute an include program .create a report and use this include

Read only

0 Likes
1,225

Everything is already created and I just need to make some changes in the program which is basically a include in the main program

Read only

0 Likes
1,225

then activate the include and try

Read only

0 Likes
1,225

Activate the include, and execute the Main program

Read only

0 Likes
1,225

Press <ctrl> <shift> <f5> and them run the main program.

Regards

Read only

Former Member
0 Likes
1,225

Yes your select must work, just mentioning below again.

SELECT * INTO TABLE IT_TAB

FROM XYZ

WHERE NAME = 'RAVI'

AND BUKRS = C_BUKRS

AND OPEN <> 'X'.

If, you find any discrepancies let us know.