Class ERPLO_APICustomerExitsImpl
- All Implemented Interfaces:
ERPLO_APICustomerExits
Before and after every remote function call in the WrapperIsaR3Lrd classes, a customer method is called. By default
the methods are doing nothing, that means, they have an empty implementation. To implement single customer methods,
the ERPLO_APICustomerExits class has to be subclassed and the desired methods have to be overwritten.
To activate the customer exit, an entry has to be changed in the factory-config.xml configuration file.
The className attribute has to be changed, so that it contains the name of the subclass, mentioned
above.
reuseInstance attribute makes sure, that a once created instance of the customer exit class is
reused in every call (lean singleton).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<LrdFieldExtension.FieldType,LrdFieldExtension> Map of extension fieldsprotected static final Log4JWrapperLogging instance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomerExitAfterGetAll(SalesDocument businessObjectInterface, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Customer exit which is executed after the data returned from the JCO call has been processed
GetAllStrategyprotected voidcustomerExitAfterGetAllItemPricingAttributes(com.sap.conn.jco.JCoTable ttItemComR, com.sap.conn.jco.JCoTable ttItemComV, Item item, Map<String, Map<String, String>> itemPriceAttributes) Use this exit if you want to add additional item pricing parameters.voidcustomerExitAfterGetAllItemRPricingAttributes(com.sap.conn.jco.JCoTable ttItemComR, Item itm, Map<String, String> ipcPriceAttributes) This is called after putting price relevant attributes from item table TT_ITEM_COMR to the map of ipc item attributes.voidcustomerExitAfterGetAllItemVPricingAttributes(com.sap.conn.jco.JCoTable ttItemComV, Item itm, Map<String, String> ipcPriceAttributes) This is called after putting price relevant attributes from TT_ITEM_COMV to the map of ipc item attributes.voidcustomerExitAfterGetAllJCOCall(SalesDocument salesdocument, com.sap.conn.jco.JCoFunction function, JCoConnection connection, Log4JWrapper logging) Customer exit which is executed directly after the JCO call to ERP for reading a sales document.voidcustomerExitAfterLoad(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) This customer exit is called after
ConstantsR3Lrd.FM_LO_API_DO_ACTIONSor
ConstantsR3Lrd.FM_LO_API_LOAD
are executed.voidcustomerExitAfterSave(boolean commit, com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper log) Customer exit called after JCO call ofConstantsR3Lrd.FM_LO_API_SAVEis donevoidcustomerExitAfterSet(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Customer exit called after JCO call ofConstantsR3Lrd.FM_LO_API_SETis donevoidcustomerExitAfterSetActiveFields(com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper log) Use this exit if you want to use additional parameters after function modules >ERP_LORD_SET_ACTIVE_FIELDS< ,voidcustomerExitBeforeGetAll(SalesDocument businessObjectInterface, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Customer exit which is executed directly before the JCO call to ERP.voidcustomerExitBeforeLoad(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Use these exits if you want to use additional parameters for function modules ERP_LORD_LOAD ERP_LORD_GETALL ERP_LORD_SETvoidcustomerExitBeforeSave(boolean commit, com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper logging) Use this exit if you want to use additional parameters before function modules >ERP_LORD_SAVE< ,voidcustomerExitBeforeSet(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Customer exit called before JCO call ofConstantsR3Lrd.FM_LO_API_SETis donevoidcustomerExitBeforeSetActiveFields(com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper logging) Use this exit if you want to use additional parameters before function modules >ERP_LORD_SET_ACTIVE_FIELDS< ,Use this exit, if you want to expose your LO-API field extensions also to the Web Channel.booleancustomerExitIsItemChanged(Item currentItem, Item existingItem) With this customer exit it is possible to do further checks if items have been changed.voidsetMessageMapper(BackendMessageMapper messageMapper) Sets message mapper (backend messages -> BOL messages, refer to messages.xml)
-
Field Details
-
sapLogger
Logging instance -
extensionFields
Map of extension fields
-
-
Constructor Details
-
ERPLO_APICustomerExitsImpl
public ERPLO_APICustomerExitsImpl()
-
-
Method Details
-
getMessageMapper
- Returns:
- Mapper (backend messages -> BOL messages, refer to messages.xml)
-
setMessageMapper
Sets message mapper (backend messages -> BOL messages, refer to messages.xml)- Parameters:
messageMapper-
-
customerExitBeforeLoad
public void customerExitBeforeLoad(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Use these exits if you want to use additional parameters for function modules- ERP_LORD_LOAD
- ERP_LORD_GETALL
- ERP_LORD_SET
- Specified by:
customerExitBeforeLoadin interfaceERPLO_APICustomerExits- Parameters:
salesDoc- The sales document (e.g. basket, order)func- The JCO function which allows to access all related JCO data for this function modulecn- The JCO connection which would allow to additionally call a function modulelogging- Allow to log some useful debugging informations
-
customerExitAfterLoad
public void customerExitAfterLoad(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Description copied from interface:ERPLO_APICustomerExitsThis customer exit is called after
ConstantsR3Lrd.FM_LO_API_DO_ACTIONSor
ConstantsR3Lrd.FM_LO_API_LOAD
are executed.- Specified by:
customerExitAfterLoadin interfaceERPLO_APICustomerExits- Parameters:
salesDoc- BO representation of sales documentfunc- JCO functioncn- connection to ERP systemlogging- if additional tracing/logging is necessary
-
customerExitBeforeGetAll
public void customerExitBeforeGetAll(SalesDocument businessObjectInterface, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Description copied from interface:ERPLO_APICustomerExits- Specified by:
customerExitBeforeGetAllin interfaceERPLO_APICustomerExits- Parameters:
businessObjectInterface- BO representation of sales documentfunc- JCO function, including all importing, exporting and table parameterscn- connection to ERP systemlogging- if new tracing/logging is needed
-
customerExitAfterGetAllItemPricingAttributes
protected void customerExitAfterGetAllItemPricingAttributes(com.sap.conn.jco.JCoTable ttItemComR, com.sap.conn.jco.JCoTable ttItemComV, Item item, Map<String, Map<String, String>> itemPriceAttributes) Use this exit if you want to add additional item pricing parameters. It is called twice per item, first time for tablettItemComRand second time forttItemComV.
Example:
if (ttItemComR != null) {
itemPriceAttributes.add("attribute from table ttItemComR", ttItemComR.getString("attribute"));
}
// item's extension data had been set in @see #customerExitAfterGetAll
String attribValue = item.getExtensionData("your pricing attribute name");
itemPriceAttributes.add("your pricing attribute name", attribValue);
Please keep in mind that the new attributes might need to be mapped to CRM values via function module
CRM_ERP_ECO_CFG_PRC_ATTR.- Parameters:
ttItemComR- Table TT_ITEM_COMR from function moduleERP_LORD_GET_ALL. Table pointer is already set to the current item.
Will benullif not available!
IMPORTANT: DON'T change table pointer with commands likettItemComR.firstRow()or so.ttItemComV- Table TT_ITEM_COMV from function moduleERP_LORD_GET_ALL. Table pointer is already set to the current item.
Will benullif not available!
IMPORTANT: DON'T change table pointer with commands likettItemComV.firstRow()or so.item- The current itemitemPriceAttributes- The item's price attribute map.
-
customerExitAfterGetAll
public void customerExitAfterGetAll(SalesDocument businessObjectInterface, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Description copied from interface:ERPLO_APICustomerExitsCustomer exit which is executed after the data returned from the JCO call has been processed
GetAllStrategy- Specified by:
customerExitAfterGetAllin interfaceERPLO_APICustomerExits- Parameters:
businessObjectInterface- BO representation of sales documentfunc- JCO function, including importing, exporting, table parameterscn- connection to ERPlogging- if additional tracing/logging is needed
-
customerExitBeforeSet
public void customerExitBeforeSet(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Description copied from interface:ERPLO_APICustomerExitsCustomer exit called before JCO call ofConstantsR3Lrd.FM_LO_API_SETis done- Specified by:
customerExitBeforeSetin interfaceERPLO_APICustomerExits- Parameters:
salesDoc- sales document which is updated in the back endfunc- JCO functioncn- JCO connectionlogging- if additional tracing/logging is necessary
-
customerExitAfterSet
public void customerExitAfterSet(SalesDocument salesDoc, com.sap.conn.jco.JCoFunction func, JCoConnection cn, Log4JWrapper logging) Description copied from interface:ERPLO_APICustomerExitsCustomer exit called after JCO call ofConstantsR3Lrd.FM_LO_API_SETis done- Specified by:
customerExitAfterSetin interfaceERPLO_APICustomerExits- Parameters:
salesDoc- sales document which is updated in the back endfunc- JCO functioncn- JCO connectionlogging- if additional tracing/logging is necessary
-
customerExitBeforeSave
public void customerExitBeforeSave(boolean commit, com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper logging) Use this exit if you want to use additional parameters before function modules >ERP_LORD_SAVE< ,- Specified by:
customerExitBeforeSavein interfaceERPLO_APICustomerExits- Parameters:
commit- Indicates if the document should be committed or notfunction- The JCO function which allows to access all related JCO data for this function modulecn- The JCO connection which would allow to additionally call a function modulelogging- Allow to log some useful debugging informations
-
customerExitAfterSave
public void customerExitAfterSave(boolean commit, com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper log) Description copied from interface:ERPLO_APICustomerExitsCustomer exit called after JCO call ofConstantsR3Lrd.FM_LO_API_SAVEis done- Specified by:
customerExitAfterSavein interfaceERPLO_APICustomerExits- Parameters:
commit- Specifies if the save should be committed alsofunction- JCO functioncn- JCO connectionlog- if additional tracing/logging is necessary
-
customerExitBeforeSetActiveFields
public void customerExitBeforeSetActiveFields(com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper logging) Use this exit if you want to use additional parameters before function modules >ERP_LORD_SET_ACTIVE_FIELDS< ,- Specified by:
customerExitBeforeSetActiveFieldsin interfaceERPLO_APICustomerExits- Parameters:
function- The JCO function which allows to access all related JCO data for this function modulecn- The JCO connection which would allow to additionally call a function modulelogging- Allow to log some useful debugging informations
-
customerExitAfterSetActiveFields
public void customerExitAfterSetActiveFields(com.sap.conn.jco.JCoFunction function, JCoConnection cn, Log4JWrapper log) Use this exit if you want to use additional parameters after function modules >ERP_LORD_SET_ACTIVE_FIELDS< ,- Specified by:
customerExitAfterSetActiveFieldsin interfaceERPLO_APICustomerExits- Parameters:
function- The JCO function which allows to access all related JCO data for this function modulecn- The JCO connection which would allow to additionally call a function modulelog- Allow to log some useful debugging informations
-
customerExitGetExtensionFields
Description copied from interface:ERPLO_APICustomerExitsUse this exit, if you want to expose your LO-API field extensions also to the Web Channel.- Specified by:
customerExitGetExtensionFieldsin interfaceERPLO_APICustomerExits- Returns:
- map containing all extended fields
-
customerExitIsItemChanged
With this customer exit it is possible to do further checks if items have been changed. E.g. if one introduced extension data per item, it's necessary to check on this data to decide whether this item needs to be sent to ERP or not. Note that this is relevant only if delta mode is DELTA_HANDLING_READ_ALL, DELTA_HANDLING_SEND_READ_CHANGED. The method is called if all other checks indicate that nothing has been changed on item level!- Specified by:
customerExitIsItemChangedin interfaceERPLO_APICustomerExits- Parameters:
currentItem- Current state of WEC itemexistingItem- ERP state of WEC item- Returns:
- Were there changes?
-
customerExitAfterGetAllItemRPricingAttributes
public void customerExitAfterGetAllItemRPricingAttributes(com.sap.conn.jco.JCoTable ttItemComR, Item itm, Map<String, String> ipcPriceAttributes) Description copied from interface:ERPLO_APICustomerExitsThis is called after putting price relevant attributes from item table TT_ITEM_COMR to the map of ipc item attributes.- Specified by:
customerExitAfterGetAllItemRPricingAttributesin interfaceERPLO_APICustomerExits- Parameters:
ttItemComR- Table of type TDT_RFC_ITEM_COMRitm- Sales itemipcPriceAttributes- Map of attributes
-
customerExitAfterGetAllItemVPricingAttributes
public void customerExitAfterGetAllItemVPricingAttributes(com.sap.conn.jco.JCoTable ttItemComV, Item itm, Map<String, String> ipcPriceAttributes) Description copied from interface:ERPLO_APICustomerExitsThis is called after putting price relevant attributes from TT_ITEM_COMV to the map of ipc item attributes.- Specified by:
customerExitAfterGetAllItemVPricingAttributesin interfaceERPLO_APICustomerExits- Parameters:
ttItemComV- Table of type TDT_RFC_ITEM_COMVitm- Sales itemipcPriceAttributes- Map of attributes
-
customerExitAfterGetAllJCOCall
public void customerExitAfterGetAllJCOCall(SalesDocument salesdocument, com.sap.conn.jco.JCoFunction function, JCoConnection connection, Log4JWrapper logging) Description copied from interface:ERPLO_APICustomerExitsCustomer exit which is executed directly after the JCO call to ERP for reading a sales document.
GetAllStrategy- Specified by:
customerExitAfterGetAllJCOCallin interfaceERPLO_APICustomerExits- Parameters:
salesdocument- BO representation of sales documentfunction- JCO function, including importing, exporting, table parametersconnection- connection to ERPlogging- if additional tracing/logging is needed
-