SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 1
Enhancing DataSources with BAdI RSU5_SAPI_BADI
Applies to:
As of SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C).
Summary
This white paper explains in details how to enhance DataSources with the new featured BAdI
RSU5_SAPI_BADI.
It is shown how to implement each enhancement on a separated method of the BABI class, making the code
more organized and clear, then in the formerly user exit’s EXIT_SAPLRSAP_00X.
Author(s): Flávio Peres
Company: NetSoft Sistemas
Created on: 02 febuary 2007
Author Bio
Flávio Peres is a SAP-BW Senior Consultant in NetSoft, São Paulo, Brasil.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 2
Table of Contents
Enhancing DataSources with BAdI RSU5_SAPI_BADI .................................................................. 3
Implementing the BADI.................................................................................................................... 3
On transaction SE19.................................................................................................................... 3
Define a implementation name for your class.............................................................................. 4
Then paste the following code: .................................................................................................... 6
Create a new method and name it: _TEMPLATE_DATASOURCE. ........................................... 8
Define the properties of this method as static and public ............................................................ 8
Creating a enhancemente of a datasource. .................................................................................. 10
Declare on the code the structure to populate........................................................................... 10
Bellow you have too examples of how to code your enhancement:.......................................... 11
Here a simple way to populate the fields of the structure straight from the select:................ 11
And here a slight more complex example, using some functions inside the code:................ 11
Conclusion: .................................................................................................................................... 14
Related Content............................................................................................................................. 15
Disclaimer and Liability Notice....................................................................................................... 16
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 3
Enhancing DataSources with BAdI RSU5_SAPI_BADI
As of SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C) is available a more efficient way to
enhance SAP standard content, using Business Add-Ins (BAdIs) rather than user exits.
The technical name of this BAdI is RSU5_SAPI_BADI, detailed on the SAP Note 691154.
Each enhancement will be implemented in a separated method of the BABI class, then the code will be more
organized and clear.
Below, I describe in details, how it can be done, just following a simple few steps.
Before we begin, there are some pre conditions, that must be filled:
• SAP_BASIS 6.20 and PI_BASIS 2004_1 must be installed on your system.
• The BADI-definition RSU5_SAPI_BADI (SE18) must exists in your system.
Once the pre conditions ware verified, it’s time to go.
I will assume that the process of creating and enhancing extraction structures of a given datasource is know
by the reader.
If you have doubts about the creation and enhancement of data sources, consult the documentation on SDN.
Implementing the BADI.
SAP make available the definition of the BADI, the implementation must be created for us, as follows:
On transaction SE19
• Type
• Click on
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 4
Define a implementation name for your class.
Click to confirm.
Click on to activate de implementation.
Result: You have created the implementation of the BADI, that will used to create the datasource
enhancements.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 5
Click on the TAB
Click on the link
You go to the class builder
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 6
On the class builder click on the method name:
Then paste the following code:
method IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM.
**********************************************************
* To implement an exit for a
* datasource create your own method by copying the
* method _TEMPLATE_DATASOURCE and rename it to the name
* of your datasource. In case you enhance a Business
* Content datasource skip the 0 at the beginning (e.g.
* Datasource 0FI_AR_3 -> Method FI_AR_3
* The method is then called by the Exit Framework
*********************************************************
DATA: ls_oltpsource TYPE rsaot_s_osource,
lv_data TYPE REF TO data,
lv_method TYPE seocmpname.
FIELD-SYMBOLS: <lt_data> TYPE STANDARD TABLE.
* check BW system
check _check_bw_system( ) = 'X'.
* check if any data is extracted
CHECK c_t_data IS NOT INITIAL.
CALL FUNCTION 'RSA1_SINGLE_OLTPSOURCE_GET'
EXPORTING
i_oltpsource = i_datasource
i_objvers = 'A'
IMPORTING
e_s_oltpsource = ls_oltpsource
EXCEPTIONS
no_authority = 1
not_exist = 2
inconsistent = 3
OTHERS = 4.
IF sy-subrc <> 0.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 7
EXIT.
ENDIF.
* create data for Extract Structure
CREATE DATA lv_data TYPE TABLE OF (ls_oltpsource-exstruct).
ASSIGN lv_data->* TO <lt_data>.
ASSIGN c_t_data TO <lt_data>.
* get method name for datasource
lv_method = i_datasource.
IF lv_method(1) = '0' or
lv_method(1) = '2'.
* shift by one character as methods can't start with a number
SHIFT lv_method.
ENDIF.
* check method is implemented
CHECK _check_method_exists( lv_method ) = 'X'.
CALL METHOD (lv_method)
EXPORTING
i_updmode = i_updmode
i_t_select = i_t_select
i_t_fields = i_t_fields
CHANGING
c_t_data = <lt_data>
c_t_messages = c_t_messages.
endmethod.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 8
Create a new method and name it: _TEMPLATE_DATASOURCE.
Then click over the name of the new method and paste the following code:
method _TEMPLATE_DATASOURCE.
* Data Definition
* DATA: lth_vbak type hashed table of vbak
* with unique key vbeln,
* ls_vbak type vbak .
* FIELD-SYMBOLS: <L_S_DATA> TYPE <Extract structure name>.
* Init
* Perform always a mass select into an internal table
* SELECT * FROM VBAK INTO TABLE lth_vbak
* FOR ALL ENTRIES IN C_T_DATA
* WHERE VBELN = C_T_DATA_VBELN.
* map the data
* LOOP AT C_T_DATA ASSIGNING <L_S_DATA>.
* READ TABLE lth_vbak into ls_vbak
* with table key vbeln = <L_S_DATA>-vbeln.
* if sy-subrc eq 0.
* <L_S_DATA>-VKORG = ls_vbak-vkorg.
* !!! No MODIFY necessary as the field is changed immediatly in the
* internal table by using Field Symbols
* endif.
* ENDLOOP.
endmethod.
Define the properties of this method as static and public
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 9
At this point you have created the implementation class for the BADI RSU5_SAPI_BADI. That can be used
for any extractor, standard or custom, to populate enhanced fields. And you have a template to build new
enhancements for DataSources.
Result: You have created the methods needed to make enhancements of the datasources.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 10
Creating a enhancemente of a datasource.
I will assume that you have enhanced the structure of the data source, and need to code to populate the
enhanced fields of the structure.
Copy the method _TEMPLATE_DATASOURCE and rename it, with the same name of the datasource you
want to enhance. In case of standard datasource, omit the first character of the name (‘0’ or ‘2’).
ie. DataSource 2LIS_18_IOTASK Method name: LIS_18_IOTASK
ie.
Declare on the code the structure to populate.
On the code, you have to declare the structure <L_S_DATA> of the type of the enhancement sctructure of
your data source, ie:
Trans: RSA6
As you see in the picture, the Extract Structure of the data source 2LIS_18_I0TASK is MC18I00TSK.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 11
Declare:
FIELD-SYMBOLS: <l_s_data> TYPE MC18I00TSK .
During the execution of the extraction process, when this method is called, the structure C_T_DATA will be
populated with packages of 100 records each time. So a loop must be declared to process these data
packages, as you see on the code examples bellow.
Bellow you have too examples of how to code your enhancement:
Here a simple way to populate the fields of the structure straight from the select:
method DS_FICA_VIEW_ZVDSFICACI.
FIELD-SYMBOLS: <L_S_DATA> TYPE ZOXBND0152.
* map the data
LOOP AT C_T_DATA ASSIGNING <L_S_DATA>.
SELECT SINGLE BETRH BETRW INTO (<L_S_DATA>-BETRH, <L_S_DATA>-BETRW)
FROM DFKKOP WHERE OPBEL = <L_S_DATA>-OPBEL AND
OPUPW = <L_S_DATA>-OPUPW AND
OPUPK = <L_S_DATA>-OPUPK AND
OPUPZ = <L_S_DATA>-OPUPZ.
ENDLOOP.
endmethod.
And here a slight more complex example, using some functions inside the code:
METHOD lis_18_i0task.
DATA: l_anw_stat_existing TYPE xfeld,
l_e_stsma TYPE jsto-stsma,
l_line TYPE bsvx-sttxt,
l_user_line TYPE bsvx-sttxt,
l_stonr TYPE tj30-stonr.
*************************************************************************
* FIELD-SYMBOLS *
*************************************************************************
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 12
FIELD-SYMBOLS: <l_s_data> TYPE MC18I00TSK .
*************************************************************************
* CONSTANTS *
*************************************************************************
CONSTANTS:
C_SPRAS TYPE SY-LANGU VALUE 'PT'.
*** Get the measures status, record by record
*** The DataSource loads a package of 100 records each time, then
*** we have to have a loop to process then.
LOOP AT c_t_data ASSIGNING <l_s_data>.
*** Function measure status
CALL FUNCTION 'STATUS_TEXT_EDIT'
EXPORTING
client = sy-mandt
flg_user_stat = 'X'
objnr = <l_s_data>-objnr
only_active = 'X'
spras = c_spras
bypass_buffer = ' '
IMPORTING
anw_stat_existing = l_anw_stat_existing
e_stsma = l_e_stsma
line = l_line
user_line = l_user_line
stonr = l_stonr
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
<l_s_data>-zstssis = l_line.
<l_s_data>-ZSTSUSU = L_USER_LINE(4).
*** SEARCH THE STRING 'ANUL'
search l_user_line for 'ANUL'.
IF sy-subrc = 0.
<l_s_data>-zflanu = 'ANUL'.
ENDIF.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 13
ENDIF.
ENDLOOP.
ENDMETHOD.
Go to the transaction RSA3 and test your data source.
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 14
Conclusion:
With this new method of creating enhancements, SAP makes available a more clear and effitient way to
enhance datasources.
I hope this article be useful to help you to enhance standard, or develop this own datasources, using this
new feature.
Flávio A. Peres
BW Senior Consultant.
flavio.amoedo@gmail.com
flavio_amoedo@yahoo.com.br
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 15
Related Content
• Note 691154 - SAPI with BADI: User exits in SAPI with BADI-interfaces
• How to... Create a Generic Data Extractor
Enhancing DataSources with BAdI RSU5_SAPI_BADI
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
© 2007 SAP AG 16
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces
and therefore is not supported by SAP. Changes made based on this information are not supported and can
be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods
suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of
this technical article or code sample, including any liability resulting from incompatibility between the content
within this document and the materials and services offered by SAP. You agree that you will not hold, or
seek to hold, SAP responsible or liable with respect to the content of this document.

Mais conteúdo relacionado

Mais procurados

Introduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataIntroduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataChris Whealy
 
Lo extraction part 3 extractor logic
Lo extraction   part 3 extractor logicLo extraction   part 3 extractor logic
Lo extraction part 3 extractor logicJNTU University
 
SAP BW - Data store objects
SAP BW - Data store objectsSAP BW - Data store objects
SAP BW - Data store objectsYasmin Ashraf
 
Hybrid provider based on dso using real time data acquisition in sap bw 7.30
Hybrid provider based on dso using real time data acquisition in sap bw 7.30Hybrid provider based on dso using real time data acquisition in sap bw 7.30
Hybrid provider based on dso using real time data acquisition in sap bw 7.30Sabyasachi Das
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfKoushikGuna
 
Customer exit variables in sap
Customer exit variables in sapCustomer exit variables in sap
Customer exit variables in sapSidharth Sriram
 
SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)Yasmin Ashraf
 
Lo extraction part 7 enhancements
Lo extraction   part 7 enhancementsLo extraction   part 7 enhancements
Lo extraction part 7 enhancementsJNTU University
 
Sap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypesSap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypesLuc Vanrobays
 
SAP NetWeaver BW Powered by SAP HANA
SAP NetWeaver BW Powered by SAP HANASAP NetWeaver BW Powered by SAP HANA
SAP NetWeaver BW Powered by SAP HANASAP Technology
 
BW Adjusting settings and monitoring data loads
BW Adjusting settings and monitoring data loadsBW Adjusting settings and monitoring data loads
BW Adjusting settings and monitoring data loadsLuc Vanrobays
 
Lo extraction part 4 update methods
Lo extraction   part 4 update methodsLo extraction   part 4 update methods
Lo extraction part 4 update methodsJNTU University
 
BW Migration to HANA Part1 - Preparation in BW System
BW Migration to HANA Part1 - Preparation in BW SystemBW Migration to HANA Part1 - Preparation in BW System
BW Migration to HANA Part1 - Preparation in BW SystemLinh Nguyen
 
Find out userexits in sap
Find out userexits in sapFind out userexits in sap
Find out userexits in sapDau Thanh Hai
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 
Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...Andre Bothma
 

Mais procurados (20)

Introduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataIntroduction to SAP Gateway and OData
Introduction to SAP Gateway and OData
 
Lo extraction part 3 extractor logic
Lo extraction   part 3 extractor logicLo extraction   part 3 extractor logic
Lo extraction part 3 extractor logic
 
SAP BW - Data store objects
SAP BW - Data store objectsSAP BW - Data store objects
SAP BW - Data store objects
 
Sap bw4 hana
Sap bw4 hanaSap bw4 hana
Sap bw4 hana
 
Hybrid provider based on dso using real time data acquisition in sap bw 7.30
Hybrid provider based on dso using real time data acquisition in sap bw 7.30Hybrid provider based on dso using real time data acquisition in sap bw 7.30
Hybrid provider based on dso using real time data acquisition in sap bw 7.30
 
SAP BW Introduction.
SAP BW Introduction.SAP BW Introduction.
SAP BW Introduction.
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
 
Customer exit variables in sap
Customer exit variables in sapCustomer exit variables in sap
Customer exit variables in sap
 
SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)
 
HANA Modeling
HANA Modeling HANA Modeling
HANA Modeling
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
 
Lo extraction part 7 enhancements
Lo extraction   part 7 enhancementsLo extraction   part 7 enhancements
Lo extraction part 7 enhancements
 
Sap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypesSap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypes
 
SAP NetWeaver BW Powered by SAP HANA
SAP NetWeaver BW Powered by SAP HANASAP NetWeaver BW Powered by SAP HANA
SAP NetWeaver BW Powered by SAP HANA
 
BW Adjusting settings and monitoring data loads
BW Adjusting settings and monitoring data loadsBW Adjusting settings and monitoring data loads
BW Adjusting settings and monitoring data loads
 
Lo extraction part 4 update methods
Lo extraction   part 4 update methodsLo extraction   part 4 update methods
Lo extraction part 4 update methods
 
BW Migration to HANA Part1 - Preparation in BW System
BW Migration to HANA Part1 - Preparation in BW SystemBW Migration to HANA Part1 - Preparation in BW System
BW Migration to HANA Part1 - Preparation in BW System
 
Find out userexits in sap
Find out userexits in sapFind out userexits in sap
Find out userexits in sap
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...Step by step on changing ecc source systems without affecting data modeling o...
Step by step on changing ecc source systems without affecting data modeling o...
 

Destaque

Pricing Routine In Vofm
Pricing Routine In VofmPricing Routine In Vofm
Pricing Routine In Vofmgueste6b4e7
 
Kindness to parents
Kindness to parentsKindness to parents
Kindness to parentsAabid Khan
 
What is an_sap_business_blueprint
What is an_sap_business_blueprintWhat is an_sap_business_blueprint
What is an_sap_business_blueprintPrashant Tyagi
 
SITIST 2015 Dev - Abap on Hana
SITIST 2015 Dev - Abap on HanaSITIST 2015 Dev - Abap on Hana
SITIST 2015 Dev - Abap on Hanasitist
 
Dassian GOVCON Overview
Dassian GOVCON OverviewDassian GOVCON Overview
Dassian GOVCON OverviewDassian Inc.
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantAnkit Sharma
 

Destaque (10)

Why sap hana
Why sap hanaWhy sap hana
Why sap hana
 
SAP HANA Platform
SAP HANA Platform SAP HANA Platform
SAP HANA Platform
 
B adi
B adiB adi
B adi
 
Pricing Routine In Vofm
Pricing Routine In VofmPricing Routine In Vofm
Pricing Routine In Vofm
 
Kindness to parents
Kindness to parentsKindness to parents
Kindness to parents
 
What is an_sap_business_blueprint
What is an_sap_business_blueprintWhat is an_sap_business_blueprint
What is an_sap_business_blueprint
 
SITIST 2015 Dev - Abap on Hana
SITIST 2015 Dev - Abap on HanaSITIST 2015 Dev - Abap on Hana
SITIST 2015 Dev - Abap on Hana
 
Dassian GOVCON Overview
Dassian GOVCON OverviewDassian GOVCON Overview
Dassian GOVCON Overview
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
 
SAP HANA - Understanding the Basics
SAP HANA - Understanding the Basics SAP HANA - Understanding the Basics
SAP HANA - Understanding the Basics
 

Semelhante a Enhancing data sources with badi in SAP ABAP

How to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selectionHow to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selectionValko Arbalov
 
Hr structural auths
Hr   structural authsHr   structural auths
Hr structural authshkodali
 
Top 140+ Advanced SAS Interview Questions and Answers.pdf
Top 140+ Advanced SAS Interview Questions and Answers.pdfTop 140+ Advanced SAS Interview Questions and Answers.pdf
Top 140+ Advanced SAS Interview Questions and Answers.pdfDatacademy.ai
 
Using error stack and error dt ps in sap bi 7.0
Using error stack and error dt ps in sap bi 7.0Using error stack and error dt ps in sap bi 7.0
Using error stack and error dt ps in sap bi 7.0gireesho
 
Rda step by step
Rda   step by stepRda   step by step
Rda step by stepPhani Kumar
 
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsCreating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsHicham Khallouki
 
Variables in sap bi
Variables in sap biVariables in sap bi
Variables in sap bishabari76
 
Day 6.3 extraction_business_content_and_generic
Day 6.3 extraction_business_content_and_genericDay 6.3 extraction_business_content_and_generic
Day 6.3 extraction_business_content_and_generictovetrivel
 
SAP Quickviewer
SAP QuickviewerSAP Quickviewer
SAP Quickviewerotchmarz
 
Creating new unit of measure in sap bw
Creating new unit of measure in sap bwCreating new unit of measure in sap bw
Creating new unit of measure in sap bwRajat Agrawal
 
Learn SAS Programming
Learn SAS ProgrammingLearn SAS Programming
Learn SAS ProgrammingSASTechies
 
Delta machenism with db connect
Delta machenism with db connectDelta machenism with db connect
Delta machenism with db connectObaid shaikh
 
Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3Wiiisdom
 
Using infoset query %2c sap query and quick viewer
Using infoset query %2c sap query and quick viewerUsing infoset query %2c sap query and quick viewer
Using infoset query %2c sap query and quick viewerShailendra Surana
 
Using infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewerUsing infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewerbsm fico
 

Semelhante a Enhancing data sources with badi in SAP ABAP (20)

Fm extraction
Fm extractionFm extraction
Fm extraction
 
How to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selectionHow to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selection
 
Hr structural auths
Hr   structural authsHr   structural auths
Hr structural auths
 
sap
sap sap
sap
 
Top 140+ Advanced SAS Interview Questions and Answers.pdf
Top 140+ Advanced SAS Interview Questions and Answers.pdfTop 140+ Advanced SAS Interview Questions and Answers.pdf
Top 140+ Advanced SAS Interview Questions and Answers.pdf
 
Using error stack and error dt ps in sap bi 7.0
Using error stack and error dt ps in sap bi 7.0Using error stack and error dt ps in sap bi 7.0
Using error stack and error dt ps in sap bi 7.0
 
Rda step by step
Rda   step by stepRda   step by step
Rda step by step
 
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsCreating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflows
 
Variables in sap bi
Variables in sap biVariables in sap bi
Variables in sap bi
 
Day 6.3 extraction_business_content_and_generic
Day 6.3 extraction_business_content_and_genericDay 6.3 extraction_business_content_and_generic
Day 6.3 extraction_business_content_and_generic
 
SAP Quickviewer
SAP QuickviewerSAP Quickviewer
SAP Quickviewer
 
Query
QueryQuery
Query
 
Creating new unit of measure in sap bw
Creating new unit of measure in sap bwCreating new unit of measure in sap bw
Creating new unit of measure in sap bw
 
Learn SAS Programming
Learn SAS ProgrammingLearn SAS Programming
Learn SAS Programming
 
Delta machenism with db connect
Delta machenism with db connectDelta machenism with db connect
Delta machenism with db connect
 
Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3
 
Using infoset query %2c sap query and quick viewer
Using infoset query %2c sap query and quick viewerUsing infoset query %2c sap query and quick viewer
Using infoset query %2c sap query and quick viewer
 
Using infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewerUsing infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewer
 
022006 zaidi badi
022006   zaidi badi022006   zaidi badi
022006 zaidi badi
 
Sap erp
Sap erpSap erp
Sap erp
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Enhancing data sources with badi in SAP ABAP

  • 1. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 1 Enhancing DataSources with BAdI RSU5_SAPI_BADI Applies to: As of SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C). Summary This white paper explains in details how to enhance DataSources with the new featured BAdI RSU5_SAPI_BADI. It is shown how to implement each enhancement on a separated method of the BABI class, making the code more organized and clear, then in the formerly user exit’s EXIT_SAPLRSAP_00X. Author(s): Flávio Peres Company: NetSoft Sistemas Created on: 02 febuary 2007 Author Bio Flávio Peres is a SAP-BW Senior Consultant in NetSoft, São Paulo, Brasil.
  • 2. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 2 Table of Contents Enhancing DataSources with BAdI RSU5_SAPI_BADI .................................................................. 3 Implementing the BADI.................................................................................................................... 3 On transaction SE19.................................................................................................................... 3 Define a implementation name for your class.............................................................................. 4 Then paste the following code: .................................................................................................... 6 Create a new method and name it: _TEMPLATE_DATASOURCE. ........................................... 8 Define the properties of this method as static and public ............................................................ 8 Creating a enhancemente of a datasource. .................................................................................. 10 Declare on the code the structure to populate........................................................................... 10 Bellow you have too examples of how to code your enhancement:.......................................... 11 Here a simple way to populate the fields of the structure straight from the select:................ 11 And here a slight more complex example, using some functions inside the code:................ 11 Conclusion: .................................................................................................................................... 14 Related Content............................................................................................................................. 15 Disclaimer and Liability Notice....................................................................................................... 16
  • 3. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 3 Enhancing DataSources with BAdI RSU5_SAPI_BADI As of SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C) is available a more efficient way to enhance SAP standard content, using Business Add-Ins (BAdIs) rather than user exits. The technical name of this BAdI is RSU5_SAPI_BADI, detailed on the SAP Note 691154. Each enhancement will be implemented in a separated method of the BABI class, then the code will be more organized and clear. Below, I describe in details, how it can be done, just following a simple few steps. Before we begin, there are some pre conditions, that must be filled: • SAP_BASIS 6.20 and PI_BASIS 2004_1 must be installed on your system. • The BADI-definition RSU5_SAPI_BADI (SE18) must exists in your system. Once the pre conditions ware verified, it’s time to go. I will assume that the process of creating and enhancing extraction structures of a given datasource is know by the reader. If you have doubts about the creation and enhancement of data sources, consult the documentation on SDN. Implementing the BADI. SAP make available the definition of the BADI, the implementation must be created for us, as follows: On transaction SE19 • Type • Click on
  • 4. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 4 Define a implementation name for your class. Click to confirm. Click on to activate de implementation. Result: You have created the implementation of the BADI, that will used to create the datasource enhancements.
  • 5. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 5 Click on the TAB Click on the link You go to the class builder
  • 6. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 6 On the class builder click on the method name: Then paste the following code: method IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM. ********************************************************** * To implement an exit for a * datasource create your own method by copying the * method _TEMPLATE_DATASOURCE and rename it to the name * of your datasource. In case you enhance a Business * Content datasource skip the 0 at the beginning (e.g. * Datasource 0FI_AR_3 -> Method FI_AR_3 * The method is then called by the Exit Framework ********************************************************* DATA: ls_oltpsource TYPE rsaot_s_osource, lv_data TYPE REF TO data, lv_method TYPE seocmpname. FIELD-SYMBOLS: <lt_data> TYPE STANDARD TABLE. * check BW system check _check_bw_system( ) = 'X'. * check if any data is extracted CHECK c_t_data IS NOT INITIAL. CALL FUNCTION 'RSA1_SINGLE_OLTPSOURCE_GET' EXPORTING i_oltpsource = i_datasource i_objvers = 'A' IMPORTING e_s_oltpsource = ls_oltpsource EXCEPTIONS no_authority = 1 not_exist = 2 inconsistent = 3 OTHERS = 4. IF sy-subrc <> 0.
  • 7. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 7 EXIT. ENDIF. * create data for Extract Structure CREATE DATA lv_data TYPE TABLE OF (ls_oltpsource-exstruct). ASSIGN lv_data->* TO <lt_data>. ASSIGN c_t_data TO <lt_data>. * get method name for datasource lv_method = i_datasource. IF lv_method(1) = '0' or lv_method(1) = '2'. * shift by one character as methods can't start with a number SHIFT lv_method. ENDIF. * check method is implemented CHECK _check_method_exists( lv_method ) = 'X'. CALL METHOD (lv_method) EXPORTING i_updmode = i_updmode i_t_select = i_t_select i_t_fields = i_t_fields CHANGING c_t_data = <lt_data> c_t_messages = c_t_messages. endmethod.
  • 8. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 8 Create a new method and name it: _TEMPLATE_DATASOURCE. Then click over the name of the new method and paste the following code: method _TEMPLATE_DATASOURCE. * Data Definition * DATA: lth_vbak type hashed table of vbak * with unique key vbeln, * ls_vbak type vbak . * FIELD-SYMBOLS: <L_S_DATA> TYPE <Extract structure name>. * Init * Perform always a mass select into an internal table * SELECT * FROM VBAK INTO TABLE lth_vbak * FOR ALL ENTRIES IN C_T_DATA * WHERE VBELN = C_T_DATA_VBELN. * map the data * LOOP AT C_T_DATA ASSIGNING <L_S_DATA>. * READ TABLE lth_vbak into ls_vbak * with table key vbeln = <L_S_DATA>-vbeln. * if sy-subrc eq 0. * <L_S_DATA>-VKORG = ls_vbak-vkorg. * !!! No MODIFY necessary as the field is changed immediatly in the * internal table by using Field Symbols * endif. * ENDLOOP. endmethod. Define the properties of this method as static and public
  • 9. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 9 At this point you have created the implementation class for the BADI RSU5_SAPI_BADI. That can be used for any extractor, standard or custom, to populate enhanced fields. And you have a template to build new enhancements for DataSources. Result: You have created the methods needed to make enhancements of the datasources.
  • 10. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 10 Creating a enhancemente of a datasource. I will assume that you have enhanced the structure of the data source, and need to code to populate the enhanced fields of the structure. Copy the method _TEMPLATE_DATASOURCE and rename it, with the same name of the datasource you want to enhance. In case of standard datasource, omit the first character of the name (‘0’ or ‘2’). ie. DataSource 2LIS_18_IOTASK Method name: LIS_18_IOTASK ie. Declare on the code the structure to populate. On the code, you have to declare the structure <L_S_DATA> of the type of the enhancement sctructure of your data source, ie: Trans: RSA6 As you see in the picture, the Extract Structure of the data source 2LIS_18_I0TASK is MC18I00TSK.
  • 11. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 11 Declare: FIELD-SYMBOLS: <l_s_data> TYPE MC18I00TSK . During the execution of the extraction process, when this method is called, the structure C_T_DATA will be populated with packages of 100 records each time. So a loop must be declared to process these data packages, as you see on the code examples bellow. Bellow you have too examples of how to code your enhancement: Here a simple way to populate the fields of the structure straight from the select: method DS_FICA_VIEW_ZVDSFICACI. FIELD-SYMBOLS: <L_S_DATA> TYPE ZOXBND0152. * map the data LOOP AT C_T_DATA ASSIGNING <L_S_DATA>. SELECT SINGLE BETRH BETRW INTO (<L_S_DATA>-BETRH, <L_S_DATA>-BETRW) FROM DFKKOP WHERE OPBEL = <L_S_DATA>-OPBEL AND OPUPW = <L_S_DATA>-OPUPW AND OPUPK = <L_S_DATA>-OPUPK AND OPUPZ = <L_S_DATA>-OPUPZ. ENDLOOP. endmethod. And here a slight more complex example, using some functions inside the code: METHOD lis_18_i0task. DATA: l_anw_stat_existing TYPE xfeld, l_e_stsma TYPE jsto-stsma, l_line TYPE bsvx-sttxt, l_user_line TYPE bsvx-sttxt, l_stonr TYPE tj30-stonr. ************************************************************************* * FIELD-SYMBOLS * *************************************************************************
  • 12. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 12 FIELD-SYMBOLS: <l_s_data> TYPE MC18I00TSK . ************************************************************************* * CONSTANTS * ************************************************************************* CONSTANTS: C_SPRAS TYPE SY-LANGU VALUE 'PT'. *** Get the measures status, record by record *** The DataSource loads a package of 100 records each time, then *** we have to have a loop to process then. LOOP AT c_t_data ASSIGNING <l_s_data>. *** Function measure status CALL FUNCTION 'STATUS_TEXT_EDIT' EXPORTING client = sy-mandt flg_user_stat = 'X' objnr = <l_s_data>-objnr only_active = 'X' spras = c_spras bypass_buffer = ' ' IMPORTING anw_stat_existing = l_anw_stat_existing e_stsma = l_e_stsma line = l_line user_line = l_user_line stonr = l_stonr EXCEPTIONS object_not_found = 1 OTHERS = 2. IF sy-subrc = 0. <l_s_data>-zstssis = l_line. <l_s_data>-ZSTSUSU = L_USER_LINE(4). *** SEARCH THE STRING 'ANUL' search l_user_line for 'ANUL'. IF sy-subrc = 0. <l_s_data>-zflanu = 'ANUL'. ENDIF.
  • 13. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 13 ENDIF. ENDLOOP. ENDMETHOD. Go to the transaction RSA3 and test your data source.
  • 14. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 14 Conclusion: With this new method of creating enhancements, SAP makes available a more clear and effitient way to enhance datasources. I hope this article be useful to help you to enhance standard, or develop this own datasources, using this new feature. Flávio A. Peres BW Senior Consultant. flavio.amoedo@gmail.com flavio_amoedo@yahoo.com.br
  • 15. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 15 Related Content • Note 691154 - SAPI with BADI: User exits in SAPI with BADI-interfaces • How to... Create a Generic Data Extractor
  • 16. Enhancing DataSources with BAdI RSU5_SAPI_BADI SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 16 Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.