on 04-11-2014 4:00 PM
Hello Experts-
I'm an experienced programmer (mostly C++, C#), but new to SAP Sourcing v 9 scripting...
I have some logic that I need to use in several scripts and, for better maintenance, would like to not repeat the code everywhere.
Is there any way to write a utility function/script which can be shared by many scripts that, ideally, could take parameter(s) and return a result? Perhaps it could be saved it in an "Explicitly Called Script" or somewhere else? Or maybe it could throw a chained exception and I could intercept it somehow in the calling script?
Thanks in advance!
Mike
Micheal,
Beanshell scripts are not available to be triggered from one another in the application. The best approach to this is to write a class for your functions and compile it into a .jar file that is deployed with the application as a custom jar file.
Then you can import the class and use it in your scripts. The drawback to this is the downtime needed to deploy the jar file.
I have weighed this option many times but found it to be too much work vs. just duplicating 15 to 50 lines of code for a few functions.
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.