BAdI: Customer-defined Functions in Formula Builder

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. 1. In the
Implementation field, enter a name for the implementation of the BAdIs and choose Create.
  1. 2. The initial screen for creating BAdI implementations appears.
  1. 3. In the initial screen, in the
Short Text for Implementation field, enter a short text for the implementation.
  1. 4. Choose the
Interface tab index.
  1. 5. On the tab page, the field
Name of Implemented Class is filled automatically, since the system assigns a class name based on the name of your implementation.
  1. 6. Save your entries and assign the implementation to a development class.
  1. 7. Position the cursor on the method and double-click on it to reach the method editing screen.
  1. 8. Between the statements
method ~. and endmethod. the coding for your implementation.
  1. 9. Save and activate your coding and return to the
Change Implementation screen.
  1. 10. Save your entries on the
Change Implementation screen.
  • Note: You can create an implementation for a BAdI and activate it later. If this is the case, close the editing screen now.
  1. 11. Choose
Activate.
  • When you execute the application program, the coding you defined in the method is run through.

See also:

Method

GET

***************************************************

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_KEYImporting parameters: Key with function category
C_OPERANDSChanging parameters: Table with function description
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7941665/viewspace-970848/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7941665/viewspace-970848/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值