Ansicht
Dokumentation

BADI_SLS_BTN_CUS - BAdI: Provide Additional Buttons for Custom Use

BADI_SLS_BTN_CUS - BAdI: Provide Additional Buttons for Custom Use

ROGBILLS - Synchronize billing plans   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Use

This Business Add-In (BAdI) is used in the Sales(SD-SLS) component.
You can use this BAdI to enable custom buttons in Sales SAP GUI transactions for document maintenance such as VA01, VA02, VA03, VA21, and VA22, for example, in the Sales and Distribution (SD) area. These buttons allow for individualized and faster navigation, which is especially useful for actions that are often used and that should be accessible by one click instead of lengthy navigation through menu.

The buttons can be enabled on document overview screens.
Buttons on header level are placed beside the existing header data, buttons on item level are integrated in items table control and are placed within individual item lines in separate columns. With the help of table control settings, you can influence the width and placement of the button columns according to your business needs.
You can activate up to three buttons at header level and up to three buttons at item level. Each button is activated individually.

BAdI Methods

You can use the Business Add-In (BAdI) method GET_TEXTto activate a button by providing either an icon or text. You can do so by filling the export parameter EV_TEXTall in one string. To build a button description, you can either use function module ICON_CREATEor fill the string with your own code.
Import parameter IV_NAMEcontains the name of the button that is currently processed. You can handle each single button individually.
Import parameter IS_TVAKcontains the attributes of the document type that is currently processed. This allows you to distinguish between different document types according to your business needs. You could, for example, activate a button only for contracts by configuring the document category G (Contract) (IS_TVAK-VBTYP).

You can use the Business Add-In (BAdI) method GET_FCODEto assign function codes (fcodes) to buttons. Use existing function codes for menu points from the called transaction, such as VA02, for example.
If the menu point is inactive, the button will become inactive, too, but it will still be visible. If you assign function codes that the current transaction cannot handle, the error message V0104“Requested function & is not available here” will be raised.
Import parameter IV_NAMEcontains the name of the button that is currently processed.
You can provide a function code of your choice in export parameter EV_FCODE.

Standard settings

The following buttons are already defined on screen, but are inactive and have dummy function codes assigned to them by default. Without a BAdI implementation, they are invisible:

  • BT_CUSTOM_HEAD1
  • BT_CUSTOM_HEAD2
  • BT_CUSTOM_HEAD3
  • BT_CUSTOM_ITEM1
  • BT_CUSTOM_ITEM2
  • BT_CUSTOM_ITEM3

With your BAdI implementation, you can activate the buttons and assign function codes (fcodes) of your choice.

For more information about the standard settings (filters, single or multiple uses), see the Enhancement Spot Element Definitions tab in the BAdI Builder (transaction SE18).

Activities

Activate a button by providing an icon and a text using the Business-Add in (BAdI) method GET_TEXT.

Assign existing function codes for menu points according to the intention of your BAdI using BAdI method GET_FCODE.

Example

You can find example classes in the BAdI Builder on the Enhancement Spot Element Definitionstab in the Implementation Example Classessection. The following example class is available:

  • CL_SLS_BTN_CUS_DEMO

The example shows different possibilities on how to provide texts and icons for custom buttons and on how to assign function codes. All used function codes are taken from menu points of transactions VA01, VA02, and VA03.
Which of the various possibilities you choose is completely up to you. You can assign texts and function codes directly, define user parameter with which users can define texts and function codes for button individually, and design complex determination procedures according to your business needs.

Notes

The BAdI is called for each button. The button names as listed in the section Standard Settings(BT_CUSTOM_HEAD1, BT_CUSTOM_HEAD2 etc.) are provided.

For custom buttons on document item level, the BAdI is first called for the table control column. If you do not provide a text, the column is disabled completely. If you provide text, the column is visible. For each displayed line item, the BAdI is called once more to implement the button in this line item. The program design requires identical buttons in the same column, so you should not vary buttons within one column.,,

More Information

For information about implementing BAdIs as part of the enhancement framework, see SAP Libraryfor SAP NetWeaver Platformon SAP Help Portal at http://help.sap.com/nw_platform. Choose a release, and then Application Help. In SAP Library, choose SAP NetWeaver Library: Function-Oriented View> Application Server>Application Server ABAP>Application Development on AS ABAP>Customer-Specific ABAP Development>Enhancement Framework.






PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 6379 Date: 20240524 Time: 012950     sap01-206 ( 121 ms )