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 menu

Former Member
0 Likes
621

hey hi.... im new learner for sap abap..... can some one help me to do dropdown menu... usually it will take from data dictionary.. but in my kes i have to create subjects and make it appear in drop down menu...

thank u .....

3 REPLIES 3
Read only

Former Member
0 Likes
531

Hi Suguna

At program level, to make drop down menu, we've to code 'SET PF-STATUS 'ZMENU'.

Here by double-click the zmenu, it'll show menu screen with options. There we've to save the required objects and activate it.

But u say something about dictionary that i didn't get.

For further queries on this issue, feel free to contact me.

If it helpful to u, reward me plz.

Thanks

Suren

Read only

Former Member
0 Likes
531

You can try the below for your parameter

DATA: BEGIN OF i_kschl OCCURS 0,

kschl LIKE a993-kschl,

END OF i_kschl.

Parameter pkschl LIKE a993-kschl.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pkschl.

REFRESH i_kschl.

i_kschl-kschl = 'ZPTK'.

APPEND i_kschl.

i_kschl-kschl = 'ZPIC'.

APPEND i_kschl.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'KSCHL'

dynpprog = 'ZREPORT'

dynpnr = '1000'

dynprofield = 'PKSCHL'

value_org = 'S'

TABLES

value_tab = i_kschl.

Read only

Former Member
0 Likes
531

Hi,

Check the below code:

selection-screen begin of block b1 with frame.
parameters p_dep(20) as listbox visible length 15
 default 'IT' obligatory.
selection-screen end of block b1.

at selection-screen output.
type-pools : vrm.

types : begin of tp_dep,
dep(20),
end of tp_dep.

data : my_list type vrm_values,
       value like line of my_list.

data : ig_dep type standard table of tp_dep,
       wg_dep type tp_dep.

clear wg_dep.
wg_dep-dep = 'MECH'.
append wg_dep to ig_dep.

clear wg_dep.
wg_dep-dep = 'EEE'.
append wg_dep to ig_dep.

clear wg_dep.
wg_dep-dep = 'ECE'.
append wg_dep to ig_dep.

clear wg_dep.
wg_dep-dep = 'CSE'.
append wg_dep to ig_dep.

loop at ig_dep into wg_dep.
value-key = sy-tabix.
value-text = wg_dep-dep.
append value to my_list.

CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING
    id                    = 'P_DEP'
    values                = MY_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.

endloop.

Regards,

Raghu