BADIs Available in SRM
BADIs Available in SRM
0
(corresponding to Shopping Cart)
1
Contents
BBP_CATALOG_TRANSFER: ........................................................................................................................... 3
BBP_CREATE_BE_PO_NEW: .......................................................................................................................... 3
How to debug BBP_CREATE_BE_PO_NEW ? ............................................................................................ 4
BBP_DOC_CHECK_BADI: ............................................................................................................................... 6
Check Purchasing Document .................................................................................................................... 6
Standard settings ...................................................................................................................................... 7
For shopping cart (SC) ........................................................................................................................... 7
For invoice (IV) ...................................................................................................................................... 7
Check Payment Reference .................................................................................................................... 8
Further implementation options: ............................................................................................................. 8
BBP_CREATE_BE_RQ_NEW:.......................................................................................................................... 8
Standard settings ...................................................................................................................................... 9
BBP_ACCCAT_MAP_EXP: .............................................................................................................................. 9
Use ............................................................................................................................................................ 9
Standard settings ...................................................................................................................................... 9
Activities .................................................................................................................................................... 9
Example ................................................................................................................................................. 9
Further notes .......................................................................................................................................... 10
BBP_CUF_BADI_2:....................................................................................................................................... 10
Procedure for Adding Customer fields in SC : ......................................................................................... 11
BBP_APPEND_ITEM: ................................................................................................................................... 11
BBP_DOC_CHANGE ..................................................................................................................................... 12
Method - BBP_SC_CHANGE .................................................................................................................... 12
BBP_SC_MODIFY_UI: .................................................................................................................................. 12
Use .......................................................................................................................................................... 13
Standard settings .................................................................................................................................... 13
Changing Parameters and corresponding menu item ............................................................................ 13
BBP_UI_CONTROL_BADI: ............................................................................................................................ 13
BBP_WFL_APPROV_BADI............................................................................................................................ 14
2
BBP_CATALOG_TRANSFER:
You can use the Business Add-In BBP_CATALOG_TRANSFER to change or add to the data that the catalog
returns to SAP Enterprise Buyer via the catalog interface.
Note that your changes also affect the following applications in SAP Enterprise Buyer:
BBP_CREATE_BE_PO_NEW:
Using Business Add-In BBP_CREATE_BE_PO_NEW you can change all the data that is transferred to the
backend system for generation of a purchase order. This includes, for example, the item data, the
account assignment data, and texts.
All the shopping cart data is available as input parameters.
For transferring shopping cart attachments to backend system BADI- BBP_CREATE_BE_PO_NEW is used
as mentioned below.
Documentation
Method IF_EX_BBP_CREATE_BE_PO_NEW~FILL_PO_INTERFACE1.
* Enable transfer of attachments in classic scenario
cs_ctrl_att-BE_DOC_TYPE = 'SRM'.
cs_ctrl_att-TRANSFER_ACTIVE = 'X'.
endmethod.
3
How to debug BBP_CREATE_BE_PO_NEW ?
SRM Function: BBP_PD_SC_TRANSFER_INTERNAL OR Function BBP_REQREQ_TRANSFER (Goto SE37 and
Test the function module. You could get the GUID from BBP_PD transaction)
Create Breakpoint at LBBP_PD_SCF0J PERFORM delete_not_tansferable_items - delete all lines from
ET_STATUS[] ( If you are using BBP_PD_SC_TRANSFER_INTERNAL )
Create Breakpoint at BADI implementation of yours
Breakpoint at class CL_BBP_BS_ADAPTER_PO_CRT_470_1CM004->CREATE_DOCUMENT statement
CALL FUNCTION 'BAPI_PO_CREATE1'
( The RFC user should have dialog authorization to debug inside 'BAPI_PO_CREATE1')
lh_item_account-po_item = lh_cs_item-po_item.
lh_item_account-serial_no = lh_cs_account-serial_no.
lh_extensionin-valuepart1 = lh_item_account.
clear lh_extensionin.
lh_extensionin-structure = 'BAPI_TE_MEPOACCOUNTINGX'.
lh_item_accountx-po_item = lh_cs_item-po_item.
lh_item_accountx-serial_no = lh_cs_account-serial_no.
lh_item_accountx-yourcustomefieldname = 'X'.
lh_extensionin-valuepart1 = lh_item_accountx.
The following two methods are available depending on the BAPIs used to generate the backend
purchase order:
4
FILL_PO_INTERFACE1
when using BAPI BAPI_PO_CREATE1
This method of BADI BBP_CREATE_BE_PO_NEW is used when a purchase order is created in the backend
using BAPI_PO_CREATE1.
Parameters
Importing:
IS_SC_DOCUMENT
Extended shopping cart data
IS_CONTROL
Transfer structure of the control fields
Changing:
CS_CTRL_ATT
Transfer structure for attachments
(Data structure BBPS_BADI_CTRL_ATTACHMENT)
CS_PO1_DOCUMENT
Backend purchase order data for transfer to BAPI_PO_CREATE1
(Data structure BBPS_BADI_PO_CREATE1)* FILL_PO_INTERFACE
when using BAPI BAPI_PO_CREATE
This method of BADI BBP_CREATE_BE_PO_NEW is used when a purchase order is created in the backend
using BAPI_PO_CREATE .
Parameters* Importing:
IS_SC_DOCUMENT
Extended shopping cart data
IS_CONTROL
Transfer structure of the control fields
Changing:
CS_CTRL_ATT
Transfer structure for attachments
(Data structure BBPS_BADI_CTRL_ATTACHMENT)
CS_PO_DOCUMENT
Backend purchase order data for transfer to BAPI_PO_CREATE
(Data structure BBPS_BADI_PO_CREATE)
5
BBP_DOC_CHECK_BADI:
BBP_DOC_CHECK_BADI is used for custom validations on the data entered by the user while posting
business documents. Business document being processed is identified by the filter values mentioned in
the BADI implementation.
The BAdI (s.Business Add-In) BBP_DOC_CHECK_BADI is suitable for checks of the document header,
single items or the entire document. In BAdI BBP_DOC_CHECK_BADI all the items exist but you cannot
yet recognize which items have been newly created or changed. For this reason, all items must always
be checked in this BAdI.
Using BAdI BBP_DOC_CHECK_BADI, you can carry out your own checks for the document data after you
have entered the user and before you save the document to the database. You cannot change any data.
BBP_DOC_CHECK_BADI - Checking_Multiple_Entries_of_Invoice
Checks
1. Document header
2. Single item
3. Entire document
For performance reasons, checks of the second category (item checks) should only be carried out when:
The BAdI (s. Business Add-In) BBP_DOC_CHECK_BADI is suitable for checks of categories 1 and 3. In BAdI
BBP_DOC_CHECK_BADI all the items exist but you cannot yet recognize which items have been newly
created or changed. For this reason, all items must always be checked in this BAdI. For performance
reasons, it is recommended to use BAdI BBP_ITEM_CHECK_BADI for checks of category 2 (purely item
checks).
Using BAdI BBP_DOC_CHECK_BADI, you can carry out your own checks for the document data after you
have entered the user and before you save the document to the database. You cannot change any data.
6
FLT_VAL
Filter value to enable you to assign the implementation to a specific document type
IV_DOC_GUID
Document GUID with which you access the document data
IV_MODE
you can control the checks dependent on this mode.
Value area: C (CREATE), U (UPDATE), T (CHECK).
IV_PARK and IV_SAVE
Supplementary indicators showing when and if the BAdI is called up when holding or saving the
document. The system sets these parameters dependent on IV_MODE.
ET_MESSAGES
you output the results of your checks in this table.
Note:
Before each call-up of the method, the system deletes the table of error messages.
Standard settings
For shopping cart (SC)
When holding and ordering the SC, the system calls the method twice:
IV_MODEIV_PARKIV_SAVE
IV_MODEIV_PARKIV_SAVE
If your implementation contains a query for parameter IV_PARK or IV_SAVE, you must also incorporate a
check via the parameter IV_MODE = T because otherwise, no error messages are displayed on the
interface. When the shopping cart is checked, the system also calls the method twice:
IV_MODEIV_PARKIV_SAVE
IV_MODEIV_PARKIV_SAVE
In the check for parameter IV_PARK or IV_SAVE, error messages only appear on the interface if you
implement an additional request for IV_MODE = T.
The vendor invoice number is entered when an invoice is entered. The system checks if the number has
already been used within a certain period. If this is the case, the system outputs an error message.
7
Previously the use of the vendor invoice number is checked for the period of the last seven days.
To modify this period, you use the implementation BBP_IV_CHK_REFDOCNO. In the standard the
implementation is not active the sample coding proposes a check from 01.01. Of the current year as
default.
In addition, you can modify the type of message that the system outputs if the vendor invoice number
has already been used. To do this, use activity Influence Message Control in the implementation guide
(Supplier Relationship Management -> SRM Server ->Cross-Application Basic Settings -> Message
Control).
SAP delivers a BAdI implementation for checking the payment reference in invoices - common in some
Scandinavian countries.
The payment reference is entered when an invoice is entered and also checked for validity - if the
country of the requester is either Finnland, Norway or Sweden. In these countries, rules exist for the
structure of a payment reference and a check digit procedure serves to ensure that the structures are
observed.
The implementation is not active in the standard and can be activated if necessary. You can find the field
in the template SAPLBBP_IV03 3000.
If the payment reference number to be checked is invalid, the system saves an appropriate message in a
table and the implementation transfers the table to the calling program. The error message itself is not
processed within the implementation by the system.
For invoice
You can make settings such that invoices can only be created on the basis of confirmations already
accepted by customers.
BBP_CREATE_BE_RQ_NEW:
Purchase Requisition in Backend System
Using Business Add-In BBP_CREATE_BE_RQ_NEW you can change all the data that is transferred to the
backend system for generation of a requirement. This includes, for example, item data, account
8
assignment data, and texts. You can access all the shopping cart data in the method
FILL_RQ_INTERFACEfor generation of the backend reservation via the BAPI BAPI_REQUISITION_CREATE.
Standard settings
The settings for this BAdI override those of BAdI Grouping of Shopping Cart Items for Follow-on
Documents (BBP_BS_GROUP_BE). BBP_CREATE_BE_RQ_NEW is called up following call-up of
BBP_BS_GROUP_BE and shortly before the documents are created in the backend.
BBP_ACCCAT_MAP_EXP:
In SRM you can define account assignment in below path :
To map account assignment categories defined in above step to backend use badi
BBP_ACCCAT_MAP_EXP .
Use
You can use the Business Add-In BBP_ACCCAT_MAP_EXP to change the account assignment category
you create a backend purchasing document from a shopping cart (in the Enterprise Buyer system).
This BADI is also used when a confirmation is transferred to the backend system. A service entry sheet is
created from the confirmation.
Standard settings
In the standard system, the setting in the Customizing activity <DS:SIMG.BBP_VC_KONT>Define Account
Assignment Categories determines that an account assignment category from the backend system is
assigned to each of the account assignment categories of the Enterprise Buyer system. You can use this
BAdI to change this account assignment category.
Activities
Method ACCCAT_MAP_EXP provides the following three parameters:
Example
In the backend system, a backend purchase requisition is created from a shopping cart. The account
assignment category K is set up for the backend system to correspond to the account assignment
category CC of the Enterprise Buyer system.
9
However, in the target backend system, shopping carts with account assignment category CC should be
created in purchase requisitions with the account assignment category X. In the implementation of BAdI
BBP_ACCCAT_MAP_EXP, you can specify that the account assignment categories are dependent on the
backend system (import parameter).
Further notes
You can make this setting for each individual backend system. Various account assignment categories in
various backend systems can therefore be assigned to the same account assignment category in the
Enterprise Buyer system.
BBP_CUF_BADI_2:
This BAdI enables to control of edit/display attributes of customer-defined fields in shopping cart and
purchase order screen.
The custom fields which are appended to the structure "INCL_EEW_PD_HEADER_CSF_SC" (for header)
, "INCL_EEW_PD_HEADER_CSF_SC" (for item) will appear in the parameter ET_fields.
METHOD if_ex_bbp_cuf_badi_2~modify_screen.
*----------------------------------------------------------------------*
* Description: This BADI implementation enables/disables
* the customer fields
*----------------------------------------------------------------------*
DATA: lt_fields_wa TYPE bbps_cuf_display.
* The Customer fields are enabled by default and their attributes are passed in the parameter ET_fields.
*To disable the Customer fields set the XINPUT and XDISPLAY value to space.
10
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
BBP_APPEND_ITEM:
This BAdI is used to change Shopping Cart Items. You can use the Business Add-In BBP_APPEND_ITEM to
change the most important item data and account assignment data in the shopping cart. In method
APPEND_ITEM, two table parameters are available:
ITEM_DATA
This contains the most important item data for the shopping cart.
ACCT_DATA
This contains the account assignment data for the item.
11
BBP_DOC_CHANGE
You can use the Business Add-Ins BBP_DOC_CHANGE_BADI to make changes to the document, after
user entry and before saving the document to the database. These changes are subject to the
document-specific checks.
The parameter FLT_VAL acts as a filter value that assigns the BAdI implementation to a particular
document type. You can use the BAdI to change the following documents:
Method - BBP_SC_CHANGE
This method provides parameters for changing shopping carts. When ordering or holding a shopping
cart, there are two BAdI calls:
In the first call, the system fills all the import data.
In the second call, the system only fills the import parameters IS_HEADER and IT_ITEM, for performance
reasons.
In both cases, only those items are available that were changed or added most recently.
BBP_SC_MODIFY_UI:
BBP_SC_MODIFY_UI is used to make changes to the display of shopping cart screen. It is also used to
activate the Describe Requirement functionality in shopping cart screen.
12
Use
You can use the Business Add-In BBP_SC_MODIFY_UI to override the standard settings and tailor the
user interfaces for the shopping cart (wizard and professional) to your own requirements.
In the Add Items area, you can activate/deactivate the Describe Requirement, Add Limit Item, Request
(Service) and Purchase Order (Service) links on the various user interfaces.
Furthermore, on the 'Wizard' interface, you can show the Default Settings for Items area, and on the
'Professional Shopping Cart' interface you can hide this area. This area is not in the Requests application.
Standard settings
The Business Add-In is not active in the standard system. There is no standard implementation.
BBP_UI_CONTROL_BADI:
BADI BBP_UI_CONTROL_BADI is used to control field settings .By implementing this BADI you we can
change the visibility of fields, pushbuttons. BBP_UI_CONTROL_BADI is a filter dependent BADI.
13
Based on the methods you can override the visibility and ready-to-input status of header and item fields,
pushbuttons, and navigation links of the relevant application.
BBP_WFL_APPROV_BADI
view
We can use BBP_WFL_APPROV_BADI for Determining Approvers for n-Level Dynamic
workflow.
14
15