Class BaseStrategyERP

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BaseStrategyERP.ReturnValue
      Represents the data returned by a call to the function module.
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseStrategyERP()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void checkAttributeEmpty​(java.lang.Object attribute, java.lang.String attributeName)
      Checks if an attribute is initial and throws an exception if this is the case.
      protected void dispatchMessages​(BusinessObject bob, com.sap.conn.jco.JCoTable msgTable, com.sap.conn.jco.JCoStructure singleMsg)
      Logs and attaches messages to a given document.
      protected ERPLO_APICustomerExits getCustExit()
      Ease the creation of the customer exit implementation.
      GenericFactory getGenericFactory()  
      BackendMessageMapper getMessageMapper()  
      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)  
      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
      protected void invalidateSalesDocument​(SalesDocument doc)  
      protected boolean isRecoverableHeaderError​(com.sap.conn.jco.JCoStructure esError)
      Can we recover from this error situation?
      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
      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.
      void setCustExit​(ERPLO_APICustomerExits custExit)  
      void setGenericFactory​(GenericFactory genericFactory)  
      void setMessageMapper​(BackendMessageMapper messageMapper)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • BaseStrategyERP

        public BaseStrategyERP()
    • 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
      • checkAttributeEmpty

        protected static void checkAttributeEmpty​(java.lang.Object attribute,
                                                  java.lang.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 addition
        attributeName -
        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 executed
        input - input data for the function module. You may set this parameter to null if you don't have any data to be logged.
        output - Log4 * output data for the function module. You may set this parameter to null if 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 function
        input - Import attributes
        output - 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 to
        msgTable - Table with messages
        singleMsg - 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 type
        msgId - message id
        msgNo - message number
        msgV1 - the 1st variable of the message to replace
        msgV2 - the 2nd variable of the message to replace
        msgV3 - the 3rd variable of the message to replace
        msgV4 - the 4th variable of the message to replace
        msgTable - jCoTable containing jCo message from back end
        singleMsg - 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)