0% found this document useful (0 votes)
928 views15 pages

BADIs Available in SRM

This document describes several BADIs (Business Add-Ins) available in SAP Enterprise Buyer (SRM) version 7.0 for customizing the shopping cart and purchase order processes. It provides details on the purpose and standard configuration of BADIs such as BBP_CREATE_BE_PO_NEW for modifying purchase order data transfer, BBP_DOC_CHECK_BADI for document validation, and BBP_SC_MODIFY_UI for customizing the shopping cart user interface. Debugging tips are also included for the BBP_CREATE_BE_PO_NEW BADI.

Uploaded by

Karthik Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
928 views15 pages

BADIs Available in SRM

This document describes several BADIs (Business Add-Ins) available in SAP Enterprise Buyer (SRM) version 7.0 for customizing the shopping cart and purchase order processes. It provides details on the purpose and standard configuration of BADIs such as BBP_CREATE_BE_PO_NEW for modifying purchase order data transfer, BBP_DOC_CHECK_BADI for document validation, and BBP_SC_MODIFY_UI for customizing the shopping cart user interface. Debugging tips are also included for the BBP_CREATE_BE_PO_NEW BADI.

Uploaded by

Karthik Babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

BADI’s AVAILABLE IN SRM 7.

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:

 Confirm Goods Receipt/Service Entry


 Plan Products for Maintenance Order
The call of this BADI occurs in function module 'BBP_WS_IMPORT_SC_DATA'. This module is called by
the relevant application to import catalog items previously sent by the browser of the user to the
application Web server from there. After the catalog has transferred the data to SAP Enterprise Buyer
the system carries out the following actions.

 Conversion of ISO code of unit of measure and currency to SAP format

 Conversion of price field to SAP format

 In the case of transfer of a material or service number:


The system reads the product master with this number. If the number exists, the system transfers from
the product master record the description and the purchase order unit of measure.

 In the case of a partner number:


The system reads the business partner master with this number. If the number does not exist, the
number in the shopping cart item is reset.

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')

How to send customer fields to the backend PO?

The BADI has changing parameter CS_PO1_DOCUMENT-IT_EXTENSIONIN. Append appropriate records


to this structure

Following is an example of passing data to PO Accounting Custom Fieldslh_extensionin-structure =


'BAPI_TE_MEPOACCOUNTING'.

lh_item_account-po_item = lh_cs_item-po_item.

lh_item_account-serial_no = lh_cs_account-serial_no.

lh_item_account-yourcustomefieldname = 'XXX '.

lh_extensionin-valuepart1 = lh_item_account.

append lh_extensionin to <lt_extensionin>.

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.

append lh_extensionin to <lt_extensionin>.

(Debug 'BAPI_PO_CREATE1' to get exact idea about your valuepart structures)

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

In method FILL_PO_INTERFACE1 the following parameters are available:

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.

Below is a list of sample implementations:


BBP_DOC_CHECK_BADI - Checking Payment Reference Number

BBP_DOC_CHECK_BADI - Checking_Multiple_Entries_of_Invoice

Check Purchasing Document


Document checks can be classified in three categories:

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:

 a new item is created,


 an item is changed or
 the entire document is to be checked for consistency (triggered, for example, by choosing the
pushbutton Check).

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.

In method BBP_DOC_CHECK the following parameters are available:

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.

For invoice (IV)

SAP delivers the following BAdI implementation for invoice entry:

Implementation to check the

 Vendor invoice number


 Payment reference in invoices

Check Vendor Invoice Number

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).

Check Payment Reference

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.

Further implementation options:


For service entry sheet

You can enter a maximum number of working hours per day.

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 :

Supplier Relationship Management → SRM Server → Cross-Application Basic Settings → Account


Assignment → define account assignment category

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:

 LOGICAL_SYSTEM (Import) = Logical system of logistics backend


 ENR_ACCT (Import) = account assignment information
 R3_ACC_CAT (Export) = account assignment category in the backend system.

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 BAdI provides the following methods:

 MODIFY_SCREEN - Show/hide field display and restrict edit options


 MODIFY_INPUT - Change the input values
 MODIFY_INPUT - Enter pre-assigned values in the fields to be output

Here is the sample implementation of method MODIFY_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.

LOOP AT et_fields INTO lt_fields_wa.


* Custom field ZZAGE is displayed only for document type ANPO
IF NOT (is_item-zzdoctyp EQ 'ANPO' OR
is_item-be_doc_type EQ ‘ANPO’).
IF lt_fields_wa-fieldname = 'ZZAGE'.
CLEAR: lt_fields_wa-xinput,
lt_fields_wa-xdisplay.

10
ENDIF.
ENDIF.

* Modify the return parameter


MODIFY et_fields FROM lt_fields_wa.
CLEAR lt_fields_wa.

ENDLOOP.

ENDMETHOD.

Procedure for Adding Customer fields in SC :


1. Call Transaction SE11.
2. Create a NEW structure with required customer fields.
3. Choose the structure "INCL_EEW_PD_HEADER_CSF_SC" for header and
"INCL_EEW_PD_ITEM_CSF_SC" for item.
4. Choose 'Append Structure' (F5) tab for above structures Enter the name of the structure
created in step2.
5. We also have to append the structure created in step 2 to "INCL_EEW_PD_HEADER_CSF" for
header and "INCL_EEW_PD_ITEM_CSF" FOR ITEM.
6. The Screen field settings can be modified in BADI BBP_CUF_BADI_2.
7. The Badi has four methods; The Method Modify_screen is used to change the settings of the
field on screen i.e. visible or invisible. In Modify_screen method ET_fields parameter will have
the Customer defined fields.

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:

 Shopping cart (filter value BUS2121 - shopping cart EC)


 Purchase order (filter value BUS2201 - purchase order EC)
 Confirmation (filter value BUS2203 - confirmation of goods/services EC)
 Invoice (filter value BUS2205 - incoming invoice EC)
 Bid invitation (filter value BUS2200 - bid invitation EC)
 Bid (filter value BUS2202 - vendor quotation EC)
 Auction (filter value BUS2208 - auction EC)
 Contract (filter value BUS2000113 - purchase contract EC; global outline agreement)
 Purchase order response (filter value BUS2209 - purchase order response EC)
 SUS purchase order (filter value BUS2230 - purchase order in Supplier Self-Services)
 SUS purchase order response (filter value BUS2232 - purchase order response in Supplier Self-Services)
 SUS confirmation (filter value BUS2233 - confirmation in Supplier Self-Services)
 SUS shipping notification (filter value BUS2231 - shipping notification in Supplier Self-Services)
 SUS invoice (filter value BUS2234 - invoice in Supplier Self-Services)

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.

The BAdI supplies the method SC_MODIFY_SCREEN.

Changing Parameters and corresponding menu item


SPECIAL_REQUEST : With Free Description

PRODUCT : Internal Goods/Services

LIMIT : Limit Item

OLD_PO_AND_TEMP : Old Shopping Carts and Templates

TEMP_LAB : As Service Order

TEMP_LAB_REQUEST : As Service Request

CATALOGS : Corporate Express, SRM MDM Catalog

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.

Below are few methods available in 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.

BBP_WFL_APPROV_BADI is used to determine number of levels in workflow process and number of


approvers present at each step. The approvers and the requirement for further approval steps are
determined before the first approval and after every subsequent approval step. Hence the workflow
approval process can be changed based on every step instead of following same approval chain. Method
GET_REMAINING_APPROVERS is used for determining the approver.

14
15

You might also like