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

Former Member
0 Kudos

Hi Guys,

I defined parameter as list box.

and i need put 2 values in that list box.

Which Event can i use.

In intialization How can I write code to set values.

Thanks,Rayeez

4 REPLIES 4

Former Member
0 Kudos

Hi,

Use FM 'VRM_SET_VALUES' to achieve your functionality.

Regards,

Tarun

Former Member
0 Kudos

Hi rayeezuddin,

1. simple

2. we can use INITIALIZATION event also.

3. just copy paste to get a taste of it.

4.

REPORT abc.

TYPE-POOLS : vrm.

DATA : v TYPE vrm_values.

DATA : vw LIKE LINE OF v.

PARAMETERS : a(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.

INITIALIZATION.

vw-key = '1'.

vw-text = 'Jan'.

APPEND vw TO v.

vw-key = '2'.

vw-text = 'Feb'.

APPEND vw TO v.

vw-key = '3'.

vw-text = 'Mar'.

APPEND vw TO v.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'A'

values = v

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

regards,

amit m.

Former Member
0 Kudos

Hi Rayeez,

You can do it in PBO event ie. AT SELECTION-SCREEN OUTPUT event in selection screen.

Just append those values to an internal table and call the FM VRM_SET_VALUES to show it in listbox.

You can refer this link also...

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

This link explains the case for a screen. But you can modify it to make it in selection-screen also.

Regards,

SP.

Former Member
0 Kudos

You could see demo programs <b>DEMO_DYNPRO_DROPDOWN_LISTBOX</b> <b>RSDEMO_DROPDOWN_LISTBOX</b>

or see the code below

REPORT zmytestvrm
       NO STANDARD PAGE HEADING.
 
 
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF
list.
 
 
PARAMETERS: r1  RADIOBUTTON GROUP rg1 USER-COMMAND abc DEFAULT 'X',
            r2  RADIOBUTTON GROUP rg1 .
PARAMETERS: p_obj(1) AS LISTBOX VISIBLE LENGTH 50 .
 
 
AT SELECTION-SCREEN OUTPUT .
 
  IF r1 EQ 'X' .
    CLEAR list .
    CLEAR name .
 
    REFRESH list .
    name = 'P_OBJ'.
    value-key = 'A'. value-text = 'This is A'.
    APPEND value TO list .
 
    value-key = 'B'. value-text = 'This is B'. APPEND value TO
  list .
 
 
    value-key = 'C'. value-text =
    'This is C'.
    APPEND value TO list .
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        id     = name
        values = list.
 
 
  ELSEIF r2 EQ 'X' .
    CLEAR list .
    CLEAR name .
 
    REFRESH list .
    name = 'P_OBJ'.
    value-key = '1'. value-text = 'This is 1'.
    APPEND value TO list .
 
    value-key = '2'. value-text = 'This is 2'. APPEND value TO
  list .
 
 
    value-key = '3'. value-text =
    'This is 3'.
    APPEND value TO list .
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        id     = name
        values = list.
  
  ENDIF .

rgds,

TM