java.lang.Object
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
Direct Known Subclasses:
GetAllStrategyERP, LrdActionsStrategyERP, SetStrategyERP

public class BaseStrategyERP extends Object
Base class for strategy implementations dealing with ERP LO-API calls
  • Field Details

    • genericFactory

      protected GenericFactory genericFactory
      Factory to access SAP session beans
    • ERP_CURRENCY_DEFAULT_DECIMAL_DIGITS

      public static final int ERP_CURRENCY_DEFAULT_DECIMAL_DIGITS
      Number of decimal digits used for currency values in R/3 systems.

      See transaction OY04.

      See Also:
    • sapLogger

      protected static final Log4JWrapper sapLogger
      Logging instance
    • XFLAG

      protected static final String XFLAG
      Represents true in ABAP
      See Also:
    • FALSE

      protected static final String FALSE
      Represents false in ABAP
      See Also:
    • HIDE_MESSAGE

      public static final String HIDE_MESSAGE
      Indicator that marks a message to be hidden
      See Also:
  • Constructor Details

    • BaseStrategyERP

      public BaseStrategyERP()
  • Method Details

    • getGenericFactory

      public GenericFactory getGenericFactory()
      Returns:
      the genericFactory
    • setGenericFactory

      public void setGenericFactory(GenericFactory genericFactory)
      Parameters:
      genericFactory - the genericFactory to set
    • setCustExit

      public void setCustExit(ERPLO_APICustomerExits custExit)
      Parameters:
      custExit - the custExit to set
    • getMessageMapper

      public BackendMessageMapper getMessageMapper()
      Returns:
      the messageMapper
    • checkAttributeEmpty

      protected static void checkAttributeEmpty(Object attribute, String attributeName) throws BackendExceptionECOERP
      Checks if an attribute is initial and throws an exception if this is the case.
      Parameters:
      attribute - if it is a string, emptyness is checked in addition
      attributeName -
      Throws:
      BackendExceptionECOERP
    • logCall

      public static void logCall(String functionName, com.sap.conn.jco.JCoRecord input, com.sap.conn.jco.JCoRecord output, Log4JWrapper log)
      Logs a RFC-call into the log file of the application.
      Parameters:
      functionName - the name of the JCo function that was executed
      input - input data for the function module. You may set this parameter to null if you don't have any data to be logged.
      output - Log4 * output data for the function module. You may set this parameter to null if you don't have any data to be logged.
      log - the logging context to be used
    • invalidateSalesDocument

      protected void invalidateSalesDocument(SalesDocument doc)
    • logCall

      protected static void logCall(String functionName, com.sap.conn.jco.JCoRecord input, com.sap.conn.jco.JCoRecord output)
      Traces a function module call
      Parameters:
      functionName - Name of RFC function
      input - Import attributes
      output - Export attributes
    • isRecoverableHeaderError

      protected boolean isRecoverableHeaderError(com.sap.conn.jco.JCoStructure esError)
      Can we recover from this error situation?
      Parameters:
      esError - Error structure of type TDS_ERROR
      Returns:
      true if we can proceed after LO-API LOAD
    • dispatchMessages

      protected void dispatchMessages(BusinessObject bob, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg) throws BackendException
      Logs and attaches messages to a given document.
      Parameters:
      bob - Target business object the messages must be applied to
      msgTable - Table with messages
      singleMsg - Structure containing one single message
      Throws:
      BackendException
    • hasMessage

      public static boolean hasMessage(String msgType, String msgId, String msgNo, String msgV1, String msgV2, String msgV3, String msgV4, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg)
      Use this method to check a certain message had been issued
      Parameters:
      msgType - message type
      msgId - message id
      msgNo - message number
      msgV1 - the 1st variable of the message to replace
      msgV2 - the 2nd variable of the message to replace
      msgV3 - the 3rd variable of the message to replace
      msgV4 - the 4th variable of the message to replace
      msgTable - jCoTable containing jCo message from back end
      singleMsg - a single jCo message
      Returns:
      true, if the specified message is contained in msgTable
    • hasMessage

      public static boolean hasMessage(String msgType, String msgId, String msgNo, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg)
    • getCustExit

      protected ERPLO_APICustomerExits getCustExit()
      Ease the creation of the customer exit implementation. If desired, implementation can be changed by overwriting this method.
      Returns:
      the customer exit implementation
    • setMessageMapper

      public void setMessageMapper(BackendMessageMapper messageMapper)
      Parameters:
      messageMapper - Maps backend message to BOL messages (refer to messages.xml)