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

Range Table to Select Statement

sap_cohort
Active Contributor
0 Likes
4,576

Anyone know a function module or example code to convert a range table of selections to SQL Selections? I need to convert the following format to SQL Select. The BT seems hardest to convert. Example: 1/3/06 BT 1/10/06

CHANM	RSCHANM	CHAR	30
SIGN	RALDB_SIGN	CHAR	1
COMPOP	RSDRI_COMPOP	CHAR	2
LOW	RSCHAVL	CHAR	60
HIGH	RSCHAVL	CHAR	60

9 REPLIES 9
Read only

Former Member
0 Likes
2,450

Hi,

Use the IN operator in the WHERE clause of the select statement..

ex.

RANGES: R_MATNR FOR MARA-MATNR.

SELECT * FROM MARA

WHERE <b>MATNR IN R_MATNR</b>.

is this what you want..

OR

Do you want to build the where clause for a range <b></b>..Then use the function module ASEL_CEDST_2_RANGE_WHERE..

Thanks,

Naren

Read only

0 Likes
2,450

Hi, I found the Function Module RSDS_RANGE_TO_WHERE in my BW system. It was a matter of knowing which keywords to look for. Thanks for the help!

Read only

sap_cohort
Active Contributor
0 Likes
2,450

Thanks for the reply! Unfortunately there are multiple characteristics in the range table. Also, in my bw system I don't have access to that Function Module. Any more ideas?

Thanks!

Read only

former_member194669
Active Contributor
0 Likes
2,450

Hi,

Try to use FREE_SELECTIONS_RANGE_2_WHERE. Its will be a dynamic selection convertion.

aRs

Read only

0 Likes
2,450

Thanks. This one didn't work as it fails when an entity has a numeric value. Ex. 0CALDAY

Read only

0 Likes
2,450

Thanks for the help.

I Found FM F4_CONV_SELOPT_TO_WHERECLAUSE to help me out..

Read only

Former Member
0 Likes
2,450

HI,

See the below FM's

ARBW_SELECT_RANGES_FILL

G_SET_DYNAMIC_LIST_RANGES

TR_FILL_RANGES

Read only

uwe_schieferstein
Active Contributor
0 Likes
2,450

Hello Kenneth

Perhaps function module <b>RH_DYNAMIC_WHERE_BUILD</b> may be the one you are looking for. You fill TABLES parameter <i>condtab</i> with your conditions and the clause is returned in <i>where_clause</i>.

Regards

Uwe

Read only

sap_cohort
Active Contributor
0 Likes
2,450

Thanks, but I found FM F4_CONV_SELOPT_TO_WHERECLAUSE to help me out.. Doesn't require and other parameters than the range table and doesn't do any DB Checks...

Thanks!