cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select only 2 type in selection screen

Former Member
0 Likes
738

i have a parameter called zzzzz

i want that the user can chosse only '99' and '88'

how i do it?

thanks.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Likes

hi,

this can be done by two ways.

1. validate the parameter via AT SELECTION SCREEN event.

code ;

at selection screen .

if p_var ne '99' or p_var ne '98' .

message 'value should be 99 or 98' type 'E'.

endif.

or

2. create a list box with 99 and 98 and add to your parameter.

for that you have create a domain and data element in domain give default values as 99 and 98.

regards,

saleem

Former Member
0 Likes

GIVE AN OPTION TO SELECT FROM THE 2 VALUES USING THE FUNCTION MODULE "'F4IF_INT_TABLE_VALUE_REQUEST" AND DO THE VALIDATION TO CHECK IF IT ONE OF THOSE VALUES OR NOT ,THIS WAY THE USER WILL HAVE TO SELECT FROM THE 2 VALUES ONLY .BELOW IS THE CODE.

initialization.

PARAMETERS : zzzz(20).

data : tab type standard table of zstr1 with header line,

rettab type standard table of DDSHRETVAL with header line.

tab-name = '98'.

append tab.

tab-name ='99'.

append tab.

*DATA : TAB(20) type c occurs 0 with header line.

*at selection-screen output.

at selection-screen on value-request for zzzz.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'NAME'

VALUE_ORG = 'S'

CALLBACK_PROGRAM = sy-cprog

TABLES

VALUE_TAB = tab

RETURN_TAB = rettab.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

zzzz = rettab-fieldval .

at selection-screen on ZZZZ.

if rettab-fieldval <> 98 AND rettab-fieldval <> 99.

message e001(zmessage1).

else.

zzzz = rettab-fieldval .

endif.<i></i><i></i><i></i>

Former Member
0 Likes

HI

if you want to show error when the user selects other than 99 & 88 tehn validate in the at selection-screen.

at selecton-screen.

if p_zzzz not in ( '99' , '88' ).

message e001(zer).

endif.

otherwise you can use listbox to load 99 & 88 so that user can select only 99 & 88.

here is sample program for listbox

TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS PS_PARM(5) type c AS LISTBOX VISIBLE LENGTH 5

INITIALIZATION.

NAME = 'PS_PARM'.

VALUE-KEY = '99'

VALUE-TEXT = '99.

APPEND VALUE TO LIST.

VALUE-KEY = '88'.

VALUE-TEXT = '88'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

regards

Message was edited by: Harikishore Sreenivasulu

Message was edited by: Harikishore Sreenivasulu

Former Member
0 Likes

pass the values 99 & 88 in a field in an internal table and use Function module 'F4IF_INT_TABLE_VALUE_REQUEST' to c these values when user presses F4.

to validate, u can issue an error message if he enters something else.

eg.. if ( val <> '99' or val <> '88' ).

message 'value not proper' type 'E'.

endif.

Regards,

Bikash

thats exactly what i meant when i said populate values 99 & 88 in an internal table & use FM for F4 help. it ll pop up these 2 values in the box when user clicks F4

Message was edited by: Bikash Agarwal

hymavathi_oruganti
Active Contributor
0 Likes

u can put F4 help for the field giving those two values

and if the user enters any other value

AT SELECTION-SCREEN.

IF PAR NOT IN ('99,'88')

MESSAGE 'NOT VALID VALUE' TYPE 'E'.

ENDIF.

Former Member
0 Likes

no in the screen it will show only 88 and 99 like search-help

Former Member
0 Likes

Hi Rani,

Why dont you try this with list box.

in that only give 88 and 99.He has no other option to select othe ones.

Thanks&Regards,

Siri.

Former Member
0 Likes

Hi ,

Use the following code .

Regards,

Ankur Bhandari

Kindly appropriate reward points by clicking the star on the left of reply,if the solution is helpful.

_________________________________________________________

selection-screen.

PARAMETERS: p_idnt TYPE c DEFAULT '88' OBLIGATORY

AS LISTBOX VISIBLE LENGTH 12 USER-COMMAND list.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_idnt.

*putting the names in the list box for selection

PERFORM list_box.

----


FORM list_box .

CLEAR gw_value.

gw_value-key = gc_1.

gw_value-text = '88'.

APPEND gw_value TO gt_id.

gw_value-key = gc_2.

gw_value-text = '99'.

APPEND gw_value TO gt_id.

*this function module is used to fill list box

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = gv_id

values = gt_id.

CLEAR gw_value.

REFRESH gt_id.

ENDFORM.

Former Member
0 Likes

you did not understand me/ i want a box to popup with the values99 88

Former Member
0 Likes

Use FM POPUP_WITH_TABLE at event at selection-screen on value request . Populate itab with values required & pass this itab for this FM .

hymavathi_oruganti
Active Contributor
0 Likes

for that u can use

f4if_table_value_request or vrm_set_values as suggested above

Former Member
0 Likes

Use function module with the following values.

POPUP_TO_DECIDE_LIST

TITEL : Decide between

TEXTLINE1: Choose between

T_SPOPLI :

1 88

2 99

Regards,

Ankur Bhandari

p.s

Kindly appropriate reward points by clicking the star on the left of reply,if the solution is helpful.