2006 Dec 11 10:17 PM
How can we set a mandatory and default value for list box.
2006 Dec 11 10:24 PM
Hi,
is it dialog programming screen or in report selection-screen..
Thanks,
Naren
2006 Dec 11 10:30 PM
report selection screen
PARAMETERS : A(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.
even called the function VRM_SET_VALUES just want to make it mandatory and set the first value as the default value.
2006 Dec 11 10:36 PM
Hi,
Check this example..
TYPE-POOLS: vrm.
PARAMETERS: p_test TYPE char4 AS LISTBOX VISIBLE LENGTH 10.
DATA: t_data TYPE vrm_values.
INITIALIZATION.
DATA: s_data TYPE vrm_value.
s_data-key = 'ABCD'.
s_data-text = 'First four'.
APPEND s_data TO t_data.
s_data-key = 'EFGHI'.
s_data-text = 'Second four'.
APPEND s_data TO t_data.
<b>* Set the default value.
READ TABLE t_data INTO s_data INDEX 1.
p_test = s_data-key.</b>
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_TEST'
values = t_data
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
<b>AT SELECTION-SCREEN.
IF p_test IS INITIAL.
MESSAGE e208(00) WITH 'Parameter mandatory'.
ENDIF.</b>
START-OF-SELECTION.
WRITE: / p_test.
THanks,
Naren
2006 Dec 13 6:45 AM
for defaulting a value you cansimply use
PARAMETERS : A(10) TYPE c AS LISTBOX VISIBLE LENGTH 10 DEFAULT 'A' .
(where A is the key of the entry in values list)
Regards
Raja
2006 Dec 13 9:15 AM
Hi,
Module pool programming:
Directly hot code the list box name = 'default value' at PBO event.
Report programming:
PARAMETERS : LIST(10) TYPE C AS LISTBOX VISIBLE LENGTH 20 DEFAULT 'XYZ' .
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |