F How to call Database View from ABAP Report | CodeTheta

How to call Database View from ABAP Report


Database view name - ZVP_DB_VIEW
Following fields will be available in ZVP_DB_VIEW.
NAME1
KUNNR
NAME1
ORT01
PSTLZ
REGIO
VBELN
ERDAT
ERZET
ANGDT

Code :
REPORT ZVP_DATABASE_VIEW_CALL.

DATA: ZVIEW_IT TYPE TABLE OF ZVP_DB_VIEW,
            ZVIEW_WA TYPE ZVP_DB_VIEW.

START-OF-SELECTION.
SELECT * FROM ZVP_DB_VIEW INTO TABLE ZVIEW_IT UP TO 50 ROWS.

LOOP AT ZVIEW_IT INTO ZVIEW_WA.
WRITE:/ ZVIEW_WA-NAME1,
        ZVIEW_WA-KUNNR,
        ZVIEW_WA-NAME1,
        ZVIEW_WA-ORT01,
        ZVIEW_WA-PSTLZ,
        ZVIEW_WA-REGIO,
        ZVIEW_WA-VBELN,
        ZVIEW_WA-ERDAT,
        ZVIEW_WA-ERZET,
        ZVIEW_WA-ANGDT.
ENDLOOP.

Output :


IDE Used To Test This Code : ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us.We will reply you as soon as possible.

Post a Comment