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

Listbox for Select Options

Former Member
0 Likes
2,041

Hi All,

I have a requirement to have the field Order Reason (VBAK-AUGRU) in the selection screen. The problem is, the user wants it to be set-up similar to the field in the sales order. I can do it, but it is only a parameter, not a select-options. IS it possibel to create a list box in the selection screen with select options?

Thanks,

Jim

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
868

Hello.

Thanks for your replies. But I need the selection-screen to be a range value with list box.

Thanks,

Jim

6 REPLIES 6
Read only

Former Member
0 Likes
868

Hi,

Define like this.

PARAMETERS: p_augru LIKE vbak-augru VISIBLE LENGTH 10 AS LISTBOX.

If your description is long and you can not see whole description for some of the values, just increase the value of VISIBLE LENGTH accordingly.

The maximum of description for "order reason" is 40 character. You can define VISIBLE LENGTH as '40' if you are not sure if in future there will be description of lenght '40'

PARAMETERS: p_augru LIKE vbak-augru VISIBLE LENGTH 40 AS LISTBOX.

Let me know if you have nay question.

Regards,

RS

Read only

Former Member
0 Likes
868

hi,

just check this code..

TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'PS_PARM'.

VALUE-KEY = '1'.

VALUE-TEXT = 'LINE 1'.

APPEND VALUE TO LIST. VALUE-KEY = '2'.

VALUE-TEXT = 'LINE 2'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.

START-OF-SELECTION.

WRITE: / 'PARAMETER:', PS_PARM.

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
869

Hello.

Thanks for your replies. But I need the selection-screen to be a range value with list box.

Thanks,

Jim

Read only

0 Likes
868

Hi,

What do you mean by "range value with list box"?

Please clarify.

Regards,

RS

Read only

0 Likes
868

You can do it like this. You can't use SELECT-OPTIONS, but you can use the PARAMETERS.



tables: vbak.

ranges: r_augru for vbak-augru.

selection-screen begin of line.
selection-screen comment 1(15) label.
parameters: p_augrul like vbak-augru visible length 10 as listbox.
selection-screen comment 40(15) to.
parameters: p_augruh like vbak-augru visible length 10 as listbox.
selection-screen end of line.

at selection-screen output.
  label = 'Order Reason'.
  to  = 'To'.


start-of-selection.

  r_augru-sign = 'I'.
  if p_augruh is initial.
    r_augru-option = 'EQ'.
  else.
    r_augru-option = 'BT'.
  endif.
  if p_augrul is initial.
    r_augru-low  = p_augrul.
  endif.
  if p_augruh is initial.
    r_augru-high = p_augruh.
  endif.
  append r_augru.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
868

hi,

LIST BOX with Selection Screen

For this the FM VRM_SET_VALUES is used to fill the value table and is passed to the parameter created with TYPE LISTBOX in the selection screen event

AT SELECTION-SCREEN.

PROGRAM zlist

TYPE-POOLS : VRM.

DATA: param TYPE vrm_id,

values TYPE vrm_values,

value LIKE LINE OF values.

PARAMETERS: p_name(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

param = 'P_NAME'.

value-key = '1'.

value-text = 'JOHN'.

APPEND value TO values.

value-key = '2'.

value-text = 'PETER'.

APPEND value TO values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING id = param

values = values.

regards,

keerthi