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-option

Former Member
0 Likes
621

how do i pop-up my own selection values for a select-option.pls send the relevant code.

5 REPLIES 5
Read only

Former Member
0 Likes
600

Whenever you will declare the SELECT-OPTIONS as OBLIGATORY only low value is mandatory, but if you want to make high value also mandatory check below code.

Sometimes we need the parameter in selection screen but only to display value and user should not allow change its value for such requirement check below code.

Try This :-

SELECT-OPTIONS S_DATE FOR SY-DATUM OBLIGATORY.

PARAMETER CUST TYPE KNA1-KUNNR DEFAULT '1000' MODIF ID M1.

  • TO MAKE SELECT OPTION HIGH VALUE MANDATORY

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'S_DATE-HIGH'.

SCREEN-REQUIRED = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

  • TO MAKE SCREEN INPUT EQUAL TO DISPLAY

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'M1'.

SCREEN-INPUT = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

SELECT-OPTIONS s_date FOR sy-datum OBLIGATORY.

SELECT-OPTIONS s_date1 FOR sy-datum OBLIGATORY DEFAULT '20070814' MODIF ID s1.

PARAMETER cust TYPE kna1-kunnr DEFAULT '1000' MODIF ID m1.

PARAMETER cust1 TYPE kna1-kunnr DEFAULT '2000' MODIF ID m2.

  • TO MAKE SELECT OPTION HIGH VALUE MANDATORY

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'S_DATE-HIGH'.

screen-required = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

LOOP AT SCREEN.

IF screen-group1 = 'S1'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

  • TO MAKE SCREEN INPUT EQUAL TO DISPLAY

LOOP AT SCREEN.

IF screen-group1 = 'M1'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

LOOP AT SCREEN.

IF screen-group1 = 'M2'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Rewards if useful............

Minal

Read only

Former Member
0 Likes
600

Hi,

Check the below code.

tables: pa0000.

select-options: s_pernr for pa0000-pernr.

initialization.

data: begin of i_pernr occurs 0,

pernr like pa0000-pernr,

end of i_pernr.

i_pernr-pernr = '123'.

append i_pernr.

i_pernr-pernr = '456'.

append i_pernr.

i_pernr-pernr = '789'.

append i_pernr.

at selection-screen on value-request for s_pernr-low.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'PERNR'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_PERNR-LOW'

value_org = 'S'

tables

value_tab = i_pernr

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

at selection-screen on value-request for s_pernr-high.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'PERNR'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_PERNR-HIGH'

value_org = 'S'

tables

value_tab = i_pernr

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

Read only

Former Member
0 Likes
600

INITIALIZATION IS THE BLOCK WHERE YOU CAN DO THE SAME.

IF U NEED DEFAULT VALUES ,

THEN USE LIKE THIS.

PARAMETERS : P_VBELN LIKE VBAK-VBELN DEFAULT '123456'.

REWARD IF USEFUL.

AMIT SINGLA

Read only

Former Member
0 Likes
600

Hi

You can attach some search help for this purpose.You can link the search help to select-options using the addition matchcode id <search help name> to the select-option

Reward if useful.

Regards

Shibin

Read only

Former Member
0 Likes
600