Short Info.
In SAP NetWeaver 7.0
In this blog I will use the BAPI’s for PROJECTS to show you how to read/write data from/to the extension part of the BAPI.
First let us have a look at the interface of the BAPI BAPI_BUS2001_GETDATA:
- I_LANGUAGE =
- ET_RETURN =
- EXTENSIONIN =
- EXTENSIONOUT = .
Code Example 1
You can see that there are two table definitions for extensions.
- one for input (EXTENSIONIN)
- one for output (EXTENSIONOUT).
To be able to read the data in table EXTENSIONOUT after the BAPI call we need to take care of a few steps.
Definition
Define a type for the content of the data in the table. Do this by creating a type that contains the field STRUCTURE of type TE_STRUC and include the structure that is described in the documentation for that BAPI. In our case the structure BAPI_TE_PROJECT_DEFINITION.
So we declare:
- an internal table for the table EXTENSIONOUT parameter
- a work area for that internal table
- a work area of the defined type
- and a Field-symbol with the defined type.
See the example below.
TYPES: BEGIN OF ty_cust, structure TYPE te_struc. INCLUDE STRUCTURE bapi_te_project_definition. TYPES: END OF ty_cust.
DATA: lt_bapiparex TYPE STANDARD TABLE OF bapiparex, ls_bapiparex TYPE bapiparex, ls_cust TYPE ty_cust.
FIELD-SYMBOLS: TYPE ty_cust. ----
TYPE ty_cust.
PARAMETERS: pa_def LIKE bapi_bus2001_detail-project_definition.
START-OF-SELECTION.
CALL FUNCTION 'BAPI_BUS2001_GETDATA' EXPORTING i_project_definition = pa_def
- I_LANGUAGE =
- ET_RETURN =
- EXTENSIONIN =
LOOP AT lt_bapiparex INTO ls_bapiparex. ASSIGN ls_bapiparex TO = ls_cust. APPEND ls_bapiparex TO lt_bapiparex.
CALL FUNCTION 'BAPI_BUS2001_GETDATA' EXPORTING i_project_definition = pa_def
- I_LANGUAGE =
- ET_RETURN =
- EXTENSIONOUT =
Code Example 4
I hope this blog will help you start using the IN and OUT EXTENSIONS of BAPI’s in the new SAP NetWeaver 7.0 environment.
Special thanks to Leon Boeijen from NL for Business for helping me writing this weblog.</p> </div>
Comments