Enviar pesquisa
Carregar
Enhancing data sources with badi in SAP ABAP
•
2 gostaram
•
4,144 visualizações
Aabid Khan
Seguir
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 16
Baixar agora
Baixar para ler offline
Recomendados
How to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bw
Luc Vanrobays
Abap Objects for BW
Abap Objects for BW
Luc Vanrobays
LSA++ english version
LSA++ english version
Mauricio Cubillos Ocampo
Customer exit variables in sap
Customer exit variables in sap
saborhade
Line item dimension and high cardinality dimension
Line item dimension and high cardinality dimension
Praveen Kumar
SAP BI/BW
SAP BI/BW
ChanderRajpurohit
MD04 Report in BW
MD04 Report in BW
tasmc
Step by step procedure for loading of data from the flat file to the master d...
Step by step procedure for loading of data from the flat file to the master d...
Prashant Tyagi
Recomendados
How to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bw
Luc Vanrobays
Abap Objects for BW
Abap Objects for BW
Luc Vanrobays
LSA++ english version
LSA++ english version
Mauricio Cubillos Ocampo
Customer exit variables in sap
Customer exit variables in sap
saborhade
Line item dimension and high cardinality dimension
Line item dimension and high cardinality dimension
Praveen Kumar
SAP BI/BW
SAP BI/BW
ChanderRajpurohit
MD04 Report in BW
MD04 Report in BW
tasmc
Step by step procedure for loading of data from the flat file to the master d...
Step by step procedure for loading of data from the flat file to the master d...
Prashant Tyagi
Introduction to SAP Gateway and OData
Introduction to SAP Gateway and OData
Chris Whealy
Lo extraction part 3 extractor logic
Lo extraction part 3 extractor logic
JNTU University
SAP BW - Data store objects
SAP BW - Data store objects
Yasmin Ashraf
Sap bw4 hana
Sap bw4 hana
Nisit Payungkorapin
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.30
Sabyasachi Das
SAP BW Introduction.
SAP BW Introduction.
Deloitte India (Offices of the US)
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
KoushikGuna
Customer exit variables in sap
Customer exit variables in sap
Sidharth Sriram
SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)
Yasmin Ashraf
HANA Modeling
HANA Modeling
Kishore Chaganti
Abap dictionary 1
Abap dictionary 1
venkata karthik
Lo extraction part 7 enhancements
Lo extraction part 7 enhancements
JNTU University
Sap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypes
Luc Vanrobays
SAP NetWeaver BW Powered by SAP HANA
SAP NetWeaver BW Powered by SAP HANA
SAP Technology
BW Adjusting settings and monitoring data loads
BW Adjusting settings and monitoring data loads
Luc Vanrobays
Lo extraction part 4 update methods
Lo extraction part 4 update methods
JNTU University
BW Migration to HANA Part1 - Preparation in BW System
BW Migration to HANA Part1 - Preparation in BW System
Linh Nguyen
Find out userexits in sap
Find out userexits in sap
Dau Thanh Hai
Smartforms interview questions with answers
Smartforms interview questions with answers
Uttam 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...
Andre Bothma
Why sap hana
Why sap hana
ugur candan
SAP HANA Platform
SAP HANA Platform
SAP Technology
Mais conteúdo relacionado
Mais procurados
Introduction to SAP Gateway and OData
Introduction to SAP Gateway and OData
Chris Whealy
Lo extraction part 3 extractor logic
Lo extraction part 3 extractor logic
JNTU University
SAP BW - Data store objects
SAP BW - Data store objects
Yasmin Ashraf
Sap bw4 hana
Sap bw4 hana
Nisit Payungkorapin
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.30
Sabyasachi Das
SAP BW Introduction.
SAP BW Introduction.
Deloitte India (Offices of the US)
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
KoushikGuna
Customer exit variables in sap
Customer exit variables in sap
Sidharth Sriram
SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)
Yasmin Ashraf
HANA Modeling
HANA Modeling
Kishore Chaganti
Abap dictionary 1
Abap dictionary 1
venkata karthik
Lo extraction part 7 enhancements
Lo extraction part 7 enhancements
JNTU University
Sap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypes
Luc Vanrobays
SAP NetWeaver BW Powered by SAP HANA
SAP NetWeaver BW Powered by SAP HANA
SAP Technology
BW Adjusting settings and monitoring data loads
BW Adjusting settings and monitoring data loads
Luc Vanrobays
Lo extraction part 4 update methods
Lo extraction part 4 update methods
JNTU University
BW Migration to HANA Part1 - Preparation in BW System
BW Migration to HANA Part1 - Preparation in BW System
Linh Nguyen
Find out userexits in sap
Find out userexits in sap
Dau Thanh Hai
Smartforms interview questions with answers
Smartforms interview questions with answers
Uttam 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...
Andre Bothma
Mais procurados
(20)
Introduction to SAP Gateway and OData
Introduction to SAP Gateway and OData
Lo extraction part 3 extractor logic
Lo extraction part 3 extractor logic
SAP BW - Data store objects
SAP BW - Data store objects
Sap 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.30
SAP BW Introduction.
SAP BW Introduction.
SAP 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 sap
SAP BW - Info object (characteristics)
SAP BW - Info object (characteristics)
HANA Modeling
HANA Modeling
Abap dictionary 1
Abap dictionary 1
Lo extraction part 7 enhancements
Lo extraction part 7 enhancements
Sap bw4 hana architecture archetypes
Sap bw4 hana architecture archetypes
SAP 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 loads
Lo 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 System
Find out userexits in sap
Find out userexits in sap
Smartforms 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...
Destaque
Why sap hana
Why sap hana
ugur candan
SAP HANA Platform
SAP HANA Platform
SAP Technology
B adi
B adi
Prashant Tyagi
Pricing Routine In Vofm
Pricing Routine In Vofm
gueste6b4e7
Kindness to parents
Kindness to parents
Aabid Khan
What is an_sap_business_blueprint
What is an_sap_business_blueprint
Prashant Tyagi
SITIST 2015 Dev - Abap on Hana
SITIST 2015 Dev - Abap on Hana
sitist
Dassian GOVCON Overview
Dassian GOVCON Overview
Dassian Inc.
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
Ankit Sharma
SAP HANA - Understanding the Basics
SAP HANA - Understanding the Basics
Global Business Solutions SME
Destaque
(10)
Why sap hana
Why sap hana
SAP HANA Platform
SAP HANA Platform
B adi
B adi
Pricing Routine In Vofm
Pricing Routine In Vofm
Kindness to parents
Kindness to parents
What is an_sap_business_blueprint
What is an_sap_business_blueprint
SITIST 2015 Dev - Abap on Hana
SITIST 2015 Dev - Abap on Hana
Dassian GOVCON Overview
Dassian GOVCON Overview
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
SAP HANA - Understanding the Basics
SAP HANA - Understanding the Basics
Semelhante a Enhancing data sources with badi in SAP ABAP
Fm extraction
Fm extraction
Rajesh Majeti
How to write a routine for 0 calday in infopackage selection
How to write a routine for 0 calday in infopackage selection
Valko Arbalov
Hr structural auths
Hr structural auths
hkodali
sap
sap
Sivaprasadreddy Kandukuri
Top 140+ Advanced SAS Interview Questions and Answers.pdf
Top 140+ Advanced SAS Interview Questions and Answers.pdf
Datacademy.ai
Using error stack and error dt ps in sap bi 7.0
Using error stack and error dt ps in sap bi 7.0
gireesho
Rda step by step
Rda step by step
Phani Kumar
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflows
Hicham Khallouki
Variables in sap bi
Variables in sap bi
shabari76
Day 6.3 extraction_business_content_and_generic
Day 6.3 extraction_business_content_and_generic
tovetrivel
SAP Quickviewer
SAP Quickviewer
otchmarz
Query
Query
Maria Felipe
Creating new unit of measure in sap bw
Creating new unit of measure in sap bw
Rajat Agrawal
Learn SAS Programming
Learn SAS Programming
SASTechies
Delta machenism with db connect
Delta machenism with db connect
Obaid shaikh
Discover SAP BusinessObjects BI 4.3
Discover SAP BusinessObjects BI 4.3
Wiiisdom
Using infoset query %2c sap query and quick viewer
Using infoset query %2c sap query and quick viewer
Shailendra Surana
Using infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewer
bsm fico
022006 zaidi badi
022006 zaidi badi
sandeep_ganganaboina
Sap erp
Sap erp
Wajdi Lahyani
Semelhante a Enhancing data sources with badi in SAP ABAP
(20)
Fm extraction
Fm extraction
How 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 auths
sap
sap
Top 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.0
Rda 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 workflows
Variables in sap bi
Variables in sap bi
Day 6.3 extraction_business_content_and_generic
Day 6.3 extraction_business_content_and_generic
SAP Quickviewer
SAP Quickviewer
Query
Query
Creating new unit of measure in sap bw
Creating new unit of measure in sap bw
Learn SAS Programming
Learn SAS Programming
Delta machenism with db connect
Delta machenism with db connect
Discover 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 viewer
Using infoset query ,sap query and quick viewer
Using infoset query ,sap query and quick viewer
022006 zaidi badi
022006 zaidi badi
Sap 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 Automation
Safe Software
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Khem
🐬 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 education
jfdjdjcjdnsjd
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.pdf
sudhanshuwaghmare1
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
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-MelissaKlemke
Product 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 2024
Rafal Los
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
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...
Martijn de Jong
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 Robison
Anna Loughnan Colquhoun
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Pixlogix Infotech
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
UK 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 Automation
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Real 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 🐘
presentation 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...
Boost 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 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...
ProductAnonymous-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 2024
How 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 Developments
Boost 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?
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...
Data 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 Business
Understanding 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.
Baixar agora