‎2007 Apr 24 3:14 PM
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 !!!
‎2007 Apr 24 3:48 PM
Hi Maria,
Create secondary index for following fields
learr
stokz
budat
stzhl
pernr
And report output should be quicker .
Regards
Mr Kapadia
‎2007 Apr 24 3:22 PM
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
‎2007 Apr 24 3:22 PM
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
‎2007 Apr 24 3:30 PM
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...
‎2007 Apr 24 3:34 PM
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
‎2007 Apr 24 3:32 PM
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
‎2007 Apr 24 3:33 PM
Did you check, if there are suitable indices for the table?
Best regards,
Thomas
‎2007 Apr 24 3:42 PM
‎2007 Apr 24 3:48 PM
Hi Maria,
Create secondary index for following fields
learr
stokz
budat
stzhl
pernr
And report output should be quicker .
Regards
Mr Kapadia
‎2007 Apr 24 3:54 PM
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 !!!!