How to use BAPI in SAP ABAP Reports ?

Uisng BAPI to generate reports, calling BAPI function module in SAP ABAP programs

+ -

BAPI can be used in report development, in the example program we will develop a report to display material basic details for a material input.

To get material details for a material we use BAPI_MATERIAL_GET_DETAIL (go to SE37 check).

Go to SE38, create a program ZSAPN_BAPI_MATERIAL, save it in a local object.

REPORT ZSAPN_BAPI_MATERIAL.
PARAMETERS: P_MATNR TYPE MARA-MATNR.
DATA : MAT_DATA TYPE BAPIMATDOA.

START-OF-SELECTION.
  CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL' "get material details
    EXPORTING
      MATERIAL              = P_MATNR
*     PLANT                 =
*     VALUATIONAREA         =
*     VALUATIONTYPE         =
*     MATERIAL_EVG          =
    IMPORTING
      MATERIAL_GENERAL_DATA = MAT_DATA
*     RETURN                =
*     MATERIALPLANTDATA     =
*     MATERIALVALUATIONDATA =
    .
  WRITE: / MAT_DATA-MATL_DESC, MAT_DATA-MATL_TYPE, MAT_DATA-IND_SECTOR, MAT_DATA-MATL_GROUP.

Execute the above program and test.

Similarly create some example programs to display customer details (use BAPI_CUSTOMER_GETDETAIL2), display vendor details (use BAPI_VENDOR_GETDETAIL) etc.

Learner Questions


No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 45 People out of 46 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →