‎2006 Nov 27 3:35 AM
Hi,
I have a requirement where in I have to select data from table GLPCA ... this is a huge table ... Is there a way I can put the select query in background mode as the prg.. is getting timed out in the foreground mode... ?
Thank You,
SB.
‎2006 Nov 27 3:39 AM
for this either u have to use key fields or else create index on the fields which ur using in where clause....
even u can do it in background...using submit u can do this select in background mode and in foreground u have to wait till this backgroundjob gets completed and data is returned back...
‎2006 Nov 27 3:39 AM
for this either u have to use key fields or else create index on the fields which ur using in where clause....
even u can do it in background...using submit u can do this select in background mode and in foreground u have to wait till this backgroundjob gets completed and data is returned back...
‎2006 Nov 27 3:49 AM
Hi Ramesh,
I am already using the key fields ... but there is no increase in the performance ... & my BA did not suggest any indexes ... so only I am not using in the select ... but can you please explain how can I submit this select in the background mode ??
‎2006 Nov 27 3:52 AM
‎2006 Nov 27 4:05 AM
Hi Rob,
The select is :-
FORM GET_GLPCA_DATA .
SELECT RYEAR
DRCRK
POPER
RBUKRS
RPRCTR
RACCT
TSL
HSL
KSL
USNAM
SGTXT
BLDAT
BUDAT
REFDOCNR
REFDOCLN
BLART
FROM GLPCA
INTO TABLE T_GLPCA
WHERE POPER IN S_POPER AND
RBUKRS IN S_RBUKRS AND
RPRCTR IN S_RPRCTR AND
KOKRS = 'ZSA1' AND
RACCT IN S_RACCT AND
USNAM IN S_USNAM AND
BUDAT IN S_BUDAT AND
REFDOCNR IN S_REFDOC AND
RYEAR IN S_RYEAR AND
RTCUR IN S_RTCUR .
IF SY-SUBRC = 0.
SORT T_GLPCA BY REFDOCNR.
ELSE.
MESSAGE I018. " No records found.
EXIT.
ENDIF.
ENDFORM. " GET_GLPCA_DATA
‎2006 Nov 27 4:14 AM
Hi,
Guess you are not using the KEY field in the select. Wihtout the key field the selcte will definitely be slower. Try creating secondary index.
Cheers
VJ
‎2006 Nov 27 4:18 AM
Hi Vijay,
How do I create & use the secondary index ??
Thank You,
SB
‎2006 Nov 27 5:29 AM
Well VJ there are already 5 indexes that are created in the table ... but unfortunately I cannot use any of those indexes... Can you please tell me what background method you were going to sugget me in your previous responses ??
‎2006 Nov 27 5:34 AM
Hi,
I think the only other option is to run your report in which you have defined the select statement in the background. But this option might not work if the requirement is to have the output displayed to the user in the foreground.
Cheers
VJ
‎2006 Nov 27 5:46 AM
‎2006 Nov 27 5:48 AM
‎2006 Nov 27 5:53 AM
‎2006 Nov 27 2:35 PM
There alreaqy is an index on KOKRS, RYEAR and RPRCTR for this table and you are using them in your select statement. So there is no need to create an index.
But you should make sure that neither S_RYEAR nor S_RPRCTR are empty before doing the select.
Rob
‎2006 Nov 27 3:56 AM
Hi,
USe transaction SDBE to check out the efficient select statement for that table. SDBE can be used to check which select query will be maximum effective.
Cheers
VJ
‎2006 Nov 27 4:25 AM
Hi SB,
Please check this link on how to create secondary index.
http://help.sap.com/saphelp_nw04/helpdata/en/cc/7c58b369022e46b629bdd93d705c8c/content.htm
Once you have created secondary with the key fields that you needed for the above select statement, then you just use the same select statement codes.
Hope this will help.
Regards,
Ferry Lianto