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

Ranges select

Former Member
0 Likes
531

Hi

I have table of ranges in my function module , that difine like :

sign(1) TYPE c

option(2) TYPE c

low TYPE PERNR_D

high TYPE PERNR_D

I use " IN" cluse in my select from pa0003.

data : Range_Emp_Wa type zrange_emp,

Pernr_Table type table of pa0003.

loop at range_emp into range_emp_wa.

clear lv_prnr_range.

lv_prnr_range-sign = range_emp_wa-sign.

lv_prnr_range-option = range_emp_wa-option.

lv_prnr_range-low = range_emp_wa-low.

lv_prnr_range-high = range_emp_wa-high.

append lv_prnr_range .

endloop.

*select * from pa0003*

into table pernr_table

where pernr in lv_prnr_range.

when I enter more than one line i dosent work.

any help pls.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
502

Hi,

Write the Query like this....


RANGES: R_PERNR FOR PA0003-PERNR.

data : Range_Emp_Wa type zrange_emp,
Pernr_Table type table of pa0003.

loop at range_emp into range_emp_wa.
clear R_PERNR .
R_PERNR -sign = range_emp_wa-sign.
R_PERNR -option = range_emp_wa-option.
R_PERNR -low = range_emp_wa-low.
R_PERNR -high = range_emp_wa-high.
append R_PERNR .
endloop.
select * from pa0003 
into table pernr_table
where pernr in lv_prnr_range.

The only thing is you need to declare the ranges.......

Just copy and paste this code it will work....

Thanks,

Chidanand

3 REPLIES 3
Read only

Former Member
0 Likes
502

Hi MK ,

nothing wrong with ur code , may be u dont have DATA for those EMP/based on the condition in ur WHERE clause.

regards

Prabhu

Read only

Former Member
0 Likes
502

Hi,

I think you don't need to do the loop statement.

The only thing you need to consider is that, whether value you filled is converted to leading zeros. Otherwise it will not get the value from table.

FM for your reference:

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT

Regards,

Chris Gu

Read only

Former Member
0 Likes
503

Hi,

Write the Query like this....


RANGES: R_PERNR FOR PA0003-PERNR.

data : Range_Emp_Wa type zrange_emp,
Pernr_Table type table of pa0003.

loop at range_emp into range_emp_wa.
clear R_PERNR .
R_PERNR -sign = range_emp_wa-sign.
R_PERNR -option = range_emp_wa-option.
R_PERNR -low = range_emp_wa-low.
R_PERNR -high = range_emp_wa-high.
append R_PERNR .
endloop.
select * from pa0003 
into table pernr_table
where pernr in lv_prnr_range.

The only thing is you need to declare the ranges.......

Just copy and paste this code it will work....

Thanks,

Chidanand