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.SetStrategyERP
All Implemented Interfaces:
ConstantsR3Lrd, SetStrategy

public class SetStrategyERP extends BaseStrategyERP implements SetStrategy, ConstantsR3Lrd
Strategy for function module
ERP_LORD_SET
in the ERP. This class consists only of static method. Each of theses methods wraps the function module. The purpose of this class is to maintain only one implementation of the logic necessary to call this function module via jco using data provided by Java objects.
Version:
1.0
  • Constructor Details

    • SetStrategyERP

      public SetStrategyERP()
  • Method Details

    • execute

      public BackendCallResult execute(BackendState salesDocR3Lrd, SalesDocument salesDoc, Map<String,Item> itemsERPStatus, TransactionConfiguration shop, JCoConnection cn, List<String> itemNewShipTos, boolean onlyUpdateHeader) throws BackendException
      Strategy for ERP_LORD_SET, all values found in the provided sales document are written to the backend system. If you want a field to be ignored set the corresponding value to null.
      Specified by:
      execute in interface SetStrategy
      Parameters:
      salesDocR3Lrd - The SalesDocumentR3Lrd object instance
      salesDoc - The sales document
      shop - the shop object
      cn - Connection to use
      itemNewShipTos - The list of item tech keys, for which a new ship to should be created
      onlyUpdateHeader - boolean, which indicates, if only header of the object should be updated
      itemsERPStatus - status of the erp items
      Returns:
      call result.
      Throws:
      BackendException - This exception is thrown if there is an error in the backend layer
    • findItemsToChange

      protected Set<String> findItemsToChange(Map<String,Item> itemsERPStatus, SalesDocument salesDoc, TransactionConfiguration transConf)
      Determine items which need to be changed. Compares actual sales document data with the buffered ERP status.
      Parameters:
      itemsERPStatus - List of items which reflect the ERP status (when the document has been read previously
      salesDoc - Current sales transaction. Contains items which we need to compare with the ERP status
      transConf - Holds the sales customizing in general
      Returns:
      Set of item handles which represent the items to be changed.
    • isItemToBeSent

      protected boolean isItemToBeSent(Item currentItem, Item existingItem)
    • isEqualTexts

      protected boolean isEqualTexts(Item item1, Item item2)
      Compare 2 item texts
    • markInvalidItems

      protected void markInvalidItems(SalesDocument salesDoc, com.sap.conn.jco.JCoStructure esError) throws BackendException
      Parameters:
      salesDoc -
      esError -
      Throws:
      BackendException
    • fillHeaderFieldExtensions

      protected void fillHeaderFieldExtensions(Header header, com.sap.conn.jco.JCoTable objectContentComV)
      Parameters:
      header -
      objectContentComV -
    • fillItemFieldExtensions

      protected void fillItemFieldExtensions(SalesDocument salesDoc, Set<String> itemsToBeChanged, com.sap.conn.jco.JCoTable objectContentComV)
      Passes item extensions to LO-API.
      Parameters:
      salesDoc - Sales transaction which contains all items
      itemsToBeChanged - Handles of items which we want to send to ERP
      objectContentComV - JCO table of extensions
    • determineItemPosnr

      protected int determineItemPosnr(int lastNumber)
      Determines a POSNR for items which have not been exchanged with LO-API so far. The method is called only once per item (if numberInt is initial)
      As default 10 is added to the last known number, as this corresponds to the standard SD customizing.
      Parameters:
      item - Sales document item (has not been exchanged with SD yet)
      lastNumber - number of previous item
      Returns:
      POSNR for new SD item