Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Performance Problems BAPI_RECORD_GETELEMENTS

Former Member
0 Kudos

Hello,

I am facing severe performance issues using the FM  BAPI_RECORD_GETELEMENTS.

I implemented this FM in another FM that is used via RFC by a third-party-software. This FM I created is being used about 800 times per minute.

During the first performance tests, it became obvious that my FM is way too slow to work under said requirements, so I ran a runtime analysis on said FM.

BAPI_RECORD_GETELEMENTS takes up to 71% of the brutto time. So here is my question: Is there already some kind of enhancement of this BAPI? Or any other way other than modifications to speed up this process?

Regards,

Dominik

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I think the 1st thing you should do is to search on sapnet if some notes exists for that bapi (search with bapi name  + performance). Maybe some niteresitng notes exist.

In parallel, you could maybe check in detail of the 71% time used by that bapi.

What is taking time insdie the bapi ? You should be able to find that using ST12 trace (abap + sql activated).

If someting is long inside that bapi (a select, on loop, commits,...) , then maybe it could be improved.

S.N

4 REPLIES 4

Former Member
0 Kudos

Hi,

I think the 1st thing you should do is to search on sapnet if some notes exists for that bapi (search with bapi name  + performance). Maybe some niteresitng notes exist.

In parallel, you could maybe check in detail of the 71% time used by that bapi.

What is taking time insdie the bapi ? You should be able to find that using ST12 trace (abap + sql activated).

If someting is long inside that bapi (a select, on loop, commits,...) , then maybe it could be improved.

S.N

thanga_prakash
Active Contributor
0 Kudos

As I understand from your question that you are calling the BAPI inside your Z* function module.

If yes then try like below logic inside your Z* function module.

1) Get all the active work process with function module TH_WPINFO.

2) Then check whether there is any work process running with the program name of your function module (Every function module will have a program name you can find it in attributes of the function module).

3) If the work process is already running then don't trigger the BAPI wait until the old work process is finished.


DO.

CALL FUNCTION 'TH_WPINFO'

EXPORTING

   SRVNAME         = ' '

   WITH_CPU        = 0

  TABLES

    wplist          = itab_wp

EXCEPTIONS

   SEND_ERROR      = 1

   OTHERS          = 2

          .

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE itab_wp WITH TABLE KEY wp_report = <program name of fm>.

IF sy-subrc EQ 0.

  CONTINUE.

ELSE.

   EXIT.

ENDIF.

ENDDO.

CALL FUNCTION 'BAPI_RECORD_GETELEMENTS'.

Regards,

Tp

0 Kudos

Hi TP,

how it is possible to propose some improvements without knowing what is taking time here ??

Anyway could maybe help

S.N

0 Kudos

Hi TP,

as promised, my results: For 50 records, my Test-Report took 107 sec. before implementing your suggestions. After that, it took 105 sec. So in my eyes, unfortunately it didn*t speed up the process - still over 70% of the time for BAPI_RECORD_GETELEMENTS.

Still, thank you very much!

Dominik