Class BaseStrategyERP
java.lang.Object
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
- Direct Known Subclasses:
GetAllStrategyERP,LrdActionsStrategyERP,SetStrategyERP
Base class for strategy implementations dealing with ERP LO-API calls
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the data returned by a call to the function module. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNumber of decimal digits used for currency values in R/3 systems.protected static final StringRepresents false in ABAPprotected GenericFactoryFactory to access SAP session beansstatic final StringIndicator that marks a message to be hiddenprotected static final Log4JWrapperLogging instanceprotected static final StringRepresents true in ABAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcheckAttributeEmpty(Object attribute, String attributeName) Checks if an attribute is initial and throws an exception if this is the case.protected voiddispatchMessages(BusinessObject bob, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg) Logs and attaches messages to a given document.protected ERPLO_APICustomerExitsEase the creation of the customer exit implementation.static booleanhasMessage(String msgType, String msgId, String msgNo, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg) static booleanhasMessage(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 issuedprotected voidprotected booleanisRecoverableHeaderError(com.sap.conn.jco.JCoStructure esError) Can we recover from this error situation?protected static voidTraces a function module callstatic voidlogCall(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.voidsetCustExit(ERPLO_APICustomerExits custExit) voidsetGenericFactory(GenericFactory genericFactory) voidsetMessageMapper(BackendMessageMapper messageMapper)
-
Field Details
-
genericFactory
Factory to access SAP session beans -
ERP_CURRENCY_DEFAULT_DECIMAL_DIGITS
public static final int ERP_CURRENCY_DEFAULT_DECIMAL_DIGITSNumber of decimal digits used for currency values in R/3 systems.See transaction OY04.
- See Also:
-
sapLogger
Logging instance -
XFLAG
Represents true in ABAP- See Also:
-
FALSE
Represents false in ABAP- See Also:
-
HIDE_MESSAGE
Indicator that marks a message to be hidden- See Also:
-
-
Constructor Details
-
BaseStrategyERP
public BaseStrategyERP()
-
-
Method Details
-
getGenericFactory
- Returns:
- the genericFactory
-
setGenericFactory
- Parameters:
genericFactory- the genericFactory to set
-
setCustExit
- Parameters:
custExit- the custExit to set
-
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 additionattributeName-- 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 executedinput- input data for the function module. You may set this parameter tonullif you don't have any data to be logged.output- Log4 * output data for the function module. You may set this parameter tonullif you don't have any data to be logged.log- the logging context to be used
-
invalidateSalesDocument
-
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 functioninput- Import attributesoutput- 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 tomsgTable- Table with messagessingleMsg- 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 typemsgId- message idmsgNo- message numbermsgV1- the 1st variable of the message to replacemsgV2- the 2nd variable of the message to replacemsgV3- the 3rd variable of the message to replacemsgV4- the 4th variable of the message to replacemsgTable- jCoTable containing jCo message from back endsingleMsg- a single jCo message- Returns:
- true, if the specified message is contained in msgTable
-
hasMessage
-
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
- Parameters:
messageMapper- Maps backend message to BOL messages (refer to messages.xml)
-