java.lang.Object
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.GetAllStrategyERP
All Implemented Interfaces:
ConstantsR3Lrd, GetAllStrategy
Direct Known Subclasses:
GetAllStrategyERP604, GetAllStrategyERP605

public abstract class GetAllStrategyERP extends BaseStrategyERP implements GetAllStrategy, ConstantsR3Lrd
Strategy for function module ERP_LORD_GET_ALL.
  • Field Details

    • SAP_LOGGER

      public static final Log4JWrapper SAP_LOGGER
      reference to SAP logging API
    • EMPTY_STRING

      protected static final String EMPTY_STRING
      Empty string
      See Also:
    • FIELD_NO_CONVERSION

      protected static final String FIELD_NO_CONVERSION
      Attribute for LO-API: No conversion intended (conversion exits not called in SAP back end)
      See Also:
  • Constructor Details

    • GetAllStrategyERP

      public GetAllStrategyERP()
  • Method Details

    • buildDefaultItemObjectRequestParameters

      protected void buildDefaultItemObjectRequestParameters(com.sap.conn.jco.JCoFunction function)
      Fills the import parameter IT_ITEM_OBJREQ with default values for items.
      Parameters:
      function - JCO function
    • buildExtensibilityFieldsRequestParameters

      protected void buildExtensibilityFieldsRequestParameters(com.sap.conn.jco.JCoParameterList importParameters)
      Parameters:
      importParameters -
    • buildSavedItemsList

      protected void buildSavedItemsList(Set<String> savedItemsMap, Map<String,Item> itemsERPState, com.sap.conn.jco.JCoTable ttItemKey)
      Build list of items that are already saved in the backend (order change). This method should be called when the order items are retrieved the document is read the first time, because it is not possible to distinguish between saved and new items.
      Parameters:
      savedItemsMap - list of saved items
      itemsERPState - ERP status of items which we buffered previously
      ttItemKey - list of item keys
    • createItemCopy

      protected Item createItemCopy(Item currentItem)
      Creates a deep copy of an item
      Parameters:
      currentItem - Source item
      Returns:
      Deep copy
    • determineStatus

      protected abstract void determineStatus(Header head, com.sap.conn.jco.JCoStructure esHvStatComV, com.sap.conn.jco.JCoTable ttItemVstatComV, ObjectInstances objInstMap, Map<String,Item> itemMap)
      Determine status from data read via LO-API
      Parameters:
      head - Cart or order header
      esHvStatComV - Header status info
      ttItemVstatComV - Item status info
      objInstMap - Map of LO-API objects (items)
      itemMap - Map of BOL items
    • execute

      public BackendCallResult execute(BackendState backendState, SalesDocument salesDocument, ItemBuffer itemBuffer, JCoConnection cn) throws BackendException
      Strategy for ERP_LORD_GET_ALL. Reads all relevant data for header and item.
      Specified by:
      execute in interface GetAllStrategy
      Parameters:
      cn - JCO connection to use
      backendState - ERP specific state of the document
      salesDocument - BO representation of the sales document
      itemBuffer - State of previously read items (performance improvement)
      Returns:
      Object containing messages of call and (if present) the return code generated by the function module.
      Throws:
      BackendException - exception from R/3
    • executeRfc

      public void executeRfc(JCoConnection theConnection, com.sap.conn.jco.JCoFunction theFunction) throws BackendException
      Wrapper for the remote function call. This can be used for performance measurement instrumentation, additional logging a.o.
      Specified by:
      executeRfc in interface GetAllStrategy
      Parameters:
      theConnection - connection to the backend system
      theFunction - JCO function
      Throws:
      BackendException - exception from R/3
    • fillExtensibilityTable

      protected void fillExtensibilityTable(Map<LrdFieldExtension.FieldType,LrdFieldExtension> extensionFields, com.sap.conn.jco.JCoTable itFieldReq, LrdFieldExtension.FieldType fieldType)
      Fills table of extensions for the LO-API call
      Parameters:
      extensionFields - Available extensions
      itFieldReq -
      fieldType -
    • getParentItem

      protected Item getParentItem(String handle, ObjectInstances objInstMap, Map<String,Item> itemMap)
      Returns the ItemData for a handle in the objInstMap table.
      Parameters:
      handle - Item handle
      objInstMap - Map of LO-API objects (items)
      itemMap - Map of BOL items
      Returns:
      Parent item
    • getWrongUnit

      protected String getWrongUnit(com.sap.conn.jco.JCoStructure message)
      Evaluates the response and checks for wrong unit. Later on we need to handle those units when re-reading items.
      Parameters:
      message - LO-API call results
      Returns:
      Wrong unit ID
    • handleEtHeadFields

      protected void handleEtHeadFields(com.sap.conn.jco.JCoTable etHeadFields, Header header)
      Transfers header fields from the LO-API response to the BOL header
      Parameters:
      etHeadFields - Table of header fields
      header - BOL representation of header
    • handleEtItemFields

      protected void handleEtItemFields(com.sap.conn.jco.JCoTable etItemFields, Map<String,Item> itemMap)
      Transfers item fields from LO-API response to the BOL item
      Parameters:
      etItemFields - Item fields from ERP
      itemMap - Map of BOL items
    • handleTtHeadDocFlow

      protected void handleTtHeadDocFlow(com.sap.conn.jco.JCoTable ttHeadDocFlow, Header head)
      Handles docflow
      Parameters:
      ttHeadDocFlow -
      head - Cart or order header
    • handleTtIDFlow

      protected void handleTtIDFlow(Map<String,String> itemKey, Map<String,Item> itemMap, String thisDocNumber, DocumentType documentType, com.sap.conn.jco.JCoTable ttIDFlow)
      Handle data of the table ttIDFlow and fill item data. (Only direct references, either successor or predecessor ones, of type contract, delivery or invoice are determined according to ECO ERP due to performance reason)
      Parameters:
      itemKey - Map of item posnr
      itemMap - Map of items
      thisDocNumber - Number of the document for which the doc flow is read (WITHOUT leading zeros)
      documentType - Document type
      ttIDFlow - Table of item document flow
    • insertDefaultHeadObjectRequestParameters

      protected void insertDefaultHeadObjectRequestParameters(com.sap.conn.jco.JCoFunction function)
      Sets up the required LO-API segments on header level (like HEAD, COND..)
      Parameters:
      function - JCO function
    • getIncompletionMapper

      public IncompletionMapperImpl getIncompletionMapper()
      Returns:
      the incompletionMapper
    • setIncompletionMapper

      public void setIncompletionMapper(IncompletionMapperImpl incompletionMapper)
      Parameters:
      incompletionMapper - the incompletionMapper to set