Application Development and Automation 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: 
Read only

How to speed up abap program?

Former Member
0 Likes
2,065

Hi,

I write a program using SHDB to transfer data. When I transfer a lot data the program run too slow, I think it run slow because it have not have enough memory, but I don't know how to give more memory to a program. That any body help me please!

Thank, for read!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,342

What data are you posting?

Instead of going for SHDB recordings, you may wish to try BAPIs.

BAPIs are more flexible and faster.

regards

8 REPLIES 8
Read only

Former Member
0 Likes
1,343

What data are you posting?

Instead of going for SHDB recordings, you may wish to try BAPIs.

BAPIs are more flexible and faster.

regards

Read only

0 Likes
1,342

I transfer network activity (service activity) I can't use BAPIs because the network activity using Model service specification and I can't find the BAPI support it.

Thank for your reply!

Read only

0 Likes
1,342

If you must use SHDB, I think you can only reduce the number of fields manged into the SHDB registration. I mean, you can delete all the lines not necessary, for example all the lines where cursor is set or the lines where a field is overwritten tywivce with the same value. This will reuce your BDCAREA and maybe will speed up your SHDB processing.

Read only

Former Member
0 Likes
1,342

Lack of memory is not the issue why your program is slow. If there is not enough memory, then your program would have failed with a short dump.

BDC itself is not slow unless you are inserting or changing thousands of records/documents. Problem with BDC is that it will update only one record at a time and goes through all the screens. If there is no BAPI or function module to achieve the same result, then BDC is your best choice.

You should perform run time analysis (SE30) to determine what exactly is causing the performance issues.

Read only

0 Likes
1,342

Thank all for your reply,

Is there anyway to speed up the program?

Thank!

Read only

0 Likes
1,342

hi Cuong Nguyen Cao ,

u can speed up a abap program by following ways

1. using a sinle select with joins instead of several selects

2. use select into table insatead of select.. endselect

3. try to give all the primary keys in the where condition of the select.

4. if you have fields other than primar keys in the where then try to create a secondry index with the same fields in the table

5. try to remove inner loops instead use READ TABLE

6. if inner loops are unavoidable use where condition in inner loop using the fields in 1st loop itab n 2nd loop itab

7. while using READ TABLE use index or where condition with keys

8. while updating a table with multiple entries try to update all the entries at once.

9. try to remove any call functions inside loop insead call them before loop and take inputs in a table.

hope these points would be helpfull

regards

laxmikanth

Read only

Former Member
0 Likes
1,342

your question is much too general to get a good answers.

Always test with smaller seelctions first. Run SQL and ABAP trace check whether there are some statements very expensive.

Check how time develops when you increase the amount of data, if should not grow faster than linear (at the beginning even faster!!)

If this is fulfilled (which is usually not h case), then extrapolate and check a larger example. It can happen that you encounter limits (memory, caches etc - no everything leads to a dump) which slows down the processing.

Use package size to work in smaller packages.

Siegfried

Read only

0 Likes
1,342

If BDC is too slow for you, the only other option is direct table update. Given that you know all your destination tables & its relationships.