03-24-2010 10:24 AM
Hi,
Im using this select query in my RFC:
select <field list> from but000 into table IT_but000 where type = '2' and partner in r_client.
Where r_client is a range having values for diffrent partners. Issue is when there is no value in r_client query is not returning any record. ideally it should return records based on condition "type = 2". can anybody help me in this.
Rgds
Sudhanshu
03-24-2010 10:31 AM
Hi,
When you are using the select query as you are using then the selection will be based on type = '2' and partner in r_client as you have given AND. Instead you can give an IF condition and check whether the r_client is not initial then use the select query
select <field list> from but000 into table IT_but000 where type = '2' and partner in r_client and in case id r_client is initial use select <field list> from but000 into table IT_but000 where type = '2'.
Regards,
Midhun
03-24-2010 10:35 AM
Hi,
Infact that is my problem. I have 5 more fields in selection screen and can't just put so many IFs. ideally it should not consider r_client if there is no value in this and retieve records based on "type" only.
rgds
sudhanshu
03-24-2010 10:41 AM
Hi
just check the type of r_client and the partner in the debug mode.
and also just give the select query as select <field list> from but000 into table IT_but000 where partner in r_client and type = '2'.
Regards,
Midhun
03-24-2010 10:37 AM
03-24-2010 10:42 AM
Hi,
Here is the way im using ranges:
ranges: r_client for BUT000-PARTNER.
r_client-sign = 'I'.
r_client-option = 'EQ'.
r_client-low = s_client_low.
r_client-high = s_client_high.
append r_client.
rgds
sudhanshu
03-24-2010 11:00 AM
Hello,
May be you could do something like this and check,
ranges: r_client for BUT000-PARTNER.
if not s_client[] is initial.
r_client-sign = 'I'.
r_client-option = 'EQ'.
r_client-low = s_client_low.
r_client-high = s_client_high.
append r_client.
else.
r_client-sign = 'I'.
r_client-option = 'CP'.
r_client-low = '*'.
append r_client.
endif.
Vikranth
03-24-2010 11:50 AM
Hi Sudhanshu,
You may try the following code.
ranges: r_client for BUT000-PARTNER.
If s_client[] is not initial.
r_client-sign = 'I'.
r_client-option = 'EQ'.
r_client-low = s_client-low. "Hope you have put S_CLIENT-LOW instead of S_CLIENT_LOW
r_client-high = s_client-high.
append r_client.
endif.
Hope this helps.
Thanks,
Ranjith
03-24-2010 10:40 AM
Hi
Just modify the querry as below.
select <field list> from but000 into table IT_but000 where type = '2' * or * partner in r_client.
Regards,
Pravin
Edited by: pravin s. on Mar 24, 2010 11:40 AM
03-24-2010 11:49 AM
Hi,
If s_client is your select-options in ur selection u can directly use that in query
whithout populating the range table (r_client). Code given below.
select <field list> from but000 into table IT_but000 where type = '2'
and partner in s_client. This will populate the itab.
Regards,
Rajeswari