2010 Mar 25 1:59 PM
Hi,
Im using below select query to fetch records:
SELECT <fld_list> INTO TABLE <itab>
industry between s_vert_low AND s_vert_high.
but it is not giving me any record.
rgds
sudhanshu
Moderator message: please use a more meaningful subject line next time.
Edited by: Thomas Zloch on Mar 25, 2010 3:06 PM
2010 Mar 26 2:01 AM
better question might be "what's right with this query?"...Answer ...we'll skip that....
Is fld_list populated?
I assume that the dereferencing for <itab> is correct...
What table are you selecting from? No 'WHERE'? Try something like this:
select <fld_list> from <database table> into table <itab>
where industry ge s_vert_low AND industry le s_vert_high.
But, why are you doing dynamic field list into dynamic table without a dynamic where clause?
2010 Mar 25 2:18 PM
Hi,
populate s_vert_low , s_vert_high into a range ....
s_vert-sign = 'I'.
s_vert-option = 'BT'.
s_vert-low = s_vert_low.
s_vert-high = s_vert_high.
append s_vert.
and write as below .....
SELECT <fld_list> INTO TABLE <itab>
industry in s_vert.
Regards,
Srini.
2010 Mar 26 2:01 AM
better question might be "what's right with this query?"...Answer ...we'll skip that....
Is fld_list populated?
I assume that the dereferencing for <itab> is correct...
What table are you selecting from? No 'WHERE'? Try something like this:
select <fld_list> from <database table> into table <itab>
where industry ge s_vert_low AND industry le s_vert_high.
But, why are you doing dynamic field list into dynamic table without a dynamic where clause?
2010 Mar 26 10:23 AM
yes... you are right. i didn't post it well. My query is like this:
SELECT <fld_list> from BUT000 INTO TABLE <itab> where
industry between s_vert_low AND s_vert_high.
I have taken ranges also but if s_vert_high is blank it is not giving me any record. any input?
rgds
sudhanshu
2010 Mar 26 10:33 AM
hi
first check the ranges low and high then append th ranges internal table.
Check Ranges low and high initial then append it.
Check the example code.
IF NOT s_vert-low IS INITIAL AND NOT s_vert-high IS INITIAL.
s_vert-sign = 'I'.
s_vert--option = 'BT'.
s_vert--low = s_vert-low .
s_vert--high = s_vert-low .
APPEND s_vert.
ELSEIF NOT s_vert-low IS INITIAL AND s_vert-high IS INITIAL.
s_vert-sign = 'I'.
s_vert-option = 'EQ'.
s_vert-low = s_vert_low.
APPEND gr_po_dte.
ELSEif s_vert-high IS INITIAL AND s_vert-high IS INITIAL .
s_vert-sign = 'I'.
s_vert--option = 'CP'.
s_vert--low = '*'.
APPEND gr_po_dte.
CLEAR: gr_po_dte.
ENDIF.
2010 Mar 26 1:35 PM
seems it will work. Thanks Dharmraj. I still have to do certain things in this and will update accordingly.
Rgds
sudhanshu
2010 Mar 26 10:47 AM
do like
SELECT <fld_list> INTO TABLE <itab>
where industry GE s_vert_low AND INDUSTRY LE s_vert_high.