Datasource enhancement quick glance
Generic Delta extraction by Function Module
implementing delta functionality for extraction from VBAK
VBAK dont have a timestamp field
We will create an extraction structure that has timestamp field copy and use template FMs –
RSAX_BIW_GET_DATA_SIMPLE: a function module with simple interface for Full load with no support of delta loads
RSAX_BIW_GET_DATA: A function module with complete interface that supports delta load.
Step1: Create an extract structure- SE11 – create an extract structure add a time stamp field save and activate the extract structure
Step2: Create the function module- go to SE80 and create a function group for the function module if it not there attach the type group SBIWA to the TOP include by the statememt TYPE-POOLS SBIWA
Go to SE37 and copy the FM RSAX_BIW_GET_DATA
Go to FM in change mode delete entire source code
Go to tables tab and mention the name of the extract structure as associated type for the table parameter E_T_DATA with LIKE keyword.
Save and activate the the function module
Step3: Create the datasource RSO2
click on extraction by FM. Enter name of FM and name of extract structure.
Click on generic delta button -> select the TIMSTMP field and set the option timestamp optionally set the safety interval lower limit.
Save and save again.
Check the details of the datasource in RSA2, extraction method is set to F2 (simple interface)
To change it to F1 (complete interface) execute the following ABAP code (you can go to se38 and create new report with this ABAP code) report.
UPDATE ROOSOURCE SET DELTA = ‘E’ EXMETHOD = ‘F1’ WHERE OLTPSOURCE = <data source name>
Go to rsa2 and check the ds to test the FM,
go to se37 and call it 2 times in succession,
one for initialization and second time to read data
Step4 – go to RSA3 to test the datasource
Enhancing the data source
2 ways – by customer exits
by BADIs
The repository object for customer exits is called as Enhancement object and its name is RSAP0001.
SMOD – to observe its components they can be implemented
Using the tcode CMOD the repository object for BADI enhancement is called as BADI definition and its name is RSU5-SAPI_BADI
Iits components can be observed using tcode SE18 they can be implemented using tcode SE19.
Customer exits can be implemented only once whereas BADIs can be implemented multiple times independently
Steps for customer exit enhancement –
1. Adding extra fields for extract structure go to RSA6 – edit DS note down name of extract structure of DS
goto SE11, display extract structure to add extra fields, click on append structure button provide a name of append structure provide short desc give fields and their data elements.
Activate the append structure and come back observe the extra fields added to your DS.
Go to RSA6, select your DS in edit mode unselect the hide tick from the added fields.
Save the datasource to provide the data for the newly added fields, we have to enhance the customer exit corresponding to enhancement RSAP0001.
Go to CMOD, enter a name of project- click on create -enter desc and click on enhancements assignments button- enter RSAP0001 and save.
If project is already there with enhancement, error is displayed take the name of the project and come out -enter cmod with existing project -click on components -click on 001 -exit- click on include -edit add lines after case click on insert.