Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECTION SCREEN ISSUE

Former Member
0 Likes
542

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
491

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

4 REPLIES 4
Read only

Former Member
0 Likes
492

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

Read only

Former Member
0 Likes
491

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

Read only

venkata_ramisetti
Active Contributor
0 Likes
491

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

Read only

Former Member
0 Likes
491

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