Class SetStrategyERP
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
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.
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
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
BaseStrategyERP.ReturnValue -
Field Summary
Fields inherited from class de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
ERP_CURRENCY_DEFAULT_DECIMAL_DIGITS, FALSE, genericFactory, HIDE_MESSAGE, sapLogger, XFLAGFields inherited from interface de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.interf.erp.ConstantsR3Lrd
ABAP_TRUE, BAPI_RETURN_ABORT, BAPI_RETURN_ERROR, BAPI_RETURN_INFO, BAPI_RETURN_WARNING, DATE_INITIAL, FIELD_HANDLE, FIELD_HANDLE_ITEM, FIELD_HANDLE_PARENT, FIELD_ID, FIELD_OBJECT_ID, FIELD_POSNR, FIELD_SPRAS_ISO, FIELD_TEXT_STRING, FM_LO_API_CLOSE, FM_LO_API_COPY, FM_LO_API_DO_ACTIONS, FM_LO_API_LOAD, FM_LO_API_SAVE, FM_LO_API_SET, FM_LO_API_SET_ACTIVE_FIELDS, FM_LO_API_SET_VCFG_ALL, FM_LO_API_WEC_ORDER_GET, FM_WEC_API_GET_VCFG_ALL, LF, MESSAGE_IGNORE_VARS, ROLE_BILLPARTY, ROLE_CONTACT, ROLE_PAYER, ROLE_SHIPTO, ROLE_SOLDTO, scenario_LO_API_WEC, SEPARATOR, UI_ELEMENT_DELIVERY_REGION, UI_ELEMENT_DELIVERY_TYPE, UI_ELEMENT_DISCOUNTS, UI_ELEMENT_EXT_REF_OBJECTS, UI_ELEMENT_HEADER_TEXT, UI_ELEMENT_HEADER_USERSTATUS, UI_ELEMENT_ITEM_CONFIG, UI_ELEMENT_ITEM_DELIVERTO, UI_ELEMENT_ITEM_DELIVPRIO, UI_ELEMENT_ITEM_DESCRIPTION, UI_ELEMENT_ITEM_LATESTDELIVDATE, UI_ELEMENT_ITEM_OVERALLSTATUS, UI_ELEMENT_ITEM_PAYTERMS, UI_ELEMENT_ITEM_PRODUCT, UI_ELEMENT_ITEM_PRODUCT_ID, UI_ELEMENT_ITEM_QTY, UI_ELEMENT_ITEM_REQDELIVDATE, UI_ELEMENT_ITEM_TEXT, UI_ELEMENT_ITEM_UNIT, UI_ELEMENT_ITEM_USERSTATUS, UI_ELEMENT_PURCHASE_ORDER_EXT, UI_ELEMENT_RECALL_ID, UI_ELEMENT_REFERENCES, UI_ELEMENT_SHIPPING_COUNTRY, UI_ELEMENT_SHIPPING_METHOD, UI_GROUP_ITEM, UI_GROUP_ORDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intdetermineItemPosnr(int lastNumber) Determines a POSNR for items which have not been exchanged with LO-API so far.execute(BackendState salesDocR3Lrd, SalesDocument salesDoc, Map<String, Item> itemsERPStatus, TransactionConfiguration shop, JCoConnection cn, List<String> itemNewShipTos, boolean onlyUpdateHeader) Strategy for ERP_LORD_SET, all values found in the provided sales document are written to the backend system.protected voidfillHeaderFieldExtensions(Header header, com.sap.conn.jco.JCoTable objectContentComV) protected voidfillItemFieldExtensions(SalesDocument salesDoc, Set<String> itemsToBeChanged, com.sap.conn.jco.JCoTable objectContentComV) Passes item extensions to LO-API.findItemsToChange(Map<String, Item> itemsERPStatus, SalesDocument salesDoc, TransactionConfiguration transConf) Determine items which need to be changed.protected booleanisEqualTexts(Item item1, Item item2) Compare 2 item textsprotected booleanisItemToBeSent(Item currentItem, Item existingItem) protected voidmarkInvalidItems(SalesDocument salesDoc, com.sap.conn.jco.JCoStructure esError) Methods inherited from class de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
checkAttributeEmpty, dispatchMessages, getCustExit, getGenericFactory, getMessageMapper, hasMessage, hasMessage, invalidateSalesDocument, isRecoverableHeaderError, logCall, logCall, setCustExit, setGenericFactory, setMessageMapper
-
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 BackendExceptionStrategy 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 tonull.- Specified by:
executein interfaceSetStrategy- Parameters:
salesDocR3Lrd- The SalesDocumentR3Lrd object instancesalesDoc- The sales documentshop- the shop objectcn- Connection to useitemNewShipTos- The list of item tech keys, for which a new ship to should be createdonlyUpdateHeader- boolean, which indicates, if only header of the object should be updateditemsERPStatus- 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 previouslysalesDoc- Current sales transaction. Contains items which we need to compare with the ERP statustransConf- Holds the sales customizing in general- Returns:
- Set of item handles which represent the items to be changed.
-
isItemToBeSent
-
isEqualTexts
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 itemsitemsToBeChanged- Handles of items which we want to send to ERPobjectContentComV- 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
-