Class GetAllStrategyERP
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.
-
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
FieldsModifier and TypeFieldDescriptionprotected static final StringEmpty stringprotected static final StringAttribute for LO-API: No conversion intended (conversion exits not called in SAP back end)static final Log4JWrapperreference to SAP logging APIFields 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 voidbuildDefaultItemObjectRequestParameters(com.sap.conn.jco.JCoFunction function) Fills the import parameterIT_ITEM_OBJREQwith default values for items.protected voidbuildExtensibilityFieldsRequestParameters(com.sap.conn.jco.JCoParameterList importParameters) protected voidbuildSavedItemsList(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).protected ItemcreateItemCopy(Item currentItem) Creates a deep copy of an itemprotected abstract voiddetermineStatus(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-APIexecute(BackendState backendState, SalesDocument salesDocument, ItemBuffer itemBuffer, JCoConnection cn) Strategy for ERP_LORD_GET_ALL.voidexecuteRfc(JCoConnection theConnection, com.sap.conn.jco.JCoFunction theFunction) Wrapper for the remote function call.protected voidfillExtensibilityTable(Map<LrdFieldExtension.FieldType, LrdFieldExtension> extensionFields, com.sap.conn.jco.JCoTable itFieldReq, LrdFieldExtension.FieldType fieldType) Fills table of extensions for the LO-API callprotected ItemgetParentItem(String handle, ObjectInstances objInstMap, Map<String, Item> itemMap) Returns theItemDatafor a handle in theobjInstMaptable.protected StringgetWrongUnit(com.sap.conn.jco.JCoStructure message) Evaluates the response and checks for wrong unit.protected voidhandleEtHeadFields(com.sap.conn.jco.JCoTable etHeadFields, Header header) Transfers header fields from the LO-API response to the BOL headerprotected voidhandleEtItemFields(com.sap.conn.jco.JCoTable etItemFields, Map<String, Item> itemMap) Transfers item fields from LO-API response to the BOL itemprotected voidhandleTtHeadDocFlow(com.sap.conn.jco.JCoTable ttHeadDocFlow, Header head) Handles docflowprotected voidhandleTtIDFlow(Map<String, String> itemKey, Map<String, Item> itemMap, String thisDocNumber, DocumentType documentType, com.sap.conn.jco.JCoTable ttIDFlow) Handle data of the tablettIDFlowand fillitem data.protected voidinsertDefaultHeadObjectRequestParameters(com.sap.conn.jco.JCoFunction function) Sets up the required LO-API segments on header level (like HEAD, COND..)voidsetIncompletionMapper(IncompletionMapperImpl incompletionMapper) 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
-
Field Details
-
SAP_LOGGER
reference to SAP logging API -
EMPTY_STRING
Empty string- See Also:
-
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 parameterIT_ITEM_OBJREQwith 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 itemsitemsERPState- ERP status of items which we buffered previouslyttItemKey- list of item keys
-
createItemCopy
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 headeresHvStatComV- Header status infottItemVstatComV- Item status infoobjInstMap- 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:
executein interfaceGetAllStrategy- Parameters:
cn- JCO connection to usebackendState- ERP specific state of the documentsalesDocument- BO representation of the sales documentitemBuffer- 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:
executeRfcin interfaceGetAllStrategy- Parameters:
theConnection- connection to the backend systemtheFunction- 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 extensionsitFieldReq-fieldType-
-
getParentItem
Returns theItemDatafor a handle in theobjInstMaptable.- Parameters:
handle- Item handleobjInstMap- Map of LO-API objects (items)itemMap- Map of BOL items- Returns:
- Parent item
-
getWrongUnit
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
Transfers header fields from the LO-API response to the BOL header- Parameters:
etHeadFields- Table of header fieldsheader- BOL representation of header
-
handleEtItemFields
Transfers item fields from LO-API response to the BOL item- Parameters:
etItemFields- Item fields from ERPitemMap- Map of BOL items
-
handleTtHeadDocFlow
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 tablettIDFlowand fillitem 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 posnritemMap- Map of itemsthisDocNumber- Number of the document for which the doc flow is read (WITHOUT leading zeros)documentType- Document typettIDFlow- 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
- Returns:
- the incompletionMapper
-
setIncompletionMapper
- Parameters:
incompletionMapper- the incompletionMapper to set
-