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

parameter to select-option conversion

Former Member
0 Likes
1,987

Hello Friends,

I have a parameter field on selection screen and it is optional.

If user enters any data on parameter, then I have to retrieve only corresponding value to the parameter from table.

If user does not enter any data in parameter, then I have to fetch all the records.

I want to convert this to selection-option.

please let me know....

4 REPLIES 4
Read only

Former Member
0 Likes
1,049

You can use a range for that......



PARAMETERS: p_test TYPE c.

IF p_test IS NOT INITIAL.
r_test-sign    = 'I'.
r_test-option = 'EQ'.
r_test-low     = p_test.
APPEND r_test.
ENDIF.

If no value is entered in parameter then don't populate the range and it will get all the possible values.

Read only

Former Member
0 Likes
1,049

Hi,

Instead of converting why cant you do like this ,


if P_field is initial.
select * from <table>
into table itab.
else.
select * from <table >
into table itab 
where field  = p_field.
endif.

You can use select-option as parameter in this way,


Select-options : s_field for wa-field no intervals no-extension.

Regads,

Raghava Channooru

Read only

Former Member
0 Likes
1,049

Hi,

Please see the SCN Rules before Posting

With Regards,

Sumodh.P

Read only

ThomasZloch
Active Contributor
0 Likes
1,049

Welcome to SDN.

This is a very basic question that you can solve yourself. Please try and search for answers before posting questions, as we are trying to cut down on the redundancy in these forums.

Thread locked.

Thomas