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

Check Select Options

Former Member
0 Likes
462

Hi Genius,

Could you please tell me how to check the internal table entries using select options in a subroutine i.e if the entry exists in a range of select-options it is to be taken otherwise it is to be neglected.

I will definitely reward gd point to u but tell me in any case,

Thnx ,

Rahul.....................................................

3 REPLIES 3
Read only

Former Member
0 Likes
438

Here is the simple example ->

tables : mara.

data : i_mara like mara occurs 0 with header line.

select-option s_matnr for mara-matnr.

start-of-selection.

select * from mara into table i_mara

where matnr <b>in s_matnr.</b>

if sy-subrc ne 0.

give error message " No data found ".

endif.

for internal table

loop at i_mara where field in s_matnr

endloop.

Thanks

Seshu

Message was edited by:

Seshu Maramreddy

Message was edited by:

Seshu Maramreddy

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
438

You can do something like this.

Loop at itab where field in s_field.

Endloop.

Or

Loop at itab.
if itab-field in s_field.
* Do something.
endif.

endloop.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
438

hi Rahul

try the following code

select options : s_options for mara-matnr.

select * from mara into corresponding fields of <itab> where matnr in s_options.

if sy-subrc eq 0.

code....

else .

message e001(<message class>)." define message class in se93 and define message there.

endif.

regards

ravish

<b>plz dont forget to reward point if useful</b>