‎2006 Nov 13 7:41 PM
Hi all,
I have a selection screen in which i have twi fields for input.
i have a field type numc and plant field in my selection screen
If the user enters a value a then i have to retrieve data based on that value but if user leaves blank then i have retrieve all values.
say 1234 and plnt as selection screen inputs,then i have
have
select * -
where id = a_id
and werks = a_werks.
when i enter the value for id it works fine.
when i leave id field balnk and enter only plant.
Iam getting a sy-subrc eq to 4 because i have a value of 0000 in a_id field.
in this case i have retrieve only based on plant.
Please let me know.
I cannot change the id because , i need to just modify the program code.
Thanks
PREETI
‎2006 Nov 13 7:46 PM
Hi
Please try as below:
<b>select-options: s_id for ... no-intervals no extension,
s_werks for ... no-intervals no extension.
select * -----------
where id in s_id
and werks in s_werks.</b>Kind Regards
Eswar
‎2006 Nov 13 7:46 PM
Hi
Please try as below:
<b>select-options: s_id for ... no-intervals no extension,
s_werks for ... no-intervals no extension.
select * -----------
where id in s_id
and werks in s_werks.</b>Kind Regards
Eswar
‎2006 Nov 13 7:47 PM
Hi,
Use SELECT-OPTIONS NO INTERVALS NO-EXTENSION instead of PARAMETERS..
And instead of using = use IN..
Ex.
TABLES: MARA.
SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR NO INTERVALS NO-EXTENSION.
SELECT SINGLE * FROM MARA
WHERE MATNR <b>IN</b> SO_MATNR.
Thanks,
Naren
‎2006 Nov 13 7:49 PM
Hi,
YOu have to modify the parameter ID like below.
SELECT-OPTIONS: A_ID FOR TABLE-FIELD NO-EXTENSION NO INTERVALS.
Then change the select statement like below.
select * -
where id IN a_id
and werks = a_werks.
Thanks
Ramakrishna
‎2006 Nov 13 8:56 PM
you have to use select options with no intervals.
This should solve your issues as select options behave like internal table and take blanks and wont give you an error.
Prince