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: 

Default value for a dropdown listbox

rainer_hbenthal
Active Contributor
0 Kudos
512

Hi,

i placed a dropdown listbox on a dynpro and i'm filling the possible values in the PBO using FM VRM_FILL_VALIUES. But how do i set the default value?

//Rainer

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos
103

hi Rainer,

very simple:

PARAMETERS : p_druck TYPE zdruc-druck OBLIGATORY

<b>DEFAULT '01'</b> USER-COMMAND lb01

AS LISTBOX VISIBLE LENGTH 40,

ec

8 REPLIES 8

JozsefSzikszai
Active Contributor
0 Kudos
104

hi Rainer,

very simple:

PARAMETERS : p_druck TYPE zdruc-druck OBLIGATORY

<b>DEFAULT '01'</b> USER-COMMAND lb01

AS LISTBOX VISIBLE LENGTH 40,

ec

0 Kudos
103

Thanks, works fine for report with a selection screen, but i have a dynpro and therefore no parameter clause.

0 Kudos
103

Declare a variable with the same name as the dropdown box in TOP INCLUDE. And then, in the PBO module set the default value you want to this variable. Hope this helps.

0 Kudos
103

Hi Rainer ,

In the PBO afte the FM has been called assign the default value to the screen parameter.

I feel this should work.

Regards

ARUN

0 Kudos
103

Hi ..

For Eg:

The Listbox field in the Screen Painter is MARA-MTART.

Then to Populate a Default value.

1) Declare the Global variable in the Program. Top include:

TABLES MARA.

2) In the PBO module called from the Screen put a Default value in this variable.

MARA-MTART = 'ROH'.

This value appears as default value in Checkbox.

Or in the Screen Painter :

Open the attributes of the Listbox

Enter the Default value in the TEXT attribute..

reward if Helpful.

Former Member
0 Kudos
103

hi,

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.

if helpful reward some points.

with regards,

Suresh Aluri.

rainer_hbenthal
Active Contributor
0 Kudos
103

Hi thanks, works fine. Is there any chance of getting rid of the empty line in the selection values? It seems t be there by default but rather to have an empty line would prefer something like "0 None".

0 Kudos
103

U've to make the parameter as <b>OBLIGATORY</b> to get rid of the empty line.