cancel
Showing results for 
Search instead for 
Did you mean: 

Web application connection to sap

Former Member
0 Kudos

Hi all,

I have to do a web application that can extract and add data in sap.

I tried to use JCO connector but I have a probleme in execution time. it is so long to connect to sap and to extract data more than 46 s.

I don't know if there is another solution.

my application server Jboss 6

SAP version 4.6

Please can you help me

Thank you in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I once had a similar situation and used to cache objects that are in SAP. This works especially well if there are certain objects that are retrieved over and over again. However, this has some consequences on how you do security, you have to think about how long an object is supposed to be in your cache and so on. Depending on your scenario, though, this might be worth thinking about. Another option might be to think about why the BAPI call takes so long - do you load a big number of fields? Is it possible to optimize your database in a way that the round trip does not take so long?

Former Member
0 Kudos

Hello Christian

Would please explain me more your solution ? I am new in this domain.

Thank you for your help and support .

Former Member
0 Kudos

What I did was keeping a copies of objects that were retrieved frequently in memory. To do that, you need to have data objects in your Java environment that contain the information from SAP, that you want to display in your web application. The easiest way is to store everything that you retrieve once the application is running and store it in a HashMap. When your web app tries to display a data object, you first check of an object with the given id exists in the HashMap. If yes, just display it. If no, you still have to connect to SAP.

This at least works fine if you are talking a couple of hundreds or thousands of objects and you have enough memory. If you want to have a more sophisticated solution you could look at software like EHCache - there are certain caveats:

1. You typically need to define a time to live for objects in your cache. Depending on how often your records change, you might want to set this to an hour or a day.

2. Depending on your requirements, that is not enough. In that case you could implement a change pointer table in SAP and frequently check that to invalidate objects.

3. Depending on your requirements, you could preload the cache with your most frequently used objects.

4. When I did that I worked with Caching Interceptors and aspect oriented programming which left the business methods untainted from technical details like caching.

This all depends on what exactly you want to cache: If it is master data that rather changes on a monthly basis, this might be a very simple and viable solution. If it is transactional data (finance, accounting) that may change every minute, it might not even be worth looking at it.

As I wrote before, what is the best path to take depends a lot on what exactly you are trying to do. Be aware that at the moment you start thinking about how to invalidate your cache, this starts getting quite complex.

Answers (1)

Answers (1)

Former Member
0 Kudos

If you are fetching huge amount of data in a single query then it will surely take lot of time.

You must consider alternate way to fetch data.

I suggest you to put additional filter so that only required data is fetched.

Such as data for a particular year, or for a particular user.

Former Member
0 Kudos

Thank you so much for your answer.

Please do you know other alternatif or ways to extract or put data in SAP .

Thank you for your help and support.

Former Member
0 Kudos

If you are using ABAP then there are many alternative, I know of.

JAVA I not aware of. But as you are updating in DB it is any other JAVA app. Only diff is tht it will run on SAP WAS.

Former Member
0 Kudos

Hello Hussain ,

In my project I have to execute a bapi that exists in SAP.

I don't know if I should follow the JCO connector or look for an other solution.

Thank you for help

Former Member
0 Kudos

bapi is a good option and most used one.

And sometimes the only option