Class BaseStrategyERP
- java.lang.Object
-
- de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy.BaseStrategyERP
-
- Direct Known Subclasses:
GetAllStrategyERP,LrdActionsStrategyERP,SetStrategyERP
public class BaseStrategyERP extends java.lang.ObjectBase class for strategy implementations dealing with ERP LO-API calls
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseStrategyERP.ReturnValueRepresents the data returned by a call to the function module.
-
Field Summary
Fields Modifier and Type Field Description static intERP_CURRENCY_DEFAULT_DECIMAL_DIGITSNumber of decimal digits used for currency values in R/3 systems.protected static java.lang.StringFALSERepresents false in ABAPprotected GenericFactorygenericFactoryFactory to access SAP session beansstatic java.lang.StringHIDE_MESSAGEIndicator that marks a message to be hiddenprotected static Log4JWrappersapLoggerLogging instanceprotected static java.lang.StringXFLAGRepresents true in ABAP
-
Constructor Summary
Constructors Constructor Description BaseStrategyERP()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidcheckAttributeEmpty(java.lang.Object attribute, java.lang.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_APICustomerExitsgetCustExit()Ease the creation of the customer exit implementation.GenericFactorygetGenericFactory()BackendMessageMappergetMessageMapper()static booleanhasMessage(java.lang.String msgType, java.lang.String msgId, java.lang.String msgNo, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg)static booleanhasMessage(java.lang.String msgType, java.lang.String msgId, java.lang.String msgNo, java.lang.String msgV1, java.lang.String msgV2, java.lang.String msgV3, java.lang.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 voidinvalidateSalesDocument(SalesDocument doc)protected booleanisRecoverableHeaderError(com.sap.conn.jco.JCoStructure esError)Can we recover from this error situation?protected static voidlogCall(java.lang.String functionName, com.sap.conn.jco.JCoRecord input, com.sap.conn.jco.JCoRecord output)Traces a function module callstatic voidlogCall(java.lang.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 Detail
-
genericFactory
protected GenericFactory genericFactory
Factory to access SAP session beans
-
ERP_CURRENCY_DEFAULT_DECIMAL_DIGITS
public static final int ERP_CURRENCY_DEFAULT_DECIMAL_DIGITS
Number of decimal digits used for currency values in R/3 systems.See transaction OY04.
- See Also:
- Constant Field Values
-
sapLogger
protected static final Log4JWrapper sapLogger
Logging instance
-
XFLAG
protected static final java.lang.String XFLAG
Represents true in ABAP- See Also:
- Constant Field Values
-
FALSE
protected static final java.lang.String FALSE
Represents false in ABAP- See Also:
- Constant Field Values
-
HIDE_MESSAGE
public static final java.lang.String HIDE_MESSAGE
Indicator that marks a message to be hidden- See Also:
- Constant Field Values
-
-
Method Detail
-
getGenericFactory
public GenericFactory getGenericFactory()
- Returns:
- the genericFactory
-
setGenericFactory
public void setGenericFactory(GenericFactory genericFactory)
- Parameters:
genericFactory- the genericFactory to set
-
setCustExit
public void setCustExit(ERPLO_APICustomerExits custExit)
- Parameters:
custExit- the custExit to set
-
getMessageMapper
public BackendMessageMapper getMessageMapper()
- Returns:
- the messageMapper
-
checkAttributeEmpty
protected static void checkAttributeEmpty(java.lang.Object attribute, java.lang.String attributeName) throws BackendExceptionECOERPChecks 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(java.lang.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
protected void invalidateSalesDocument(SalesDocument doc)
-
logCall
protected static void logCall(java.lang.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(java.lang.String msgType, java.lang.String msgId, java.lang.String msgNo, java.lang.String msgV1, java.lang.String msgV2, java.lang.String msgV3, java.lang.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
public static boolean hasMessage(java.lang.String msgType, java.lang.String msgId, java.lang.String msgNo, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg)
-
getCustExit
protected ERPLO_APICustomerExits 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
public void setMessageMapper(BackendMessageMapper messageMapper)
- Parameters:
messageMapper- Maps backend message to BOL messages (refer to messages.xml)
-
-