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: 

Time Out error

Former Member
0 Kudos

Hi All,

I have a issue related to SAP Web related client.

on the front end web client - enduser tries to enter the sales order contents to check the material avalibilty with dates by clicking button CHECK AVAILABILTY.

when the user tries to enter line items more than 50 - the screen we could see error message like " GATEWAY TIMEOUT ERROR " .

Java consultant increased Apache server time from 3 min's to 9 min's in production system.

So, now we are not getting any time out error in production. But I checked in sandbox and quality systems with 50 entries,the bapi executing time with in 2 min's.

and internally my zbapi calling stanadard bapi BAPI_SALESORDER_SIMULATE Funtion module 2 times

Now the concern is if we increase the time to 9 minutes from JAVA end u2013 itu2019s not a proper solution as the end user will not wait for the 9 minutes of the transaction to happen.

From SAP end u2013 I tried to check by simulating BAPI u2013 with 50 lineitems and its not taking more than 2minutes u2013 is there any other way to solve the " GATEWAY TIMEOUT ERROR " .

Thanks & Regards,

varma

1 REPLY 1

former_member657499
Participant
0 Kudos

Is there a reason why you are using BAPI_SALESORDER_SIMULATE? You can directly call BAPI_MATERIAL_AVAILABILITY to get availability dates ...

BTW, if your runtime is very long, then split the number of lines in your ZPROGRAM into sets of 10 line items each and call BAPI_SALESORDER_SIMULATE for each set using parallel processing. When the data returns just merge the results from these sets and pass it back to the Web client.

sample pseudo code:

data: count type sy-dbcnt.

data: bapi_call_count type i,

receive_result_count type i.

Loop at line items.

add 1 to count.

if count ge 10.

clear count.

call function 'BAPI_SALESORDER_SIMULATE' starting new task

performing get_results on end of task

exporting ...

tables .... (exclude RETURN and other tables exported by the FM)

exceptions ....

if sy-subrc = 0.

add 1 to bapi_call_count.

endf.

else.

build BAPI structures.

continue.

endif.

endloop.

wait until bapi_call_count = receive_result_count.

.... at this point you'll have results from all BAPIs merged from multiple calls.

Return data back to your web service.

perform GET_RESULTS.

receive results from 'BAPI_SALESORDER_SIMULATE'

importing ...

tables .... (only include tables that are being returnd by this FM, don't include anything that you passed in the first call)

exceptions ...

append whatever data you want to global internal tables.

Add 1 to RECEIVE_RESULTS_COUNT.

endform.

Edited by: Raj on Jun 21, 2010 6:30 AM

Note: In SM51 tcode, you'll see how many dialog processes are available. If the number of parallel processes exceeds the number of PIDs then you'll receive empty tables in FORM GET_RESULTS. Therefore, you may want to add a FM to check the number of PIDs available before calling BAPI starting new task.