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

Dynamic Select

Former Member
0 Likes
584

Hi Experts

I want to write a dynamic select , with a dynamic where clause that get the data from a reange table.

the ranges table looks like :

sign    option    low    high
   I         NE      103     
   I         BT       100    105
   I         EQ      100

I try select with IN in the where clause but it doesn't work :

SELECT * FROM pa0003
  INTO TABLE pernr_table
  WHERE pernr IN range_emp.

Where range_emp is the name of the ranges table .

any help pls

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
556

Did you declare range_emp as ([DATA - RANGE OF |http://help.sap.com/abapdocu/en/ABAPDATA_RANGES.htm])

DATA: range_emp TYPE RANGE OF pernr_d.

Else, did you declare and fill (internal format) the sub fields of your internal table correctly.

Regards

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
557

Did you declare range_emp as ([DATA - RANGE OF |http://help.sap.com/abapdocu/en/ABAPDATA_RANGES.htm])

DATA: range_emp TYPE RANGE OF pernr_d.

Else, did you declare and fill (internal format) the sub fields of your internal table correctly.

Regards

Read only

0 Likes
556

Yes I do

Read only

0 Likes
556

The third entry isn't necessary - there is a logical OR between entries in a range. Assuming the data actually exists, chances are you need to convert to leading zeros.

look at function modules

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT

matt

Read only

Former Member
0 Likes
556

Thanks