‎2008 Jul 18 2:32 PM
Hi All,
I have created a drop down list in Additional Screen B for transaction VA02.
The screen field which i added is Zfield (ZPERCENTAGE)added to VBAK and has its own check table with values maintained like 12.35, 15.68, 25.01, etc....
Using the entries from the check table, these are populated in the drop down.
Now the problem is, the drop down is showing 2 columns, one as KEY and the other as TEXT.
The KEY value is not showing any decimal values but that is the actual one stored in the database.
Can anyone please help me in showing the drop down with decimals.
Regards,
Harish Kalla
‎2008 Jul 18 3:01 PM
Hi Harish,
It will display decimal values too. Check below sample code.
Probably u have to change user settings.
PARAMETERS: po_name(30) TYPE c VISIBLE LENGTH 20 AS LISTBOX.
TYPE-POOLS: vrm.
DATA: i_values TYPE vrm_values,
wa_values LIKE LINE OF i_values.
AT SELECTION-SCREEN OUTPUT.
wa_values-key = '1.1'.
wa_values-text = 'Vinod'.
APPEND wa_values TO i_values.
wa_values-key = '2.2'.
wa_values-text = 'Kumar'.
APPEND wa_values TO i_values.
wa_values-key = '3.3'.
wa_values-text = 'Reddy'.
APPEND wa_values TO i_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'PO_NAME'
values = i_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
START-OF-SELECTION.
READ TABLE i_values INTO wa_values WITH KEY key = po_name.
MOVE wa_values-text TO po_name.
If ur code is inline with above code then check this.
In tool bar there will be 3 colored icon beside help. Click on
that, Options=>Here select the tab expert. Now check the
check box Show keys in all drop down lists and save.
Thanks,
Vinod.
‎2008 Jul 18 2:53 PM
check the view that displays your matchcode if it is the same type as database field
also check the screen field properties
Edited by: Sriram Chandran on Jul 18, 2008 2:53 PM
‎2008 Jul 18 3:01 PM
Hi Harish,
It will display decimal values too. Check below sample code.
Probably u have to change user settings.
PARAMETERS: po_name(30) TYPE c VISIBLE LENGTH 20 AS LISTBOX.
TYPE-POOLS: vrm.
DATA: i_values TYPE vrm_values,
wa_values LIKE LINE OF i_values.
AT SELECTION-SCREEN OUTPUT.
wa_values-key = '1.1'.
wa_values-text = 'Vinod'.
APPEND wa_values TO i_values.
wa_values-key = '2.2'.
wa_values-text = 'Kumar'.
APPEND wa_values TO i_values.
wa_values-key = '3.3'.
wa_values-text = 'Reddy'.
APPEND wa_values TO i_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'PO_NAME'
values = i_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
START-OF-SELECTION.
READ TABLE i_values INTO wa_values WITH KEY key = po_name.
MOVE wa_values-text TO po_name.
If ur code is inline with above code then check this.
In tool bar there will be 3 colored icon beside help. Click on
that, Options=>Here select the tab expert. Now check the
check box Show keys in all drop down lists and save.
Thanks,
Vinod.
‎2008 Jul 18 3:13 PM
Check the sample accordingly you proceed in the PBO while populating the Drop down list box fields
REPORT ztest_drop_down.
TYPE-POOLS: vrm.
DATA: vrmval TYPE vrm_values,
vmr LIKE LINE OF vrmval.
*data: p_menge type menge.
PARAMETERS: p_menge AS LISTBOX VISIBLE LENGTH 10.
INITIALIZATION.
vmr-key = '10.003'.
vmr-text = '10.003'.
APPEND vmr TO vrmval.
vmr-key = '16.003'.
vmr-text = '16.003'.
APPEND vmr TO vrmval.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_MENGE'
values = vrmval
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.