java.lang.Object
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.ERPLO_APICustomerExitsImpl
All Implemented Interfaces:
ERPLO_APICustomerExits

public class ERPLO_APICustomerExitsImpl extends Object implements ERPLO_APICustomerExits
Provides customer exit methods for the R3LRD remote function calls.

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.

The reuseInstance attribute makes sure, that a once created instance of the customer exit class is reused in every call (lean singleton).
  • Field Details

  • Constructor Details

    • ERPLO_APICustomerExitsImpl

      public ERPLO_APICustomerExitsImpl()
  • Method Details

    • getMessageMapper

      public BackendMessageMapper getMessageMapper()
      Returns:
      Mapper (backend messages -> BOL messages, refer to messages.xml)
    • setMessageMapper

      public void setMessageMapper(BackendMessageMapper messageMapper)
      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:
      customerExitBeforeLoad in interface ERPLO_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 module
      cn - The JCO connection which would allow to additionally call a function module
      logging - 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_APICustomerExits
      This customer exit is called after
      ConstantsR3Lrd.FM_LO_API_DO_ACTIONS or
      ConstantsR3Lrd.FM_LO_API_LOAD
      are executed.
      Specified by:
      customerExitAfterLoad in interface ERPLO_APICustomerExits
      Parameters:
      salesDoc - BO representation of sales document
      func - JCO function
      cn - connection to ERP system
      logging - 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
      Customer exit which is executed directly before the JCO call to ERP.
      GetAllStrategy
      Specified by:
      customerExitBeforeGetAll in interface ERPLO_APICustomerExits
      Parameters:
      businessObjectInterface - BO representation of sales document
      func - JCO function, including all importing, exporting and table parameters
      cn - connection to ERP system
      logging - 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 table ttItemComR and second time for ttItemComV.

      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 module ERP_LORD_GET_ALL. Table pointer is already set to the current item.
      Will be null if not available!
      IMPORTANT: DON'T change table pointer with commands like ttItemComR.firstRow() or so.
      ttItemComV - Table TT_ITEM_COMV from function module ERP_LORD_GET_ALL. Table pointer is already set to the current item.
      Will be null if not available!
      IMPORTANT: DON'T change table pointer with commands like ttItemComV.firstRow() or so.
      item - The current item
      itemPriceAttributes - 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_APICustomerExits
      Customer exit which is executed after the data returned from the JCO call has been processed
      GetAllStrategy
      Specified by:
      customerExitAfterGetAll in interface ERPLO_APICustomerExits
      Parameters:
      businessObjectInterface - BO representation of sales document
      func - JCO function, including importing, exporting, table parameters
      cn - connection to ERP
      logging - 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_APICustomerExits
      Customer exit called before JCO call of ConstantsR3Lrd.FM_LO_API_SET is done
      Specified by:
      customerExitBeforeSet in interface ERPLO_APICustomerExits
      Parameters:
      salesDoc - sales document which is updated in the back end
      func - JCO function
      cn - JCO connection
      logging - 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_APICustomerExits
      Customer exit called after JCO call of ConstantsR3Lrd.FM_LO_API_SET is done
      Specified by:
      customerExitAfterSet in interface ERPLO_APICustomerExits
      Parameters:
      salesDoc - sales document which is updated in the back end
      func - JCO function
      cn - JCO connection
      logging - 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:
      customerExitBeforeSave in interface ERPLO_APICustomerExits
      Parameters:
      commit - Indicates if the document should be committed or not
      function - The JCO function which allows to access all related JCO data for this function module
      cn - The JCO connection which would allow to additionally call a function module
      logging - 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_APICustomerExits
      Customer exit called after JCO call of ConstantsR3Lrd.FM_LO_API_SAVE is done
      Specified by:
      customerExitAfterSave in interface ERPLO_APICustomerExits
      Parameters:
      commit - Specifies if the save should be committed also
      function - JCO function
      cn - JCO connection
      log - 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:
      customerExitBeforeSetActiveFields in interface ERPLO_APICustomerExits
      Parameters:
      function - The JCO function which allows to access all related JCO data for this function module
      cn - The JCO connection which would allow to additionally call a function module
      logging - 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:
      customerExitAfterSetActiveFields in interface ERPLO_APICustomerExits
      Parameters:
      function - The JCO function which allows to access all related JCO data for this function module
      cn - The JCO connection which would allow to additionally call a function module
      log - Allow to log some useful debugging informations
    • customerExitGetExtensionFields

      public Map<LrdFieldExtension.FieldType,LrdFieldExtension> customerExitGetExtensionFields()
      Description copied from interface: ERPLO_APICustomerExits
      Use this exit, if you want to expose your LO-API field extensions also to the Web Channel.
      Specified by:
      customerExitGetExtensionFields in interface ERPLO_APICustomerExits
      Returns:
      map containing all extended fields
    • customerExitIsItemChanged

      public boolean customerExitIsItemChanged(Item currentItem, Item existingItem)
      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:
      customerExitIsItemChanged in interface ERPLO_APICustomerExits
      Parameters:
      currentItem - Current state of WEC item
      existingItem - 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_APICustomerExits
      This is called after putting price relevant attributes from item table TT_ITEM_COMR to the map of ipc item attributes.
      Specified by:
      customerExitAfterGetAllItemRPricingAttributes in interface ERPLO_APICustomerExits
      Parameters:
      ttItemComR - Table of type TDT_RFC_ITEM_COMR
      itm - Sales item
      ipcPriceAttributes - Map of attributes
    • customerExitAfterGetAllItemVPricingAttributes

      public void customerExitAfterGetAllItemVPricingAttributes(com.sap.conn.jco.JCoTable ttItemComV, Item itm, Map<String,String> ipcPriceAttributes)
      Description copied from interface: ERPLO_APICustomerExits
      This is called after putting price relevant attributes from TT_ITEM_COMV to the map of ipc item attributes.
      Specified by:
      customerExitAfterGetAllItemVPricingAttributes in interface ERPLO_APICustomerExits
      Parameters:
      ttItemComV - Table of type TDT_RFC_ITEM_COMV
      itm - Sales item
      ipcPriceAttributes - Map of attributes
    • customerExitAfterGetAllJCOCall

      public void customerExitAfterGetAllJCOCall(SalesDocument salesdocument, com.sap.conn.jco.JCoFunction function, JCoConnection connection, Log4JWrapper logging)
      Description copied from interface: ERPLO_APICustomerExits
      Customer exit which is executed directly after the JCO call to ERP for reading a sales document.
      GetAllStrategy
      Specified by:
      customerExitAfterGetAllJCOCall in interface ERPLO_APICustomerExits
      Parameters:
      salesdocument - BO representation of sales document
      function - JCO function, including importing, exporting, table parameters
      connection - connection to ERP
      logging - if additional tracing/logging is needed