on ‎2006 Feb 02 10:59 AM
i have a parameter called zzzzz
i want that the user can chosse only '99' and '88'
how i do it?
thanks.
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.