Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Drop Down list in a report program

Hi,

We have a requirement wherin we need to have three drop down lists( i.e., shirt size, color and neck type) and we need to select data from the different standard tables. It is to be done in a report.

Any pointers regarding this would be helpful.

Regards,

Amrita.

Tags:
Former Member
Former Member replied

Hi,

Check the following code:

TYPE-POOLS : vrm.

TABLES:vbak,vbap.

DATA : v(80) TYPE c.

DATA: wa_vbak TYPE vbak,

it_vbak TYPE vbak OCCURS 0 WITH HEADER LINE,

wa_vbap TYPE vbap,

it_vbap TYPE vbap OCCURS 0 WITH HEADER LINE.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values ,

v_count TYPE i,

l_value LIKE LINE OF li_list.

PARAMETERS: p_test(20) AS LISTBOX VISIBLE LENGTH 60 MODIF ID DAT.

INITIALIZATION.

AT SELECTION-SCREEN OUTPUT.

PERFORM get_data.

LOOP AT it_vbak.

l_value-key = it_vbak-vbeln .

l_value-text = it_vbak-vbeln .

APPEND l_value TO li_list.

ENDLOOP.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'P_TEST'

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

AT SELECTION-SCREEN ON P_TEST.

clear : li_list , li_list[].

SELECT vbeln

matnr

meins

FROM vbap

INTO CORRESPONDING FIELDS OF TABLE it_vbap

WHERE vbeln = p_test.

START-OF-SELECTION.

SELECT vbeln

matnr

meins

FROM vbap

INTO CORRESPONDING FIELDS OF TABLE it_vbap

WHERE vbeln = p_test.

LOOP AT it_vbap.

WRITE :/ it_vbap-vbeln, it_vbap-matnr,it_vbap-meins.

ENDLOOP.

&----


*& Form get_Data

&----


  • text

----


FORM get_data .

SELECT vbeln

FROM vbak

INTO CORRESPONDING FIELDS OF TABLE it_vbak.

ENDFORM. " get_Data

Regards,

Bhaskar

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question