2005 Sep 30 10:20 AM
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
2005 Sep 30 10:27 AM
2005 Sep 30 10:27 AM
2005 Sep 30 10:29 AM
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
2005 Sep 30 10:31 AM
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
2005 Sep 30 11:43 AM
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
2005 Sep 30 2:13 PM
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
2005 Sep 30 3:19 PM