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

defining range

Former Member
0 Likes
770

Dear experts,

I need to display the range of vendor no in my report,

could anyone pls give me the code to define range and select vendor accordingly

thanks in advance

kar

6 REPLIES 6
Read only

ferry_lianto
Active Contributor
0 Likes
708

Hi,

Try this.


TABLES: LFA1.
SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR.
                                                                        
SELECT LIFNR
INTO TABLE I_LFA1
FROM LFA1
WHERE LIFNR IN S_LIFNR.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
708
data : begin of it_ranges occurs 0,
               sign(1),
               option(2),
               low like lfa1-lifnr,
               high like lfa1-lifnr,
          end of it_ranges.

select lifnr into table it_lifnr from lfa1 where lifnr in it_ranges.
Read only

0 Likes
708

Dear Chandrasekar

Can i declar like below

SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR.

what is the difference with the above code and your code.

data : begin of it_ranges occurs 0,

sign(1),

option(2),

low like lfa1-lifnr,

high like lfa1-lifnr,

end of it_ranges.

select lifnr into table it_lifnr from lfa1 where lifnr in

it_ranges.

pls explain

Read only

0 Likes
708
with the first case  

SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR

user has to give input 

In my case there is no need for user to give input , u can build your own LIFNRs like this

it_ranges-sign = 'I'.
it_ranges-option = 'BT'.
it_ranges-low = '00001234'.
it_ranges-high = '  '.
append it_ranges.
clear it_ranges.

it_ranges-sign = 'I'.
it_ranges-option = 'BT'.
it_ranges-low = '0005678'.
it_ranges-high = '  '.
append it_ranges.
clear it_ranges.
Read only

Former Member
0 Likes
708

You define ranges like this:

ranges: s_lifnr for lfa1-lifnr.

Thanks,

Santosh

Read only

ferry_lianto
Active Contributor
0 Likes
708

Hi Karthik,

Yes, you can declare below code for your selection screen report to get range of vendor.

SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR.

if you do not want to display in your selection screen then you can use RANGE statement.

No need to declare an internal table like above code.

RANGES: R_LIFNR FOR LFA1-LIFNR.

Hope this will help.

Regards,

Ferry Lianto