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-options

Former Member
0 Likes
557

Hi All,

I have to create a report where I have to use SELECT-OPTIONS for vendor number. If user does not enter the vendor number (vendor-low and vendor-high are blanks) then I have to select records for all vendors. If user enters a range or individual vendor numbers and I have to select only the entered vendor numbers. How I can do this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
537

just use select-options : s_lifnr for lfa1-lifnr.

and in your selection query, use

where

lifnr in S_lifnr.

the system will automatically take care of the rest. ..that means, the system will pick only those vendors, if something is specified in s_lifnr, else, it will pick for all vendors..

SAP is intelligent, right ??

4 REPLIES 4
Read only

Former Member
0 Likes
538

just use select-options : s_lifnr for lfa1-lifnr.

and in your selection query, use

where

lifnr in S_lifnr.

the system will automatically take care of the rest. ..that means, the system will pick only those vendors, if something is specified in s_lifnr, else, it will pick for all vendors..

SAP is intelligent, right ??

Read only

Former Member
0 Likes
537

hi,

do this way ..

select * from lfa1 into table it_lfa1 where lifnr in s_lifnr.

Regards,

Santosh

Read only

Former Member
0 Likes
537

Hi,

Just try this.


    select *
    into table <internal table>
    from <DB table>
     where lfa1 in s_vendor.

regards

raam

Read only

Former Member
0 Likes
537

Hi,

Use like this,

Select-options : vendor for lfa1-lifnr.

data : itab like lfa1 occurs 0 with header line.

in select Query,

Select * from lfa1 into itab where lifnr in vendor.