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 in I/O BOX : Screen Programming.

Former Member
0 Kudos

Hi All,

I am working on creating custom infotype.

In the screen of this custom infotype.I want to change the I/O box in to listbox with default values "Group 1","Group 2"," ".So user can select one amongst those values.

How can i do it ?

Please help me out.

Regards

Mayank

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you using a selection screen or a dynpro.

Regards,

Rich Heilman

0 Kudos

If you are using a selection screen, here is some sample code.



report zrich_0005 .

type-pools: vrm.

parameters: p_group(20) type c as listbox visible length 20.

at selection-screen output.

  perform build_drop_down_list.

start-of-selection.

  write:/ p_group.

************************************************************************
* build_drop_down_list
************************************************************************
form build_drop_down_list.

  data: name type vrm_id,
        list type vrm_values,
        value like line of list.

  clear list. refresh list.
  name = 'P_GROUP'.

  value-key = 'GROUP1'.
  value-text = 'Group 1'.
  append value to list.

  value-key = 'GROUP2'.
  value-text = 'Group 2'.
  append value to list.

* Set the values
  call function 'VRM_SET_VALUES'
       exporting
            id     = name
            values = list.

endform.

Regards,

Rich Heilman

0 Kudos

If in a dynpro, its pretty much the same except you call the "build_drop_down_list" form in the PBO of the screen. Also you must make the field in screen painter a "listbox".

Regards,

Rich Heilman

0 Kudos

If these answers were helpful, please reward points accordingly. Thanks.

Regards,

Rich Heilman

0 Kudos

Hi Rich,

Thanks a Lot.It helped me.

Its working fine.

Regards,

Mayank

0 Kudos

Can you please award points accordingly and mark this post as answered. Thanks.

Regards,

Rich Heilman