01-29-2007 7:07 AM
Hi,
How can we program such that the user can only select the values from F4 help for Input field and should not be able to enter any value through key board in the input field.
Thanks & Regards,
Vinay.
01-29-2007 7:10 AM
in at selection screen output event make the input = 0 for that field.
01-29-2007 7:11 AM
Hi
make the input field as a drop down list and assign your values to the same...
taht way the user will be forced to select from the list..
-
santosh
01-29-2007 7:16 AM
As Santosh suggested you should use dropdownlist box.
demo program using dropdownlist box
RSDEMO_DROPDOWN_LISTBOX
Regards
Raja
01-29-2007 7:17 AM
You can check this demo program
DEMO_DYNPRO_DROPDOWN_LISTBOX
or u can execute the code and see if this is working for you .
************************
type-pools : vrm.
DATA: LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS: NAME(30) VISIBLE LENGTH 30 AS LISTBOX.
AT SELECTION-SCREEN OUTPUT.
VALUE-KEY = 'angp1602'.
MOVE 'angp1602' TO VALUE-TEXT.
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
MOVE 'kevinraskin' TO VALUE-TEXT.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'NAME'
VALUES = LIST.
*****************************
START-OF-SELECTION.
WRITE: / Name.
regards,
vijay.
01-29-2007 7:20 AM
Hi Vinayaka,
Please try this logic
parameter: name(20) as listbox visible length 20 obligatory.
type-pools: vrm.
data: id type vrm_id,
value type vrm_value,
values type vrm_values.
data: begin of itab occurs 0,
ersda like mara-ersda,
end of itab.
at selection-screen output.
select ersda into corresonding fields of itab from mara.
id = 'NAME'.
value-key = itab-ersda.
value-text = itab-ersda.
append value to values.
endselect.
call function vrm_set_values
exporting
id = id
values = values.
thorught the VRM_SET_VALUES u can populate the list box so u can select the values from the list box, no other valeus is not allowed.
Regards,
Sunil
01-29-2007 7:37 AM
Hi vinayaka,
check the below code
REPORT zex33 message-id zsmg .
PARAMETER :p_vbeln LIKE vbak-vbeln MODIF ID md1.
DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.
At selection-screen.
if p_vbeln ne space.
message e001(zsmg) with 'select by pressing F4'.
endif.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vbeln.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'VBAK'
fieldname = 'VBELN'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_VBELN'
TABLES
return_tab = return
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-input = '0'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
START-OF-SELECTION.