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

Table GLPCA

Former Member
0 Likes
1,803

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,569

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...

14 REPLIES 14
Read only

Former Member
0 Likes
1,570

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...

Read only

0 Likes
1,569

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 ??

Read only

0 Likes
1,569

Could you post the code of the SELECT please?

Rob

Read only

0 Likes
1,569

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

Read only

0 Likes
1,569

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

Read only

0 Likes
1,569

Hi Vijay,

How do I create & use the secondary index ??

Thank You,

SB

Read only

0 Likes
1,569

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 ??

Read only

0 Likes
1,569

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

Read only

0 Likes
1,569

So you mean background mode by using t-code SM36 ??

Read only

0 Likes
1,569

yes

Read only

0 Likes
1,569

Ok Thank You Vijay ...

Read only

0 Likes
1,569

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

Read only

Former Member
0 Likes
1,569

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

Read only

ferry_lianto
Active Contributor
0 Likes
1,569

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