How to develop BADI (abap)
A. BAdI Definition
1. SE18
2. Enter the name for the BAdI to be created in customer namespace and press "Create".
3. Enter a definition for your BAdI and on the interface tab enter a name for the BAdI interface. SAP proposes a name and it is pretty good. Meanwhile a BAdI class is also created which is not in our concern.
e.g for "ZTEST", SAP proposes "ZIF_EX_TEST" for the interface and "ZCL_EX_TEST" for the class.
4. Save your BAdI.
5. Double-click on the interface name. It will pass to a Class Builder session to make you implement your interface. If you are not familiar to the Class Builder; it's a bit like Function Builder and it will be easy to discover its procedure.
6. Save and activate your interface.
B. Calling your BAdI from an application program
1. Declare a reference variable with reference to the Business Add-In interface.
e.g. DATA exit_ref TYPE REF TO zif_ex_test.
2. Call the static method GET_INSTANCE of the service class CL_EXITHANDLER. This returns an instance of the required object.
e.g.
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
CHANGING instance = exit_ref .
3. After those two steps, you can now call all of the methods of the BAdI where it is required in your program. Make sure you specify the method interfaces correctly.
C. BAdI Implementations
1. SE19
2. Enter the name for the BAdI implementation to be created in customer namespace and press "Create".
3. It will request the BAdI definition name to which this implementation will be tied.
4. Enter a definition for your implementation and on the interface tab enter a name for the implementing class. Again SAP proposes a name and it is pretty good.
e.g for "ZIMPTEST", SAP proposes "ZCL_IM_IMPTEST".
5. Save your implementation.
6. To implement a method, just double-click on the method name and you will be taken to the Class Builder to write the code for it. Here you redefine the BAdI interface methods.
7. You must activate your implementation to make it executable. You can only activate or deactivate an implementation in its original system without modification. The activation or deactivation must be transported into subsequent systems
That's all. For further details, i.e. filter-dependence, multi-usage, menu nehancements etc... you can have a look at course materials of BC425 "Enhancements and Modifications".
轉:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29829936/viewspace-1598625/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to develop locally a Laravel app using LaragondevLaravelAPPGo
- How to update BOL entity property value via ABAP code
- 根據ABAP BAdI definition名稱找到SPRO裡配置路徑的辦法
- How to ssh
- PostgreSQL DBA(136) - Develop(Common Mistakes)SQLdev
- PostgreSQL DBA(122) - Develop(EDB package)SQLdevPackage
- Oracle vs PostgreSQL Develop(17) - ARRAYOracleSQLdev
- Oracle vs PostgreSQL Develop(15) - DISTINCT ONOracleSQLdev
- Oracle vs PostgreSQL Develop(18) - BooleanOracleSQLdevBoolean
- How to find dependency
- Oracle vs PostgreSQL Develop(16) - Prepared StatementOracleSQLdev
- Would you like to develop a story for your character?dev
- PostgreSQL DBA(99) - Develop(generate random string)SQLdevrandom
- PostgreSQL DBA(135) - Develop(Avoiding “OR” for better query)SQLdev
- PostgreSQL DBA(118) - Develop(Seamless Application Failover)SQLdevAPPAI
- Oracle vs PostgreSQL Develop(20) - Materialized ViewOracleSQLdevZedView
- Oracle vs PostgreSQL Develop(19) - PIPE ROWOracleSQLdev
- Oracle vs PostgreSQL Develop(28) - function overloadOracleSQLdevFunction
- PostgreSQL DBA(169) - Develop(Distinct vs Group by)SQLdev
- Oracle vs PostgreSQL Develop(26) - ASCII 0OracleSQLdevASCII
- Oracle vs PostgreSQL Develop(29) - COMMIT in PLSQLOracleSQLdevMIT
- 外行假裝內行,我也來談談SAP BAPI和BADIAPI
- docker(一):Develop faster. Run anywhere.DockerdevAST
- PostgreSQL DBA(155) - Develop(“大表”連線)SQLdev
- Oracle vs PostgreSQL Develop(24) - subquery with agg functionOracleSQLdevFunction
- Oracle vs PostgreSQL Develop(31) - Index Only ScanOracleSQLdevIndex
- [譯] WebAssembly: How and whyWeb
- How OpenStack integrates with Ceph?
- How to Build a Cybersecurity CareerUI
- CISO之What & How
- How to Restart Qt ApplicationRESTQTAPP
- How Python list works?Python
- How to Install psql on MacSQLMac
- How to Install LibreOffice on UbuntuUbuntu
- PostgreSQL DBA(124) - Develop(Putting multiple LIKE patterns into an array)SQLdev
- PostgreSQL DBA(127) - Develop(JDBC failover&load balance)SQLdevJDBCAI
- PostgreSQL DBA(131) - Develop(numeric vs float vs int)SQLdev
- Oracle vs PostgreSQL Develop(30) - Index&Case whenOracleSQLdevIndex
- How to make sense of Kotlin coroutinesKotlin