‎2006 Nov 21 4:41 PM
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
‎2006 Nov 21 4:45 PM
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
‎2006 Nov 21 4:51 PM
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!
‎2006 Nov 21 4:49 PM
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!
‎2006 Nov 21 5:08 PM
Hi,
Try to use FREE_SELECTIONS_RANGE_2_WHERE. Its will be a dynamic selection convertion.
aRs
‎2006 Nov 21 9:19 PM
Thanks. This one didn't work as it fails when an entity has a numeric value. Ex. 0CALDAY
‎2006 Nov 21 9:19 PM
Thanks for the help.
I Found FM F4_CONV_SELOPT_TO_WHERECLAUSE to help me out..
‎2006 Nov 21 5:18 PM
HI,
See the below FM's
ARBW_SELECT_RANGES_FILL
G_SET_DYNAMIC_LIST_RANGES
TR_FILL_RANGES
‎2006 Nov 21 9:23 PM
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
‎2006 Nov 22 2:29 PM
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!