Application Development and Automation 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: 
Read only

time out exception

Former Member
0 Likes
1,363

Hi, I have to modify a report because it takes a lot of time to get some records in a select sentence, and finally i always get a time out dump. I think i should use function SAPGUI_PROGRESS_INDICATOR when the program arrives to that select but i don't know hopw to use it...

this is part of the code i have..

SELECT aufnr

werks

budat ltxa1 rueck rmzhl ismnw ismne aufnr

learr pernr

FROM afru

INTO TABLE it_afru FOR ALL ENTRIES IN it_csla

WHERE learr = it_csla-lstar AND

stokz <> gc_marca AND

budat IN s_budat AND

stzhl = gc_stzhl_cero AND

pernr IN s_pernr.

at this point, the program doesn't go on, so i tried the following but don't know if it's ok or not...

data: lw_lineas type i.

DESCRIBE TABLE it_csla LINES lw_lineas.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = lw_lineas

text = 'Tratando datos AFRU'.

SELECT aufnr

werks

budat ltxa1 rueck rmzhl ismnw ismne aufnr

learr pernr

FROM afru

INTO TABLE it_afru FOR ALL ENTRIES IN it_csla

WHERE learr = it_csla-lstar AND

stokz <> gc_marca AND

budat IN s_budat AND

stzhl = gc_stzhl_cero AND

pernr IN s_pernr.

thanks in advance !!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,292

Hi Maria,

Create secondary index for following fields

learr

stokz

budat

stzhl

pernr

And report output should be quicker .

Regards

Mr Kapadia

9 REPLIES 9
Read only

Former Member
0 Likes
1,292

Hi Maria,

you can use FM TH_REDISPATCH in order to redispatch your context to a new process. But be careful, your program does no longer get a time-out.

Best regards,

Thomas

Read only

suresh_datti
Active Contributor
0 Likes
1,292

Using SAPGUI_PROGRESS_INDICATOR would be of no help in this context.. in fact it might even make the program run longer.. the real issue could be with your complex where clause. pl ensure that the itab it_csla is not empty & may be you can drop one or two conditions from the where clause.. & then delete the unwanted entries from it_afru after the initial SELECT.

~Suresh

Read only

Former Member
0 Likes
1,292

mmmm the problem is that before this select, there is a check it_csla[] is not initial... It's not my report, i'm just modifing it so i can't make too many changes...

Read only

0 Likes
1,292

try the following change..



SELECT aufnr
werks
budat ltxa1 rueck rmzhl ismnw ismne aufnr
learr pernr
FROM afru
INTO TABLE it_afru FOR ALL ENTRIES IN it_csla
WHERE learr = it_csla-lstar AND
budat IN s_budat AND
stzhl = gc_stzhl_cero.

delete it_afru  where stokz ne gc_marca.
delete it_afru where not pernr in s_pernr.


~Suresh

Read only

Former Member
0 Likes
1,292

hi Maria,

as per my understanding , the issue is to reduce the time taking for the select statement, if it is so , you may need to create secondary index for table afru to get the data quickly .becoz you are not using the primary keys in the select statement

Read only

Former Member
0 Likes
1,292

Did you check, if there are suitable indices for the table?

Best regards,

Thomas

Read only

Former Member
0 Likes
1,292

Ok, thanks, i'll try and let you know if it works...

Read only

Former Member
0 Likes
1,293

Hi Maria,

Create secondary index for following fields

learr

stokz

budat

stzhl

pernr

And report output should be quicker .

Regards

Mr Kapadia

Read only

Former Member
0 Likes
1,292

yes.. thanks, i thinks it will be the best way to solve it... because the other solution doesnt' work very well... i have created very few index because i've always been told there are some problems using them.. which are those problems ????

thanksss !!!!