10-20-2008 7:29 AM
Hi All,
How we can set default values in PARAMETER Like
PARAMETER: P like Ztable-gendre.
When user put the cursor on the selection Box it Should get MALE
FEMALE.
Regards
Vikas
10-20-2008 7:55 AM
you just paste code REPORT ZTESTRE.
TYPE-POOLS : vrm.
DATA : it_vrm TYPE vrm_values,
x_vrm like line of it_vrm.
PARAMETER: P(10) as listbox visible length 10."Ztable-gendre
INITIALIZATION.
x_vrm-key = '1'.
x_vrm-text = 'MALE'.
APPEND x_vrm TO it_vrm.
x_vrm-key = '2'.
x_vrm-text = 'FEMALE'.
APPEND x_vrm TO it_vrm.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P'
values = it_vrm
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
10-20-2008 7:31 AM
Hi,
You can add a search help to the parameter, either by using
1. Function module :
F4IF_INT_TABLE_VALUE_REQUEST
(Check the FM documentation for how to use it), call this FM under event
at selection-screen on value request of p_parameter
2. Or by attaching a search help.
Thanks & Regards,
Navneeth K.
10-20-2008 7:32 AM
If you want to fix up some value by default to the parameter then use "Default" addition to the parameter.
10-20-2008 7:32 AM
Search SDN for function module 'VRM_SET_VALUES' for example codes.
~Eswar
10-20-2008 7:32 AM
10-20-2008 7:32 AM
Hello,
Try in this way it is working fine i have test it.
PARAMETER: s_matnr TYPE mara-matnr.
AT SELECTION-SCREEN OUTPUT.
s_matnr = '94000000001'.
10-20-2008 7:33 AM
Hi,
You can do with the help of LISTBOX.
For more details
Goto SE38 , type listbox and press F1
Thanks & Regards
10-20-2008 7:33 AM
hi Vikas,
In SE11, declare a new data element and assign the allowable values as
M = Male
F = Female
then, use your new data element for Ztable-gendre.
regards,
Peter
10-20-2008 7:40 AM
Hi Vikas,
Check the below code and do the modification according to your issue.
Copy paste and execute the code you can understand.
Type-pools: vrm.
Data: param type vrm_id,
values type vrm_values,
value like line of values.
parameters: p1 as listbox visible length 20 modif id one.
at selection-screen output.
param = 'p1'.
value-key = '1'.
value-text = 'male'.
append value to values.
value-key = '1'.
value-text = 'female'.
append value to values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = PARAM
VALUES = VALUES
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
ENDIF.
Cheers!!
Balu
10-20-2008 7:55 AM
you just paste code REPORT ZTESTRE.
TYPE-POOLS : vrm.
DATA : it_vrm TYPE vrm_values,
x_vrm like line of it_vrm.
PARAMETER: P(10) as listbox visible length 10."Ztable-gendre
INITIALIZATION.
x_vrm-key = '1'.
x_vrm-text = 'MALE'.
APPEND x_vrm TO it_vrm.
x_vrm-key = '2'.
x_vrm-text = 'FEMALE'.
APPEND x_vrm TO it_vrm.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P'
values = it_vrm
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.