08-30-2012 11:07 AM
i have here my deposit register report it works fine in dvb server but when uploaded in prd server it is very slow
in getting the data in the table BSEG...
i just wanna know how can i make it more faster in retrieving the on BSEG..?
Moderator message : Post the discussion with specific & sufficient information. discussion locked.
Message was edited by: Vinod Kumar
08-30-2012 11:29 AM
Hi
Your code is not upto the standards, follow the standards and modify accordingly. Dont use inner joins use for all entries.
Dont write select statements within a loop.
08-30-2012 11:35 AM
Hi juben,
i have also nface same issue related to bseg and bsas tables..
dont use inner joins for the below select query in ur report ,
split that query into two select statements
SELECT BSIS~BELNR
BSIS~DMBTR
BSIS~HKONT
BSIS~BLDAT
BSIS~SHKZG
BSAS~BELNR
BSAS~XBLNR
BSAS~DMBTR
BSAS~HKONT
BSAS~BLDAT
BSAS~SHKZG
INTO TABLE GT_COMBI
FROM BSIS INNER JOIN BSAS ON BSIS~belnr EQ BSAS~augbl
FOR ALL ENTRIES IN GT_BKPF
WHERE BSIS~BELNR EQ GT_BKPF-BELNR and BSIS~hkont NE BSAS~hkont
AND BSAS~SHKZG EQ 'S'
AND BSIS~SHKZG EQ 'S'.
anothee big mistake u have written select query inside loop.. dont do this..
out side the loop write select query..
and inside the loopuse read statemnts..
LOOP AT GT_COMBI INTO GS_COMBI.
SELECT BELNR
DMBTR
REBZG
REBZT INTO WA_BSEG FROM BSEG
WHERE REBZG EQ GS_COMBI-BELNR2
AND REBZT = 'V'.
GS_COMBI-DMBTR2 = GS_COMBI-DMBTR2 - WA_BSEG-DMBTR.
MODIFY GT_COMBI INDEX sy-tabix FROM GS_COMBI TRANSPORTING DMBTR2.
ENDSELECT.