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

Dropdown box

Former Member
0 Likes
1,094

hi frnd's.

whether we can add a value to a dropdown box at run time.

I had done by selecting from a dropdownbox with available datas.

5 REPLIES 5
Read only

Former Member
0 Likes
774

Hi Suganya,

Please check this program

<b>demo_dynpro_dropdown_listbox</b> .

This will surely solve your problem.

Cheers

Sunny

Rewrd points, if found helpful

Read only

Former Member
0 Likes
774

Hello Suganya,

You can add values to a drop down dynamically, if it is populated in your program (i.e., the values do not come directly from the DDIC through the fixed values etc.,).

Look for similar posts in this forum. This has been discussed a lot in the past. The function module you need to use is VRM_SET_VALUES. I believe it's very well documented.

Regards,

anand Mandalika.

Read only

Former Member
0 Likes
774

Hi Suganya,

This topic has already been discussed in the forum.

Anyway, the solution is like this.

In selection screens , the code is as follows:

REPORT ZSHAIL_DROP_NEW .

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.

In this example two values will be entered in to the listbox at runtime.

Hope ur query is answered.

Regards,

Sylendra.

Read only

Former Member
0 Likes
774

Hi,

you can do that based on selection pass the different values to the FM VRM_SET_VALUES.

Regards

Vjay

Read only

Former Member
0 Likes
774
REPORT ychatest.
TYPE-POOLS: vrm.
DATA: ivrm_values TYPE vrm_values.
DATA: xvrm_values LIKE LINE OF ivrm_values.
DATA: name TYPE vrm_id.
PARAMETERS: p_month AS LISTBOX VISIBLE LENGTH 10.
PARAMETERS: p_year AS LISTBOX VISIBLE LENGTH 4.

AT SELECTION-SCREEN OUTPUT.
  name = 'P_MONTH'.
  REFRESH ivrm_values.
  xvrm_values-key = '1'.
  xvrm_values-text = 'January'.
  APPEND xvrm_values TO ivrm_values.
  xvrm_values-key = '2'.
  xvrm_values-text = 'February'.
  APPEND xvrm_values TO ivrm_values.
  xvrm_values-key = '2'.
  xvrm_values-text = 'March'.  APPEND xvrm_values
 TO ivrm_values.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = name
      values = ivrm_values.
  name = 'P_YEAR'.
  REFRESH ivrm_values.
  xvrm_values-key = '2001'.
  xvrm_values-text = '2001'.
  APPEND xvrm_values TO ivrm_values.
  xvrm_values-key = '2002'.
  xvrm_values-text = '2002'.
  APPEND xvrm_values TO ivrm_values.
  xvrm_values-key = '2003'.
  xvrm_values-text = '2003'.
  APPEND xvrm_values TO ivrm_values.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = name
      values = ivrm_values.