Professional Documents
Culture Documents
Now consider a program logic that we do repeatedly in our program... It is not a good
method to write code for that logic each time .. so we create a functional module...
Functional module is just another program which is global.. and can be accesses by all
other programs...
Now each time we don't have to write code for that program... we just need to call that
functional module ..
Through out the logic of program we are accessing ECC tables ( Transaction table),
which will affect the efficiency of transaction system..
To overcome this we use Internal tables..
Data from ECC table will be moved to this internal table.. and program access only this
internal table not ECC tables...
Steps
1. Create a structure with necessary fields.
2. Create Functional Module.
* Extract data to the structure created
* Give the name of Datasource which is going to use this functional module
3. Create Datasource
* Add name of the structure and Functional Module while creating datasource
Step 1
Create structure.
Goto Tcode SE11 ( ABAP Data Dictionary)
NETWR is a currency field so it must have reference field that is in the base table. Click
Currency / Quan and give that field name.
Activate the structure..
Step 2
Create Functional Module
Goto Tcode SE80 ( ABAP Workbench)
FUNCTION ZRSAX_BIW_GET_DATA_SIMPLE4_2.
*"---------------------------------------------------------------------*"*"Local Interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG
_OFF
*" TABLES
*"
I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*"
I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*"
E_T_DATA STRUCTURE ZNVBAK1 OPTIONAL
*" EXCEPTIONS
*"
NO_MORE_DATA
*"
ERROR_PASSED_TO_MESS_HANDLER
*"---------------------------------------------------------------------* Example: DataSource for table SFLIGHT
TABLES: ZNVBAK1.
"Name of Structure"
* Auxiliary Selection criteria structure
DATA: L_S_SELECT TYPE SRSC_S_SELECT.
* Maximum number of lines for DB table
STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
* counter
S_COUNTER_DATAPAKID LIKE SY-TABIX,
* cursor
S_CURSOR TYPE CURSOR.
* Select ranges
* RANGES: L_R_CARRID FOR SFLIGHT-CARRID,
RANGES: SDNO FOR znvbak1-VBELN.
* Initialization mode (first call by SAPI) or data transfer mode
* (following calls) ?
IF I_INITFLAG = SBIWA_C_FLAG_ON.
************************************************************************
Step 3
Create Datasource
Goto Tcode RSO2
Our data has successfully reached BI system... Now take it to the corresponding targets