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 limit exceeded ?

Former Member
0 Kudos
213

Hi Everyone,

I am trying the following code which runs in debug mode but when I execute program without debugging mode it is giving short dump.

The message statement in the code outputs message in debug mode but not in normal one.

Earier it was giving "sql statement too large" error thats why I have broken it into pieces still it is giving timeout.

T_MARA & T_VENDOR are the internal tables that contains values to select from EINA (Info records).

*********************************************************

DO.

REFRESH S_MATNR.

S_MATNR-SIGN = 'I'.

S_MATNR-OPTION = 'EQ'.

LOOP AT T_MARA FROM INDEX_FROM TO INDEX_TO.

S_MATNR-LOW = T_MARA-MATNR.

APPEND S_MATNR.

ENDLOOP.

SELECT * FROM EINA APPENDING TABLE T_EINA

WHERE MATNR IN S_MATNR

AND LIFNR IN S_LIFNR

AND LOEKZ EQ ' '.

INDEX_FROM = INDEX_TO + 1.

IF INDEX_FROM > MAXLINE.

EXIT.

ENDIF.

INDEX_TO = INDEX_TO + 1000.

<b>MESSAGE</b> S005(ZSRS) WITH 'selecting records from ' INDEX_FROM ' to '

INDEX_TO.

ENDDO.

*******************************************************

This is somewhat urgent.

Thanks & Regards,

Ankur

1 ACCEPTED SOLUTION

Former Member
0 Kudos
143

try to run program in background

thanks

surjit

6 REPLIES 6

Former Member
0 Kudos
144

try to run program in background

thanks

surjit

Former Member
0 Kudos
143

hi,

i'm confused, you try this

S_MATNR-SIGN = 'I'.

S_MATNR-OPTION = 'EQ'.

LOOP AT T_MARA .

S_MATNR-LOW = T_MARA-MATNR.

APPEND S_MATNR.

ENDLOOP.

SELECT * FROM EINA into TABLE T_EINA

WHERE MATNR IN S_MATNR

AND LIFNR IN S_LIFNR

AND LOEKZ EQ ' '.

the problem is in debugging mode you may check one or twice, but actually it appends no of times

second one inside the loop we must avoid select statement especially append this will affect performence very much

cheers,

sasi

ChristianFi
Active Participant
0 Kudos
143

The statement too large refers most likely to Matnr - which could could be solved by using for all entries. But this would probably not solve your time-out issue.

What you could do (if you must) is instead of message use the fm sapgui_progress_indicator which can exceed the time-out parameter of a dialog process. Or consider to run it in Batch.

Check also if your select is provided by secondary index (there are one one material and one on supplier - which one is taken? )

Christian

0 Kudos
143

Thanks for the quick reply !

So I'll try to use FM sapgui_progress_indicator.

In the meanwhile could anybody plz help me in optimizing the code.

Thanks & Regards,

Ankur

0 Kudos
143

As I said first check which index is found.

Then you could use for all entries (by considering all typical pitfalls there - check of empty table etc....

Also you could reduce the network load by specifying which fields you need from EINA instead of fetching them all.

Another ideas is - are there duplicates in T_MATNR? - remove them first

Or

Use a subquery to reduce the numbers of database connects (this pressumes that you could retrieve the material by a database selection)

In some cases the addition of package size or the open cursor statement with the fetch command is helpful but I am not sure if it is faster than your current solution.

Christian

0 Kudos
143

Make sure S_LIFNR is not empty.

Rob