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

Select options with specific range

Former Member
0 Likes
1,050

Hi All,

I wish to give the possibility to the user to show only two selections among many values for e specific fied.

For example:

Select-options: s_org1 for lfm1-ekorg NO INTERVALS .

But I want to give the possibility to the user to use/dispplay only two data of the above list.

This "short" range of values is necessary to me in a query using IN s_org1.

Any idea will be well appreciated.

Thanks in advance for your kind support.

Luigi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
995

I have used:

RANGES: codart FOR lfm1-ekorg.

AT SELECTION-SCREEN.

codart-sign = 'I'.

codart-option = 'E'.

codart-low = 'IT15'.

APPEND codart.

codart-sign = 'I'.

codart-option = 'E'.

codart-low = 'IT25'.

APPEND codart.

SELECT-OPTIONS: s_org1 FOR codart NO INTERVALS .

But I can't see the values set.

Any idea?

Thanks.

8 REPLIES 8
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
995

Hello,

If i understand correctly you want to provide default values to the SELECT-OPTIONS & make the field display-only.

Is this what you want ?

BR,

Suhas

Read only

venkat_o
Active Contributor
0 Likes
995

Hi Luigi, <li>Try this way.


REPORT ztest_notepad.
TABLES lfm1.
SELECT-OPTIONS: s_org1 FOR lfm1-ekorg NO INTERVALS .
DATA lines TYPE i.

AT SELECTION-SCREEN.
  DESCRIBE TABLE s_org1 LINES lines.
  IF lines > 2.
    DATA msg TYPE string.
    msg = 'S_ORG1 has more than two values'.
    MESSAGE msg TYPE 'E'.
  ENDIF.
Thanks Venkat.O

Read only

Former Member
0 Likes
995

Thanks for the quick reply.

More exaclty I want to set only two values (not consecutive) from the list of values of the field ekorg.

In other words, I want to set, from the beginning, only two values (i.e. 0010000001 and 0010000015). The range can show me i.e 0010000001 0010000002 0010000003 0010000004 0010000015 0010000018.

Is it possible?

Thanks,

Luigi

Read only

0 Likes
995

Hi

It is Possible. Select the data from table and build the range.

For Example.

Data : R_EKORG tyoe ekorg.

R_ekorg-Opton = '' IN "

R_EKORG-LOW = " LOW VALUE "

SELECT EKORG FROM TABLE (EKKO) WHERE EKORG IN S_EKORG.

APPEND RANGES.

Read only

0 Likes
995

Hi,

Lets say your have

select-options : s_ekorg for ekko-ekorg.
data : r_ekorg type range of ekko-ekorg, " Declare these 2 Extra in your program
wa_ekorg like line of r_ekorg.
then 

at selection-screen output. " Implement this Event
refresh r_ekorg.
clear wa_ekorg.
wa_ekorg-sign = 'I'.
wa_ekorg-option = 'BT'.
wa_ekorg-low = '0010000001'
wa_ekorg-high =  '00100000018'.
append wa_ekorg to r_ekorg.
s_ekorg[] = r_ekorg[].  " This will give you default value to your Select Options.

In other words, I want to set, from the beginning, only two values (i.e. 0010000001 and 0010000015). The range can show me i.e 0010000001 0010000002 0010000003 0010000004 0010000015 0010000018.

Cheerz

Ram

Read only

Former Member
0 Likes
996

I have used:

RANGES: codart FOR lfm1-ekorg.

AT SELECTION-SCREEN.

codart-sign = 'I'.

codart-option = 'E'.

codart-low = 'IT15'.

APPEND codart.

codart-sign = 'I'.

codart-option = 'E'.

codart-low = 'IT25'.

APPEND codart.

SELECT-OPTIONS: s_org1 FOR codart NO INTERVALS .

But I can't see the values set.

Any idea?

Thanks.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
995

Hello,

For this you have to use either INITIALIZATION or AT SELECTION-SCREEN OUTPUT event and not AT SELECTION-SCREEN.

SELECT-OPTIONS: s_org1 FOR lfm1-ekorg NO INTERVALS MODIF-ID 'M1'.

INITIALIZATION.
s_org1-sign = 'I'.
s_org1-option = 'E'.
s_org1-low = 'IT15'.
APPEND s_org1.
s_org1-sign = 'I'.
s_org1-option = 'E'.
s_org1-high = 'IT25'.
APPEND s_org1.

LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'M1'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

Hope this helps.

BR,

SUhas

Read only

Former Member
0 Likes
995

Hi,

You can use this FM at selection-screen event F4IF_INT_TABLE_VALUE_REQUEST.

Regards,

Sudeshna