You are on page 1of 52

-Topic : DataSource

-Presented By:

Enhancement

Pratap Reddy

Bodimalla

DataSource Enhancement

DataSource Enhancement will have 2 aspects mainly.


Enhancing the Extract Structure.
Implement ABAP/4 code to fill the data for enhanced
fields by using the Enhancement RSAP0001.

DataSource Enhancement
Enhance the Extract Structure.
For Ex:- Assume that the Extract Structure of a DataSource is
delivering 4 fields.

As per the requirement this Extract Structure has to deliver one


more field(f5).
So we need to Enhance the Extract Structure by appending the
new field.

DataSource Enhancement
Different procedures to enhance the Extract Structure of LOExtractors and
Non-Lo-Extractors .

Non-Lo-DataSource :
In case of Non-Lo-DataSource append the fields directly to
Extract Structure in
SE11 or RSA6.

In SE11:
Display the Extract Structure of the DataSource.

DataSource Enhancement
In SE11:
Display the Extract Structure of the DataSource.
Click on Append Structure.

Give Append Structure name

DataSource Enhancement
Give Short Description and Append your fields under Components.

DataSource Enhancement
In RSA6 :
Select your DataSource click on Enhance Extract Structure and give
Append Structure name.

DataSource Enhancement
Give Short Description and maintain required fields under
Components.

DataSource Enhancement

ustomize the Extract Structure .


ncheck Hide Field and Field only Known in Customer Exit for custom fields).

DataSource Enhancement
LO-DataSource:
Note : In case of LO-DataSource Enhancing the Extract Structure is
slightly differed
from Non-Lo-DataSource.
-Append the field to Communication Structure first and maintain the
Extract Structure.
In SE11 :
Append the fields to Communication Structure.

10

DataSource Enhancement

11

DataSource Enhancement
Maintain the Extract Structure(LBWE).

12

DataSource Enhancement
Implement ABAP/4 code to fill the data to the enhanced
fields by using the Enhancement RSAP0001(CMOD) .
Note : RSAP0001 Enhancement will have 4 Function
Modules(SMOD).

13

DataSource Enhancement
Function Modules :
1)
2)
3)
4)

EXIT_SAPLRSAP_001
EXIT_SAPLRSAP_002
EXIT_SAPLRSAP_003
EXIT_SAPLRSAP_004

Transaction Data DataSource


Attribute DataSource
Text DataSource
Hierarchy DataSource

14

DataSource Enhancement
Implement the logic in CMOD.
- Add RSAP0001 to the Project(If the Project exists) and Implement
the logic.

15

DataSource Enhancement
Double click on required Function
Module.

16

DataSource Enhancement
FM will have the Import Parameter , I_DataSource Name of the
DataSource.

17

DataSource Enhancement
FM will have the Internal Table C_T_DATA.
-The Internal Table C_T_DATA will have the similar Structure of Extract
Structure.

18

DataSource Enhancement
Double click on Include
Program .

19

DataSource Enhancement
Implement the logic here.

20

DataSource Enhancement

APPEND
IX
21

DataSource Enhancement
Introduction:
When ever we are not satisfied with the fields of Extract Structure as
per Users
requirement then we will go for the Customization of DataSource. We
call this as
DataSource Enhancement.
i.e. Appending a new field to the Extract Structure of the DataSource
and implementing
the logic to pop-up the data to the newly added fields is called
DataSource
f1
f2
f3
f4
Enhancement.
For Ex:- Assume that the Extract Structure of a DataSource is
delivering 4 fields.
f1
f2
f3
f4
f5
Now you are not satisfied with the above fields and you want add22one
more field(f5)

DataSource Enhancement
To pop-up the data to the fields of Extract Structure , SAP will have been
written the code.
To pop-up the data to the Custom fields of Extract Structure we should
manipulate the code as per the business logic.

We have different procedures to Customize LO-Extractors and Non-LoExtractors .

Non-Lo-DataSource :
Steps:

Step-1: Enhance the Extract Structure by Appending new fields as


per the
requirement(SE11/RSA6).

Step-2: Customize the Extract Structure(RSA6).


Step-3: Implement the ABAP/4 code to fill the values into the
newly added fields

23

DataSource Enhancement
Simple Scenario : We have the DataSource 0CO_OM_CCA_3
and we want
this DataSource has to deliver a field like Indicator(ZZIND) with
constant value A.
This field is not available in the Extract Structure of this DataSource.
Install the DataSource 0CO_OM_CCA_3 from RSA5.
Extract Structure of the DataSource 0CO_OM_CCA_3 is ICCTRACT.
Step-1: Enhance the Extract Structure by Appending new fields as per
the requirement.
Note: we will not add the Fields directly to the Extract Structure. We
will add the fields
to Extract structure through Append Structure.
To enhance this we have 2 methods.
Method-1 : Go to T-code : SE11.
24

DataSource Enhancement
Method-1 : Go to T-code : SE11.
Select Data Type , give the name of the Extract Structure of the
above DataSource
and click on Display.

25

DataSource Enhancement
Click on Append Structure.

Give Append Structure name

26

DataSource Enhancement
Give Short Description and Append your fields under
Components , give the Data Element.

27

DataSource Enhancement
Activate the Append Structure , go back(f3) and Observe your
Append Structure at the End.

28

DataSource Enhancement
Method-2 :
Go to T-code : RSA6
Select your DataSource click on Enhance Extract
Structure and give
Append Structure name.

29

DataSource Enhancement
Give Short Description and your required fields under Components
and give Data Element.

30

DataSource Enhancement
Activate Append Structure , now you can find your Append Structure
at the bottom of Extract Structure.

31

DataSource Enhancement
Step-2: Customize the Extract Structure.
Go to T-code : RSA6
Select your DataSource and click on Change icon.

32

DataSource Enhancement
Uncheck the check boxes Hide field and Field only known in
Customer Exit
for custom fields and save the Extract Structure.

33

DataSource Enhancement
Step-3: Implement ABAP/4 code to fill the values into the newly
added fields
by using the Enhancement-RSAP0001.
In R/3 we are having RSAP0001 Enhancement.
This Enhancement will have 4 Function Modules.
To see these Function Modules go to the T-code : SMOD
Give the Enhancement Name : RSAP0001 , Select Components and
click on Display.

34

DataSource Enhancement
Here we can find 4 Function Modules.
1)
2)
3)
4)

EXIT_SAPLRSAP_001
EXIT_SAPLRSAP_002
EXIT_SAPLRSAP_003
EXIT_SAPLRSAP_004

Transaction Data DataSource


Attribute DataSource
Text DataSource
Hierarchy DataSource

35

DataSource Enhancement
Note: We implement the logic in the above Function Modules
depending on the type of the DataSource.
To implement the logic we use the T-code : CMOD.
Before implementing the logic in the corresponding Function Module
we must attach
the Enhancement RSAP0001 to a project.
Create the Project in CMOD and attach the Enhancement RSAP0001
to the Project.
Note : If you have any existed Project you can use it , other wise
create it.

36

DataSource Enhancement
Go to T-code : CMOD
Give Project name and click on Create ,

37

DataSource Enhancement
Give the short description of the project and click on Save.
Click on Enhancement Assignment , give RSAP0001 and Click on
Save.

38

DataSource Enhancement

Click on Components in the below screen and give the Enhancement RSAP00

39

DataSource Enhancement
Double click on your required Function Module in the below screen.
For this Scenario Double click on the Function Module
EXIT_SAPLRSAP_001.

40

DataSource Enhancement
When ever we trigger our InfoPackage then SAPI(Program) will pass our
DataSource name to the parameter I_DataSource of the FM
EXIT_SAPLRSAP_001 .
So we implement our logic by using CASE statement.
Sample code:
Case.
When Our DataSource Name.
Business Logic.
EndCase.

41

DataSource Enhancement
This FM will have the Internal Table C_T_DATA.
The Structure of this Internal Table will have the similar Structure of
Extract Structure.

42

DataSource Enhancement
This FM will extract data for all the standard fields available in the Extract
Structure
and puts that data into the Internal table C_T_DATA. So for the custom
fields C_T_DATA
will not have the data.
Now we loop this C_T_DATA table and implement our Logic to fill the data
for custom fields.
Double Click on Include Program(ZXRSAU01) which is before EndFunction
and Implement our logic to populate the data.

43

DataSource Enhancement
Click on change icon. In the code you can find Case I_Datasource.
Under Case I_Datasource implement your logic.

44

DataSource Enhancement
Declare one structure like Extract Structure , loop C_T_DATA and
implement your logic.

Code:
WHEN '0CO_OM_CCA_3'.
DATA : YSTRU LIKE ICCTRACT.
LOOP AT C_T_DATA INTO YSTRU.
YSTRU-ZZIND = 'A'.
MODIFY C_T_DATA FROM YSTRU INDEX SY-TABIX.
ENDLOOP.

Note : After implementing the logic keep activating and come back. 45

DataSource Enhancement
Note : Put the break-point at your code and Debug your code in RSA3
and see how the data is being populated into custom fields.

46

DataSource Enhancement
You can find the value of ZZIND for all the records is A.

47

DataSource Enhancement
Lo-DataSource :
Note:

Enhancing the Lo-DataSource is slightly differed from Non-LoDataSource.

Steps:
Step-1: Enhance the Communication Structure by Appending new
fields as per the
requirement(SE11).
Step-2 : Move the fields from Communication Structure to Extract
Structure(LBWE).
Step-3: Customize the Extract Structure(LBWE).
Step-4: Implement the ABAP/4 code to fill the values into the newly
48
added

DataSource Enhancement
Scenario : 2LIS_11VAITM.
This DataSource will not deliver the field PRCTR(Profit Centre). We want
this DataSource has to deliver PRCTR(Profit Centre).
Logic : The DataSource 2LIS_11_VAITM will deliver MATNR(Material
Number) and
WERKS(Plant). By performing look up to MARC(Material Plant
table) table , read
PRCTR(Profit Centre) for the corresponding MATNR and WERKS.
Step-1: Add the field PRCTR to Communication Structure MCVBAP.
Go to T-code : SE11
Give MCVBAP and click on Display.

49

DataSource Enhancement
Click on Append Structure and give Name of the Append
Structure.

50

DataSource Enhancement

51

DataSource Enhancement

52

You might also like