Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with Dropdown in Screen Programming

Former Member
0 Likes
863

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

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
626

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.

3 REPLIES 3
Read only

Former Member
0 Likes
626

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

Read only

vinod_vemuru2
Active Contributor
0 Likes
628

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.

Read only

Former Member
0 Likes
626

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.