datssource enhancement
TRANSCRIPT
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 1/52
-Topic :
-Presented By: Pratap Reddy Bodimalla
1
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 2/52
DataSource Enhancement
2
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’.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 3/52
DataSource Enhancement
3
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.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 4/52
DataSource Enhancement
4
Different procedures to enhance the Extract Structure of LO-Extractors 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.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 5/52
DataSource Enhancement
5
Give ‘Append Structure’ name
In SE11:
Display the Extract Structure of the DataSource.Click on ‘Append Structure’.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 6/52
DataSource Enhancement
6
Give Short Description and Append your fields under ‘Components’.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 7/52
DataSource Enhancement
7
In RSA6 :Select your ‘DataSource’ click on ‘Enhance Extract Structure’ and give Append Structure
name.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 8/52
DataSource Enhancement
8
Give Short Description and maintain required fields under ‘Components’.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 9/52
DataSource Enhancement
9
Customize the Extract Structure .
(Uncheck ‘Hide Field’ and ‘Field only Known in Customer Exit’ for custom fields).
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 10/52
DataSource Enhancement
10
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.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 11/52
DataSource Enhancement
11
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 12/52
DataSource Enhancement
12
Maintain the Extract Structure(LBWE).
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 13/52
DataSource Enhancement
13
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).
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 14/52
DataSource Enhancement
14
Function Modules :
1) EXIT_SAPLRSAP_001 Transaction Data DataSource
2) EXIT_SAPLRSAP_002 Attribute DataSource
3) EXIT_SAPLRSAP_003 Text DataSource
4) EXIT_SAPLRSAP_004 Hierarchy DataSource
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 15/52
DataSource Enhancement
15
Implement the logic in CMOD.
- Add RSAP0001 to the Project(If the Project exists) and Implement the logic.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 16/52
DataSource Enhancement
16
Double click on required Function Module.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 17/52
DataSource Enhancement
17
FM will have the Import Parameter , I_DataSource Name of the DataSource.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 18/52
DataSource Enhancement
18
FM will have the Internal Table ‘C_T_DATA’.
-The Internal Table ‘C_T_DATA’ will have the similar Structure of Extract Structure.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 19/52
DataSource Enhancement
19
Double click on Include Program .
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 20/52
DataSource Enhancement
20
Implement the logic here.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 21/52
DataSource Enhancement
21
APPENDIX
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 22/52
DataSource Enhancement
22
Introduction:
When ever we are not satisfied with the fields of Extract Structure as per User’s
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 Enhancement’.
For Ex:- Assume that the Extract Structure of a DataSource is delivering 4 fields.
Now you are not satisfied with the above fields and you want add one more field(f5)
to the Extract Structure of the DataSource as per your requirement.
f1 f2 f3 f4
f1 f2 f3 f4 f5
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 23/52
DataSource Enhancement
23
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-Lo-Extractors .
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
by using the Enhancement-RSAP0001(CMOD).
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 24/52
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 25/52
DataSource Enhancement
25
Method-1 : Go to T-code : SE11.
Select ‘Data Type’ , give the name of the Extract Structure of the above DataSourceand click on ‘Display’.
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 26/52
DataSource Enhancement
26
Click on ‘Append Structure’.
Give ‘Append Structure’ name
h
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 27/52
DataSource Enhancement
27
Give Short Description and Append your fields under ‘Components’ , givethe Data Element.
h
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 28/52
DataSource Enhancement
28
Activate the Append Structure , go back(f3) and Observe your Append Structure
at the End.
D S E h
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 29/52
DataSource Enhancement
29
Method-2 :
Go to T-code : RSA6Select your ‘DataSource’ click on ‘Enhance Extract Structure’ and give
Append Structure name.
D S E h
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 30/52
DataSource Enhancement
30
Give Short Description and your required fields under ‘Components’
and give Data Element.
D S E h
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 31/52
DataSource Enhancement
31
Activate Append Structure , now you can find your Append Structure at the bottom of
Extract Structure.
D t S E h t
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 32/52
DataSource Enhancement
32
Step-2: Customize the Extract Structure.
Go to T-code : RSA6Select your DataSource and click on Change icon.
D t S E h t
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 33/52
DataSource Enhancement
33
Uncheck the check boxes ‘Hide field’ and ‘Field only known in Customer Exit’
for custom fields and save the Extract Structure.
D t S E h t
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 34/52
DataSource Enhancement
34
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’.
D t S E h t
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 35/52
DataSource Enhancement
35
Here we can find 4 Function Modules.
1) EXIT_SAPLRSAP_001 Transaction Data DataSource
2) EXIT_SAPLRSAP_002 Attribute DataSource
3) EXIT_SAPLRSAP_003 Text DataSource
4) EXIT_SAPLRSAP_004 Hierarchy DataSource
D t S E h t
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 36/52
DataSource Enhancement
36
Note: We implement the logic in the above Function Modules depending on the typeof 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.
D t S E h t
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 37/52
DataSource Enhancement
37
Go to T-code : CMOD
Give Project name and click on ‘Create’ ,
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 38/52
DataSource Enhancement
38
Give the short description of the project and click on ‘Save’.
Click on ‘Enhancement Assignment’ , give ‘RSAP0001’ and Click on ‘Save’.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 39/52
DataSource Enhancement
39
Click on ‘Components’ in the below screen and give the Enhancement ‘RSAP0001’.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 40/52
DataSource Enhancement
40
Double click on your required Function Module in the below screen.
For this Scenario Double click on the Function Module ‘EXIT_SAPLRSAP_001’.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 41/52
DataSource Enhancement
41
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.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 42/52
DataSource Enhancement
42
This FM will have the Internal Table ‘C_T_DATA’.
The Structure of this Internal Table will have the similar Structure of Extract Structure.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 43/52
DataSource Enhancement
43
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.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 44/52
DataSource Enhancement
44
Click on ‘change’ icon. In the code you can find ‘Case I_Datasource’.
Under ‘Case I_Datasource’ implement your logic.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 45/52
DataSource Enhancement
45
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.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 46/52
DataSource Enhancement
46
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.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 47/52
DataSource Enhancement
47
You can find the value of ZZIND for all the records is ‘A’.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 48/52
DataSource Enhancement
48
Lo-DataSource :
Note: Enhancing the Lo-DataSource is slightly differed from Non-Lo-DataSource.
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 added
fields by using the Enhancement-RSAP0001(CMOD).
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 49/52
DataSource Enhancement
49
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’.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 50/52
DataSource Enhancement
50
Click on ‘Append Structure’ and give Name of the Append Structure.
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 51/52
DataSource Enhancement
51
DataSource Enhancement
7/22/2019 DatsSource Enhancement
http://slidepdf.com/reader/full/datssource-enhancement 52/52
DataSource Enhancement