Quantcast
Channel: SCN : Blog List - All Communities
Viewing all articles
Browse latest Browse all 2548

Alternative approach to custom JARs

$
0
0

Today we'll try to provide a (better) alternative to one cumbersome SAP standard process - deploying custom jars to SAP Sourcing.

 

I've always wondered who would go to such pain just to add one .jar to the classpath, when even standard Java has better options. And why?!


For example, my code breaks about 100 times before it's ready to be fully tested. That means I would need about 1 year of BASIS time just to do 100 repacks and redeploys to test a piece of code.


 

So, let's keep it simple:

 

 

STEP 1 - You'll obviously need a jar . Nothing better than a Hello World

1.png

 


STEP 2 - Copy jar file anywhereon the Sourcing server

2.png

 

 

STEP 3 - That's ALL there is. We just need to use it now, like this:

 

// load jar before imports - this is where BeanShell beauty comes in
this.interpreter.getClassManager().addClassPath(new File("/usr/sap/xfer/CLM/btoma/Import/Path/HelloWorld.jar").toURI().toURL());
// @bogdan.toma
import com.tnd.eso.addons.playground.HelloWorld;
HelloWorld helloWorld = new HelloWorld();
throw new ApplicationException(session, helloWorld.getWorldStatus());

 

 

>>>>> result from testing STEP 3 on a toolbar script:

3.png

 

Indeed the world is doomed if we have to follow that 'custom jar deployment' process.

 

 

Regards,

Bogdan Toma

 

Check out some other cool topics below.

-------------------------------------------------------

SAP Sourcing scripts - editing and source control maintenance

[ANN] ScriptsRepo - Deploy Tool for SAP Sourcing Scripts


Viewing all articles
Browse latest Browse all 2548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>