Thursday, June 12, 2008

SAP BAPI List of BAPIS in the System

SAP BAPI List of BAPIS in the System

To get a list of all the BAPIs in the system the following BAPI can be used.

BAPI_MONITOR_GETLIST
____________________________

The following Parameters should be passed to the above mentioned BAPI

Object type
Release /Reference Release to Display
Display Potential BAPIs
Display New BAPIs in Release
Display BAPIs from Previous Releases
Release Status of BAPIs
Release Status of Function Modules
________________________________________________________________

The BAPI returns a table with the following information.

Object type, Object name, Method name of BAPI, Function module name, Application component ID, Release at creation, Author, Last changed on, Last changed by, R/3 System, name of R/3 System, Application area or BAPI Work Group reponsible, Interface object type, Release status of BAPI methods, Release status of function module, Release in which object type was set as obsolete, Documentation on function module exists, Documentation for business object exists, Message type, Object type component, Description.

Example:

REPORT ZEX_BAPI_GETLIST .

* Parameters-----------------------------------------------------------*
Parameter: p_ojtpe like BAPIMONIT-OBJTYPE default '*',
           p_rel like BAPIMONIT-CREA_REL default SY-SAPRL,
           p_poten like BAPIMONIT-OPTSEL default ' ',
           p_newbp like BAPIMONIT-OPTSEL default 'X',
           p_oldbp like BAPIMONIT-OPTSEL default 'X',
           p_relbp like BAPIMONIT-OPTSEL default '*',
           p_relfun like BAPIMONIT-FUNCREL default '*'.

* Data Declaration-----------------------------------------------------*
Data: d_ret like BAPIRET2.

* Internal Table Declaration-------------------------------------------*
Data: int_comsel like BAPIMONCOM occurs 0 with header line,
      int_orgBP  like BAPISRCSYS occurs 0 with header line,
      int_selbap like BAPIMONSTR occurs 0 with header line.


* Function Call--------------------------------------------------------*
CALL FUNCTION 'BAPI_MONITOR_GETLIST'
 EXPORTING
   OBJECTTYPE              = p_ojtpe
   SHOW_RELEASE            = p_rel
   BAPIS_POTENTIAL         = p_poten
   BAPIS_NEW               = p_newbp
   BAPIS_OLD               = p_oldbp
   RELEASED_BAPI           = p_relbp
   RELEASED_FUNC           = p_relfun
 IMPORTING
   RETURN                  = d_ret
 TABLES
   COMPONENTS2SELECT       = int_comsel
   SYSTEMS2SELECT          = int_orgBP
   BAPILIST                = int_selbap
          .

 if sy-subrc = 0.

 endif.