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: 

Function BERECHNEN_BESTAND performance

Former Member
0 Kudos

Hello Gurus.

I'm writing a report that creates an extract file from Function BERECHNEN_BESTAND (used in Transaction MC49 etc).

The requirement is to run it for all materials in several plants. This will have a long background run time of +2 hours.

Presently the program builds up a large 10,000 row table of Plant/Materials and loops at BERECHNEN_BESTAND 10,000 times.

I thought I could improve performance by Calling BERECHNEN_BESTAND once with 10,000 Plant/materials (or calling it 10 times with 1000 plant/materials, etc).

This did not work as I expected, and actually made performance much worse! I guess it's a memory issue.

Thanks for any comments/suggestions.

Zenon K.

p.s. (I found note 457615 that adds an index to MSEG. This did improve performance when running BERECHNEN_BESTAND 10,000 times)

5 REPLIES 5

Former Member
0 Kudos

More to the point; What is faster?

1) To Call a Function 1 time with a very large table as an input parameter,

OR

2) Call the Function in a loop thousands of times with 1 line.

??

0 Kudos

Too many unknown variables to say for sure. Why don't you try both and get back to the forum with your results?

Rob

0 Kudos

For BERECHNEN_BESTAND it's much faster (at least twice) to call it in a loop with 1 line.

I wondered if there was anything I can do outside of Abap code that would help give better performance.

I'm running SAP ECC on WIndows NT with MS SQL database.

Are there any changes I can make or check on the database, memory, basis components?

0 Kudos

Hi Zenon,

Running a ST05 trace could give you additional information on needed index. Also since this is a read intensive process placing the table into a tablespace located on a Enterprise Flash Drive (Memory drive) would certainly help. EMC Fully Automated storage tiering puts highly active blocks on the top tier automatically but unless all this data is accessed often you would need to place it there yourself or with a DBA. Unless you really need faster performance that may be overkill but if there were several applications that together could be justified then it may make sense. Good Luck

Allan Stone

SAP Solutions Architect

EMC Solutions Design Center

Former Member
0 Kudos

Thanks for the replies.