Class GroovyERPServerHelper

java.lang.Object
com.imc.iss.groovy.erp.GroovyERPServerHelper

public class GroovyERPServerHelper extends Object
  • Constructor Details

    • GroovyERPServerHelper

      public GroovyERPServerHelper()
  • Method Details

    • executeJCoFunction

      public JCoFunction executeJCoFunction(JCoFunction jcoFunction) throws JCoException
      Executes the jcoFunction
      Parameters:
      jcoFunction - JCoFunction to be executed
      Throws:
      JCoException
    • executeJCoFunctionWithTransactionAndCommit

      public JCoFunctionWithTransaction executeJCoFunctionWithTransactionAndCommit(String destinationName, JCoFunction jCoFunction) throws JCoException, AppCustomException
      To execute the jcoFunction along with BAPI_TRANSACTION_COMMIT function. It first executes the passed jcoFunction, then executes the BAPI_TRANSACTION_COMMIT function.
      Parameters:
      destinationName - Name of the destination
      jcoFunction - JCoFunction to be executed
      Throws:
      JCoException
      AppCustomException
    • executeJCoFunctionWithTransactionAndCommit

      public JCoFunctionWithTransaction executeJCoFunctionWithTransactionAndCommit(String destinationName, JCoFunction jCoFunction, Function<JCoFunction,Boolean> isValidationSuccessful) throws JCoException, AppCustomException
      To execute the jcoFunction along with BAPI_TRANSACTION_COMMIT function. It first executes the passed jcoFunction, then executes the isValidationSuccessful on the jcoFunction, based on the result of it executes the BAPI_TRANSACTION_COMMIT.
      For erp-server usage, isValidationSuccessful is not considered as the validation logic takes place in the erp-server. The RETURN Table from JCoFunction is used to check for any error message. It looks for message of type E(Error) or A(Abort) for error.
      Parameters:
      destinationName - Name of the destination
      jcoFunction - JCoFunction to be executed
      isValidationSuccessful - Validation function
      Throws:
      JCoException
      AppCustomException
    • getJCoFunction

      public JCoFunction getJCoFunction(String destinationName, String functionName) throws JCoException, AppCustomException
      This method returns the requested JCoFunction
      Parameters:
      destinationName - Name of the destination
      functionName - Requested JCoFunction name
      Throws:
      JCoException
      AppCustomException
    • isDestinationConfigured

      public boolean isDestinationConfigured()
      This method helps to determine if we are using ERP server or not
      Returns:
      true, if we are running on SAP Cloud Platform