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

Drop down option in the development

Former Member
0 Likes
897

Dear Friends,

I would like to give a drop down option to one field. The values in the drop down are needed to be appeared from one Ztable field. For example in standard Tcode MM01 - Industry sector or material type can be selected through drop down. Similarly to this I want to use in my development. Please suggest me..how we can achieve this. What is the command for this.

Regards,

Suresh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
801

If you want drop down for a field for your own screen field then just go to layout of screen painter and click that field input/output button ,,now you will get one dailog box within this you have one option called dropdown...just select this and below you have searchhelp give your ztable in that...thats it.

Reward if it helpful.

Dara.

If you want drop down for a field for your own screen field then just go to layout of screen painter and click that field input/output button ,,now you will get one dailog box within this you have one option called dropdown...just select this and below you have searchhelp give your ztable in that...thats it.

Reward if it helpful.

Dara.

3 REPLIES 3
Read only

Former Member
0 Likes
802

If you want drop down for a field for your own screen field then just go to layout of screen painter and click that field input/output button ,,now you will get one dailog box within this you have one option called dropdown...just select this and below you have searchhelp give your ztable in that...thats it.

Reward if it helpful.

Dara.

Read only

Former Member
0 Likes
801

Use this: CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' for search help for your drop down list.

Read only

venkat_o
Active Contributor
0 Likes
801

Hi Suresh, To get Drop Drown Box on screen . Follow these steps. 1.Go to T.Code SE51 and Select Laypout for the Screen. 2.Double click on the field for which u want Dropdown box. 3.Then U will see Name ,Text ,DROPDOWN.Click on that and select List Box or ListBox with key . Better to to select first one. 4.Save and Activate ur screen . 5.Enter the following piece of code in the PBO of the screen.(Change for ur requirement).

TYPE-POOLS :vrm.
DATA:
  i_natio TYPE vrm_values, "-->Table that is passed through FM vrm_set_values
  w_natio LIKE LINE OF i_natio.
 
DATA: 
BEGIN OF i_t005t OCCURS 0,
    land1 TYPE t005t-land1,
    natio TYPE t005t-natio,
END OF i_t005t.

IF i_t005t[] IS INITIAL.
  SELECT land1 natio
     FROM t005t
       INTO TABLE i_t005t
   WHERE spras = sy-langu.
  IF sy-subrc = 0.
  LOOP AT i_t005t .
      w_natio-key = i_t005t-land1.
      w_natio-text = i_t005t-natio.
      APPEND w_natio TO i_natio.
      CLEAR w_natio.
  ENDLOOP.
  ENDIF.
ENDIF.

CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
                       id = 'I_IT0002-NATIO' "-->Field for which dropdown is needed.
                values = i_natio
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.
6.Observe the above code and change as for ur requirement. I hope that it helps u . Regards, Venkat.O