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 for executable program

Former Member
0 Likes
628

Hi All,

i am providing a drop down box for a selection field for an executable program by using VRM_SET values.But its not displaying the drop down box.Plz let me know the solution.

FORM drop_down.

TYPES : BEGIN OF l_s_help,

werks TYPE werks_d,

pspid TYPE ps_pspid,

descr(80) TYPE c,

END OF l_s_help.

DATA : l_t_template TYPE TABLE OF vrm_value .

DATA : l_r_template TYPE vrm_value.

DATA : l_t_help TYPE TABLE OF l_s_help.

DATA : l_r_help TYPE l_s_help.

SELECT werks pspid descr FROM /rb04/yt3_plant INTO TABLE l_t_help.

LOOP AT l_t_help INTO l_r_help.

MOVE l_r_help-descr TO l_r_template-key.

APPEND l_r_template TO l_t_template.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'PRD_TEMP'

values = l_t_template

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. " drop_down

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
602

Hi,

Check the program: demo_dynpro_dropdown_listbox

Regards

Kannaiah

4 REPLIES 4
Read only

Former Member
0 Likes
603

Hi,

Check the program: demo_dynpro_dropdown_listbox

Regards

Kannaiah

Read only

Former Member
0 Likes
602

Hi,

Try to compare with this std prog

' RSDEMO_DROPDOWN_LISTBOX'

Hope this helps

Regds

Seema

Read only

Former Member
0 Likes
602

Hi,

Check the below code.

parameters: p_list as listbox visible length 20 obligatory.

initialization.

type-pools vrm.

data: v_id type vrm_id,

i_list type vrm_values,

wa_list like line of i_list.

v_id = 'P_LIST'.

wa_list-key = '1'.

wa_list-text = 'India'.

append wa_list to i_list.

wa_list-key = '2'.

wa_list-text = 'China'.

append wa_list to i_list.

wa_list-key = '3'.

wa_list-text = 'Japan'.

append wa_list to i_list.

p_list = '3'. "this is to set the default value of the list box.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = v_id

values = i_list

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.

Read only

Former Member
0 Likes
602

Hi Rakesh,

Change your code in the below manner. You will surely get the required format of output.

Split your code in this format :

******************************************************************

  • Data Declarations

TYPES : BEGIN OF l_s_help,

werks TYPE werks_d,

pspid TYPE ps_pspid,

descr(80) TYPE c,

END OF l_s_help.

DATA : l_t_template TYPE TABLE OF vrm_value .

DATA : l_r_template TYPE vrm_value.

DATA : l_t_help TYPE TABLE OF l_s_help.

DATA : l_r_help TYPE l_s_help.

  • * INITIALIZATION* Event

INITIALIZATION.

SELECT werks pspid descr FROM /rb04/yt3_plant INTO TABLE l_t_help.

  • AT SELECTION-SCREEN OUTPUT Event

AT SELECTION-SCREEN OUTPUT.

LOOP AT l_t_help INTO l_r_help.

MOVE l_r_help-descr TO l_r_template-key.

APPEND l_r_template TO l_t_template.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'PRD_TEMP'

values = l_t_template

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.

********************************************************************

Hope this is helpful to you. If you need further information, revert back.

Reward all the helpful answers.

Regards

Nagaraj T