Skip to Content
1

Function module is giving performance issue from external run

Nov 15, 2016 at 01:08 PM

139

avatar image

Hello Experts,

I have one custom RFC which returns output (For one batch) within 10 seconds when its run from SE37 but when I run this RFC from .net code it takes 5-7 minutes. this time frame keeps increasing with batches. Each batch takes couple of extra minutes than previous one.

This is creating performance issue for our product. Can you guys please suggest what I need to work on?

Thanks in advance!

Regards

Akanksha Srivastava

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Jelena Perfiljeva
Nov 15, 2016 at 08:28 PM
3

Work on your analytical skills. Have you tried at all to analyze the issue? Have you set up any logging / tracing / done anything other than posting a question ?

Naturally, when you start an FM in SE37 then it runs on the SAP server and does not need to travel through the network jungle like the external call. But in this day and age even the worst network latency should not cause runtime to go from seconds to minutes IMHO (although technically it is possible). Look at all the parts of this equation: network, data transferred, calling application itself. Get someone locally to assist if you don't know how to analyze this.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Hi Jelena,

Appreciate your concern about logging here but being a certified ABAPer that was the first thing came into my mind and I applied logging in my FM. After that I came to know these stats (Mentioned in my question). I am only resource in my organisation so unable to find help locally and posted this question here.

Let me know if I can try something else!

Thanks!

Akanksha

1

But surely there must be at least a Basis admin available and someone who wrote .NET part. Are they not able to help you with troubleshooting? Is there no trace available at least to see whether delay is on the SAP side, external side or somewhere in between? You haven't provided any details on what exactly this RFC is doing, how exactly it's called or your system landscape, so I'm not sure how a global website could be of assistance...

Below you've mentioned you're getting all columns in LFA1 table. Why?! The less data is involved the faster your application will work.

0

read-rfc.txt

Hi Jelena,

This RFC is created to read data from SAP with customer's input. Where in customer can choose single or multiple tables (With joins) and also can choose fields he want to fetch data from. Apart from these parameters from front end code we send rows skip and row count which is used as package in RFC. Everything is getting generated dynamically.

To perform testing we are fetching all columns from LFA1 table and comparing our product with JDBC connector where we are lagging behind. Attached my RFC code here.

I am stuck with this. Appreciate your help!

-Akanksha

read-rfc.txt (6.3 kB)
0

Not sure why would anyone allow such code in their SAP system as there is not even a single authorization check and it could access any data. Oh dear...

Anyway. I see that Kiran already mentioned ST12 trace here. This is the tool that really should be used in your scenario to establish which part exactly has the most effect on performance. There was a community call on this tool just yesterday (see here).

As a side note - your organization might want to look into using a tool like Winshuttle instead of homegrown functions for this. At least it has some built-in security.

2

Thanks Jelena,

This peice of code gets called from our core product which has all authorization checks and licensing in build. Thats why it is not required here.

I will look for solutions. Thanks

-Akanksha

0
Roland Jungnickel Nov 15, 2016 at 09:35 PM
1

Check the amount of data transfered using RFC; if it has large exporting data try to use TABLES instead (yes, thats outdated, but the only data automatically compressed while transferring). Or you try to compress it (there are gzip helper classes available). Also, I would suggest to google for "theobald RFC", thats third-party lib (paid!) which makes life much easier to use RFC in .NET. It also offers some tracing analysis. Website is currently down, check back tomorrow.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Ronald,

amount of data transfered in 10000 every time (fixed batch size of 10k). Still it keeps increasing time with every batch.

For ex- for batches 3,4,5 its taking around 3,5,6 minutes. which creates big performance issue.

Regards

Akanksha

0

if the time is increasing every call, does it matter in which order batches 3,4,5 are processed? Lets say you process batches in order 5,4,3 - will it still increase? If yes, this looks like a huge table is not cleared (e.g. a buffer table where someone executes a READ TABLE without a hash). Keep in mind that RFC sessions are not automatically memory cleansed (this depends on how the call is done).

1

We fetch all columns from LFA1 table (143 columns). batch comes in 1,2,3 sequence only. fetching number of columns may cause the issue?

-Akanksha

0
Kiran K Nov 17, 2016 at 12:30 PM
1

Akanksha,

May be you would have already explored the trace results from ST12 which gives a detail account of step by step process flow and the amount of time it takes to complete one process ( say one FM or Subroutine etc ).

I tried ST12 when a JAVA application is triggering an SAP RFC FM,hopefully it will also log the trace details even from .Net.

K.Kiran.

Share
10 |10000 characters needed characters left characters exceeded