BAdI: Customer-defined Functions in Formula Builder
Use
This Business Add-In (BAdI) is used in the formula builder transformation library. You use this BAdI to integrate user-defined functions into the transformation library of the formula builder. In this way, you can make special functions that are not contained in the transformation library available for regular use.
Requirements
The technical name of a user-defined function
- Must be specified
- Must be unique
- Must begin with 'C_'
- Can contain only alphanumeric characters ( ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_) (lower-case letters, empty spaces and special characters are not allowed)
- Can be a maximum of 61 characters long.
Standard settings
The BAdI can be used repeatedly. Is it not filter-dependent.
Activities
After you have called up the IMG activity, a dialog box appears in which you enter a name for implementation.
If implementations have already been created for this BAdI, a dialog box appears in which the existing implementations are displayed. In this dialog box, choose Create and proceed as follows:
- 1. In the
- 2. The initial screen for creating BAdI implementations appears.
- 3. In the initial screen, in the
- 4. Choose the
- 5. On the tab page, the field
- 6. Save your entries and assign the implementation to a development class.
- 7. Position the cursor on the method and double-click on it to reach the method editing screen.
- 8. Between the statements
- 9. Save and activate your coding and return to the
- 10. Save your entries on the
- Note: You can create an implementation for a BAdI and activate it later. If this is the case, close the editing screen now.
- 11. Choose
- When you execute the application program, the coding you defined in the method is run through.
See also:
Method
***************************************************
Read User-Defined Functions
Functionality
The ABAP methods specified under class and method in the function description are later called up in the maintenance and evaluation for formulas. For this reason, the customer-defined functions must be implemented as methods in a separate class, in additional to BAdI implementation. These methods must have the following properties:
- They need to be declared static and public.
- The are only allowed importing-, exporting- and returning parameters. Changing parameters are not allowed.
- They are only allowed one exporting or returning parameter.
- Exporting parameters are not allowed to have a generic type.
Note: The system does not check to see whether the class or method specified in BAdI implementation actually exists. If the class or method does not exist, a runtime error occurs when using the functions in the Formula Builder.
Parameters
I_KEY | Importing parameters: Key with function category | |
C_OPERANDS | Changing parameters: Table with function description |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7941665/viewspace-970848/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7941665/viewspace-970848/