Package com.imc.iss.groovy.erp
Class GroovyERPServerHelper
java.lang.Object
com.imc.iss.groovy.erp.GroovyERPServerHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionJCoFunctionexecuteJCoFunction(JCoFunction jcoFunction) Executes the jcoFunctionexecuteJCoFunctionWithTransactionAndCommit(String destinationName, JCoFunction jCoFunction) To execute the jcoFunction along with BAPI_TRANSACTION_COMMIT function.executeJCoFunctionWithTransactionAndCommit(String destinationName, JCoFunction jCoFunction, Function<JCoFunction, Boolean> isValidationSuccessful) To execute the jcoFunction along with BAPI_TRANSACTION_COMMIT function.JCoFunctiongetJCoFunction(String destinationName, String functionName) This method returns the requested JCoFunctionbooleanThis method helps to determine if we are using ERP server or not
-
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 destinationjcoFunction- JCoFunction to be executed- Throws:
JCoExceptionAppCustomException
-
executeJCoFunctionWithTransactionAndCommit
public JCoFunctionWithTransaction executeJCoFunctionWithTransactionAndCommit(String destinationName, JCoFunction jCoFunction, Function<JCoFunction, Boolean> isValidationSuccessful) throws JCoException, AppCustomExceptionTo 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 destinationjcoFunction- JCoFunction to be executedisValidationSuccessful- Validation function- Throws:
JCoExceptionAppCustomException
-
getJCoFunction
public JCoFunction getJCoFunction(String destinationName, String functionName) throws JCoException, AppCustomException This method returns the requested JCoFunction- Parameters:
destinationName- Name of the destinationfunctionName- Requested JCoFunction name- Throws:
JCoExceptionAppCustomException
-
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
-