Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Will OPEN CURSOR improve performance

Moved to correct forum by moderator. Subject changed. Please use a more informative subject in future.

Hi All,

I have got a requirement to improve the performance of a report . While debugging i came to know that the program got struck at the FETCH CURSOR command.

OPEN CURSOR WITH HOLD cur1 FOR

  • Select data from the purchase order header table.

SELECT runit rprctr sprctr "CR0777

racct rfarea hsl msl kostl aufnr ps_psp_pnr

FROM glpca

WHERE docnr IN s_docnr

AND rbukrs = p_rbukrs

AND rprctr IN s_rprctr

AND sprctr IN s_sprctr "CR0777

AND rfarea IN s_rfarea

AND budat IN s_budat

AND kostl IN s_kostl

AND aufnr IN s_aufnr.

DO.

  • fetch rows from cursor depending on package size w.kuszelewicz

FETCH NEXT CURSOR cur1 INTO TABLE t_glpca

PACKAGE SIZE p_size.

IF sy-subrc NE 0.

CLOSE CURSOR cur1.

EXIT.

ENDIF.

What is the use of PACKAGE SIZE command with FETCH CURSOR? It is in the requirement.

Any suggestions on this...

Regards

Mudit

Edited by: Matt on Feb 12, 2009 2:10 PM

Not what you were looking for? View more on this topic or Ask a question