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 in modulepoll program

Former Member
0 Likes
625

hi

how can i get dropdown box for in put/out put feald in modulepool program

6 REPLIES 6
Read only

Former Member
0 Likes
597

sreekanth chowdary,

See the follwoing example program in SE38.

DEMO_DYNPRO_DROPDOWN_LISTBOX.

See the following links for more clarity

http://www.saptechies.com/in-a-modulepool-how-to-set-drop-down-list/

Regards,

MAHI.

Read only

0 Likes
597

Hi,

You have to define a text field, and in the properties there is a dropdown option. you have to specify it as 'listbox'.

If you want to pass values to it, you can use the function module 'VRM_SET_VALUES'.

-Pavan

Read only

Former Member
0 Likes
597

Extention of my previous rly.

Use the following code to add values in drop down box

*----------------------------------------------------------------------*
* TYPE-POOLS                                                           *
*----------------------------------------------------------------------*
TYPE-POOLS:
  vrm.                                 " Value Request Manager

Data:
* To hold quarter details, these details are used to display in list box of
* the parameter called Quarter in the selection screen.
  t_quarters TYPE vrm_values.

Parameters:
  p_quat  TYPE char20
            AS LISTBOX VISIBLE LENGTH 30
            LOWER CASE OBLIGATORY.

*----------------------------------------------------------------------*
*              AT SELECTION-SCREEN ON VALUE-REQUEST                    *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_quat.

  PERFORM fill_quarters.
  PERFORM display_quarters.


*&---------------------------------------------------------------------*
*&      Form  fill_quarters
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM fill_quarters .

  DATA:
* Field string to fill quarters in the year
    lfs_quarters TYPE LINE OF vrm_values.

  REFRESH t_quarters.

  lfs_quarters-key  = '1'.
  lfs_quarters-text = text-qu1.
  APPEND lfs_quarters TO t_quarters.

  lfs_quarters-key  = '2'.
  lfs_quarters-text = text-qu2.
  APPEND lfs_quarters TO t_quarters.

  lfs_quarters-key  = '3'.
  lfs_quarters-text = text-qu3.
  APPEND lfs_quarters TO t_quarters.

  lfs_quarters-key  = '4'.
  lfs_quarters-text = text-qu4.
  APPEND lfs_quarters TO t_quarters.


ENDFORM.                    " fill_quarters

*&---------------------------------------------------------------------*
*&      Form  display_quarters
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM display_quarters .

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'P_QUAT'
      values          = t_quarters[]
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.

  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


ENDFORM.                    " display_quarters

Regards,

Mahi.

Read only

0 Likes
597

Hi,

Assign function code to IO field.

and use the function module VRM_SET_VALUES.

Read only

Former Member
0 Likes
597

HELLO chowdary,

follow this link ....

http://sap.niraj.tripod.com/id38.html

Regards,

Syam.

Read only

former_member787646
Contributor
0 Likes
597

Hi

In Dialog programming select the i/o field and in the Attributes check on the Dropdown checkbox (F2 key for attributes).

Hope it helps.

Murthy