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 of bapi BAPI_SALESORDER_CHANGE.

Former Member
0 Kudos
1,226

Now we meet the reqeust to split the order item by quantity in order to assign wbs number to each material

For example the sales order contains one item with 10 Qty and we need to split to 10 items and each item with 1Qty

Order:

Line 0001 Material 10Qty

Change to:

Line 0001 Material 1Qty WBS-001

Line 0002 Material 1Qty WBS-002

Line 0003 Material 1Qty WBS-003

......

Line 0010 Material 1Qty WBS-010

We used bapi BAPI_SALESORDER_CHANGE to do above process but the run time seems very slowly (time out)

I tried to delete the schedule_lines and schedule_linessx from import for test.

it runs fast but the result is there is no quantity in each line item.

without schedule_line import, the order will be:

Line 0001 Material 0Qty WBS-001

Line 0002 Material 0Qty WBS-002

Line 0003 Material 0Qty WBS-003

......

Line 0010 Material 0Qty WBS-010

Does any one tried BAPI BAPI_SALESORDER_CHANGE and met the same problem (slowly)?

And any suggestion?

Thank you very much!

14 REPLIES 14

Former Member
0 Kudos
232

Hi,

I think two step processing may help you to improve the performance. Delete the line item first (ORDER_ITEM_INX-UPDATEFLAG = 'D') and then insert the line items (ORDER_ITEM_INX-UPDATEFLAG = 'I').

Regards

Vinod

0 Kudos
232

Dear Vinod

I will try it.

Former Member
0 Kudos
232

Hi,

BAPI_SALESORDER_CHANGE should not raise time out,

unless you process huge amount of data.

Maybe some data are locked or some user-exit causes infinite loop or incorrect select on large table.

Try to perform runtime analysis with small amount of data,

and during execution check SM12 for locks and SM50 for sequential reads.

Regards,

--

Przemysław

0 Kudos
232

Hi Przemysław

I tried with 20 Qty and it runs nearly 10 minutes.

with 3 Qty and it runs nearly 2 minutes.

I don't think the amout is large.

anyway i will try your suggestion.

Many thanks,

0 Kudos
232

Hi,

the amount is definatelly not large

You can easily modify order with tens of items and with bigger quantity,

so some select or read statements are wrong.

Try to check execution of this 3 Qty test.

Regards,

--

Przemysław

0 Kudos
232

But actuall the cost is occurred in BAPI.

i flag break point at the begin and end of this BAPI. it runs long time.

since it is a standrad function, i have no idea....

0 Kudos
232

Hi,

probably some user-exits

Go to SE38->Execute->Runtime Analysis or SE93->Test->Runtime Analysis

you will get answer, what takes so much time.

Regards,

--

Przemysław

0 Kudos
232

Hi

It shows Perform KONDITIONEN_LESEN and Open Cursor A057 cost a lot of time.

do you have any idea?

0 Kudos
232

Hi,

no idea without debugging and checking the code - maybe missing db indices.

Go to the form and check it.

Regards,

--

Przemysław

0 Kudos
232

Hi,

Trace your program using st05 check where conditionof table a057 in trace SQL list and create secondary index on table according to where condition found in your SQL trace for table a057

Rgds

Ravi Lanjewar

Former Member
0 Kudos
232

check this:

it's answered.

--

Reddy

0 Kudos
232

Hi,

I think this is not solution of problem, It solution of bapi not updating database.

Rgds

Ravi Lanjewar

Edited by: Ravishankar Lanjewar on Jun 8, 2010 5:36 PM

Former Member
0 Kudos
232

Rather than asking the forum about the performance of a standard SAP BAPI, you should be looking for notes or contacting OSS. There are a number of performance related notes for this.

Rob

0 Kudos
232

Hi,

You should used the SET UPDATE TASK LOCAL before calling the BAPI.

It will seem to be improve the performance.

Rgds

Ravi