Here I listed some useful BADIs for CRM web channel development, especially for b2b applications. All the function modules for web channel one order functionality is located in function group CRM_ISALES_ORDER(CRM Internet Sales Basket & Order).
This function group contains all the function modules for crm basket. It contains all the basket/order related data at runtime in the memory. Each time, user choose update or simulate button at frontend. The order will be save to the backend and rebuild it in the java side.
CRM_ISA_BASKET_HEAD BADI for Customer-Specific Enhancement of Basket Headers
CRM_ISA_BASKET_ITEMS BADI for Customer-Specific Enhancement of Basket Items
CRM_ISA_BASKET_TEXT Text Maintenance in ISA
CRM_ISA_GEN_DOC_SEL ISA: Generic Document Search
CRM_ISA_STAT_DETAIL Filling the Extension Tables of _BASKET_STATUS_ENH
Function group CRM_ISALES_SHOP(WebAPI Internet Sales: Shop).This function group is used for shop processing. Function module ‘CRM_ISA_SHOP_DATA_GET’ is for reading the detail shop data. But there is no BADI for reading extension data of the shop. You must copy this function module out and add your custom extension in it.
Other BADIs which are also important in CRM.
CRM_SHIPPING_BADI BAdI to Process SHIPPING
CRM_DATAEXCHG_BADI CRM_DATAEXCH_AFTER_BAPI_FILL
In CRM Web Channel, there are several enhancement concept. One of the most tricky one is function module listener. Using function module listener concept, you can intercept function calls to the SAP system. A Java listener can be registered and is notified before and after calling a function module. You can use this listener to manipulate input/output parameters. You also have access to the Backend Context.
This is an example to show how to use function module listener.
Step 1. Create listener class.
Listener class must implement interface ‘com.sap.isa.core.eai.sp.jco.JCoConnectionEventListener‘.
/*
* Created on 2009-10-23
*
* To change the template for this generated file go to
* Window>;Preferences>;Java>;Code Generation>;Code and Comments
*/
package com.yourcompany.isa.event;
import com.honeywell.isa.businessobject.bobpricing.Z_BobPricingConstants;
import com.sap.isa.businessobject.Shop;
import com.sap.isa.core.eai.sp.jco.JCoConnectionEvent;
import com.sap.isa.core.eai.sp.jco.JCoConnectionEventListener;
import com.sap.mw.jco.JCO;
/**
* @author Andy
*
* This class will be called when calling the function module 'CRM_ISA_BASKET_GETTEXT'.
* This function module will use the same text id for both header and item text, so we need to copy this
* function module out to add some more logic.
*/
public class Z_TextGetEventListener implements JCoConnectionEventListener {
/* (non-Javadoc)
* @see com.sap.isa.core.eai.sp.jco.JCoConnectionEventListener#connectionEvent(com.sap.isa.core.eai.sp.jco.JCoConnectionEvent)
*/
public void connectionEvent(JCoConnectionEvent event) {
if(event.getId() == JCoConnectionEvent.BEFORE_JCO_FUNCTION_CALL){
//check whether the item text id is maintained in the shop administrator
Shop shop = (Shop)event.getBackendContext().getAttribute(Z_BobPricingConstants.SHOP);
if(shop == null){
return;
}
String itemTextId = (String)shop.getExtensionData("ZZ_ITEM_TDID");
String headerTextId = (String)shop.getExtensionData("ZZ_HEADER_TDID");
if(itemTextId == null || itemTextId.equals("")){
return;
}
if(headerTextId == null || headerTextId.equals("")){
return;
}
JCO.Function function = event.getJCoFunction();
JCO.Table textTable = function.getTableParameterList().getTable("TEXT_LINE");
//append a new line for the seperate header and item text id
textTable.appendRow();
textTable.setValue((headerTextId + "||" + itemTextId) , "TDLINE");
}
else{
return;
}
}
}
Step 2. Register the class into file ‘modification-config.xml’.
<function-module-listener>
<param name=”fmevent:CRM_ISA_BASKET_GETTEXT” value=”com.honeywell.isa.event.Z_TextGetEventListener”/>
</function-module-listener>
SAP product names always make me confused. I have been working on ECO for ERP and CRM for about one yeaer. But I still confused by it’s offical name in differernt document. Finally, I found an SAP note
Read more…
SAP CRM web channel uses shop management module to add, arrange and configure the shop data for each company/sales area. But the standard setting cannot fulfill the business in the most case, we need to add custom field to the shop. Below are the steps to show how to extend CRM web channel shop data.
Step 1. Extend table CRMM_ISA_SHOP_H. Add a custom append structure to the table.
Step 2. Copy the standard shop read function module CRM_ISA_SHOP_DATA_GET out.
Add the custom field name and value to the extension data of the function module. The max value length of one field is 40. If your field value is larger than 40, you need to split it into several lines and increase the counter. Please refer below code for detail.
Read more…