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

About DropDown List

Former Member
0 Likes
506

Hai gurus, I am new to abap.

I had one table : zemp and some fields eid ename salary

now i am using module pool program

and I wants to a dropdown list for eid , how can i set drop down for that eid takes data

from datadictionary...

please help me........

4 REPLIES 4
Read only

Former Member
0 Likes
472

for getting drop down box on screen you need to use the following function module:

F4IF_INT_TABLE_VALUE_REQUEST

Read only

Former Member
0 Likes
472

Hi

See the sample code

REPORT Ztest_HELP .

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_MATNR(10) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR

FROM MARA

INTO TABLE ITAB

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATERIAL NUMBER'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

or you can use the fun module VRM_SET_VALUES

REPORT zwa_test2.

TYPE-POOLS : vrm.

tables: bkpf.

DATA : values TYPE vrm_values.

DATA : wa LIKE LINE OF values.

PARAMETERS : list_box(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.

PARAMETERS: dd type bkpf-BSTAT user-command abc.

select-options: a for bkpf-bukrs MODIF ID buk.

select-options: b for bkpf-belnr MODIF ID SEL.

at selection-screen output.

If list_box = 2.

loop at screen.

if screen-group1 = 'SEL'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

INITIALIZATION.

wa-key = '1'.

wa-text = 'Orange'.

APPEND wa TO values.

wa-key = '2'.

wa-text = 'Red'.

APPEND wa TO values.

wa-key = '3'.

wa-text = 'Blue'.

APPEND wa TO values.

wa-key = '4'.

wa-text = 'Gray'.

APPEND wa TO values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'LIST_BOX'

values = values

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

Ref Program: DEMO_DROPDOWN_LIST_BOX

Link:

Regards

Anji

Read only

Former Member
0 Likes
472

Hi

You will have to use FM 'VRM_SET_VALUES' in PBO.

TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS: P_COUNTRY(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'P_COUNTRY'.

VALUE-KEY = '1'.

VALUE-TEXT = 'India'.

APPEND VALUE TO LIST.

VALUE-KEY = '2'.

VALUE-TEXT = 'USA'.

APPEND VALUE TO LIST.

.

.

.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.

Regards

Navneet

Read only

Former Member
0 Likes
472

Hi,

While creating a screen field when you associate the field with some standard field from table (eg. you give name to the field as zemp-eid), then in the element attributes-->in Dict. check the 'FRM DICT' check box.

Below the element name field you will see somthing as 'DROPDOWN'.

By changing this to list box you can make your field on screen as dropdown field taking emp. IDs from table zemp.

Deserve Reward.

Gaurav.