Application Development 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: 

ListBox Problem

Former Member
0 Kudos

Hi,

i have the fallowing problem:

I use a listbox in my parameters selection and fill it with 14 values. If i select a value-key greater or equas 10, the selection does not work. The app creates a new line and switches to GR01.

When i remove the user-command statement, the code works. But i need this user-command statement

Can me help anyone ?

REPORT Z_TEST_24.
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF list.
TABLES: sscrfields.
SELECTION-SCREEN BEGIN OF lINE.

    SELECTION-SCREEN COMMENT (30) b1_com .

    PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND ABC.

SELECTION-SCREEN END OF lINE.
INITIALIZATION.
name = 'PS_PARM'.
value-key = '21'. value-text = 'GR01'. APPEND value TO list.
value-key = '2'. value-text = 'GR02'. APPEND value TO list.
value-key = '3'. value-text = 'GR03'. APPEND value TO list.
value-key = '4'. value-text = 'GR04'. APPEND value TO list.
value-key = '5'. value-text = 'GR05'. APPEND value TO list.
value-key '6'. value-text = 'GR06'. APPEND value TO list.
value-key = '7'. value-text = 'GR07'. APPEND value TO list.
value-key = '8'. value-text = 'GR08'. APPEND value TO list.
value-key = '9'. value-text = 'GR09'. APPEND value TO list.
value-key = '10'. value-text = 'GR10'. APPEND value TO list.
value-key = '11'. value-text = 'GR11'. APPEND value TO list.
value-key = '12'. value-text = 'GR12'. APPEND value TO list.
value-key = '13'. value-text = 'GR13'. APPEND value TO list.
value-key '14'. value-text = 'GR13'. APPEND value TO list.

b1_com = 'Group'.
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING id = name
            values = list.
IF sscrfields-ucomm = 'ABC'.
    WRITE '???'.
ENDIF.

START-OF-SELECTION.

WRITE: / 'Parameter:', ps_parm.

Marco

5 REPLIES 5

former_member215344
Contributor
0 Kudos

Hi Marco,

You can create a domain with required fixed values in the required order and then declare parameters as below:

PARAMETERS: ps_parm TYPE ZDATAELEMENT AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND ABC.

Here ZDATAELEMENT refers to your Z domain. Also remove the VRM_SET_VALUES code.

Thanks,

Ajay Bose

0 Kudos

Hi,

please help me one more. I do not know what to do.

0 Kudos

Hi

You need to use a parameter long 2 char

SELECTION-SCREEN COMMENT (30) B1_COM .

*PARAMETERS: PS_PARM AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND ABC.

PARAMETERS: PS_PARM TYPE CHAR02

                       AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND ABC.

SELECTION-SCREEN END OF LINE.

Max

0 Kudos

Hi Marco,

Since you have not used any type specification while creating parameters, system is considering it as default length of '1' and hence it is not accepting double digit values as input. Either proceed as I suggested or do as Max has suggested.

Thanks,

Ajay Bose

0 Kudos

Hi Max, Hi Ajay. Thanks a lot. I could use the solution of Max.