‎2008 Feb 06 10:44 AM
Dear Friends,
I have problem with select statement:
My query is like this:
REFRESH: r_name_key.
REFRESH: r_PART_NO.
r_name_key-sign = 'I'.
r_name_key-option = 'CP'.
r_name_key-low = '00000000' .
r_name_key-high = '99999999' .
APPEND r_name_key.
r_PART_NO-sign = 'I'.
r_PART_NO-option = 'CP'.
r_PART_NO-low = ' ' .
r_PART_NO-high = ' ' .
APPEND r_PART_NO.
SELECT matnr name_key part_no FROM XXX INTO TABLE
itab_XXX
FOR ALL ENTRIES IN itab_mfg
WHERE NAME_KEY in r_name_key and
PART_NO in r_PART_NO and
matnr = itab_mfg-matnr.
Here itab_mfg is having 305 records and Table XXX is having 2000 records.
The query is failed...its not picked even one records also...Ihave checked the table there are somany matched records need to fetch ( Ihave used the ranges to increse the performence).
whats the problem with query???
Thanks,
Sridhar.
‎2008 Feb 06 10:48 AM
Hi,
check ur ranges
r_name_key-sign = 'I'.
r_name_key-option = 'BT'.
r_name_key-low = '00000000' .
r_name_key-high = '99999999' .
APPEND r_name_key.
r_PART_NO-sign = 'I'.
r_PART_NO-option = 'BT'.
r_PART_NO-low = ' ' .
r_PART_NO-high = ' ' .
APPEND r_PART_NO.Cheers,
jose.
‎2008 Feb 06 10:48 AM
Hi,
Change your code as below :
r_name_key-sign = 'I'.
r_name_key-option = 'BT'. "Chnaged from CP to BT
r_name_key-low = '00000000' .
r_name_key-high = '99999999' .
APPEND r_name_key.
r_PART_NO-sign = 'I'.
r_PART_NO-option = 'BT'. "Changed from CP to BT
r_PART_NO-low = ' ' .
r_PART_NO-high = ' ' .
APPEND r_PART_NO.
Thanks,
Sriram Ponna.
‎2008 Feb 06 11:09 AM
Sriram Thanks for the replay,
The problem is solved but if I removed r_PART_NO range from select statement. if I pass r_PART_NO in my select stament along with r_name_key the condition is failed.....
anyho thanks for the replay.
Sridhar
‎2008 Feb 06 10:49 AM
‎2008 Feb 06 10:50 AM
HI shridhar,
Your ranges will be the problem. For option you use 'CP' which means contains pattern, but from the values in low and high this should be BT I guess?
For the second range it is not clear what you want. To select only records with PART_NO = space?
Regards,
John.
‎2008 Feb 06 11:18 AM
Your right ..... I need to take BT instead of CP, I removed it.
and for PART_NO its Char field in my table because of that I have taken it like this in my select statement.
but if I used PART_NO in my select statemnt the condition is failed.( I gues it is empty so ..)
‎2008 Feb 06 11:27 AM
Hi,
Can you do a small change, anyhow you are not passing any values to r_part_no take out the r_part_no from the select statement. And you can use below statement.
Delete itab where part_no not in r_part_no.
Thanks,
Sriram Ponna.
‎2008 Feb 06 10:54 AM
hi ,
try like dis,
SELECT matnr name_key part_no INTO TABLE
itab_XXX
FROM XXX
FOR ALL ENTRIES IN itab_mfg
WHERE NAME_KEY in r_name_key and
PART_NO in r_PART_NO and
matnr = itab_mfg-matnr.
reward if helpful
‎2008 Feb 06 10:57 AM
Hi,
Option u kept as 'CP'. Is it the exact requirement matches or not . once check.
Thanks,
Suma.