‎2008 Nov 27 12:16 PM
Moved to correct forum by moderator
Hi Experts,
In my program lot of nesteed loop used, i want to avoid that, so that way i am using parallel cursor.
But My program there is loops using structue plz help me.
Exp loop zstruc
loop zstruc1
endloop.
endloop.
Edited by: Matt on Nov 27, 2008 2:09 PM
‎2008 Nov 27 12:19 PM
hi,
you can use open cursor to fetch such large number of records and it will reduce the time and its very performnace effective.
a sample code is :
****************************************************
Selection using open cursor
*****************************************************
DATA: LWA_OP_SAL_ORD1 TYPE GT_COMTAB.
IF SY-SUBRC = 0.
OPEN CURSOR C1 FOR
SELECT VBAP~MATNR
FROM VBAP INNER JOIN VBAK
ON VBAPVBELN EQ VBAKVBELN
FOR ALL ENTRIES IN GIT_VBUK
WHERE VBAP~VBELN = GIT_VBUK-VBELN AND
VBAK~VBTYP = 'C'.
DO.
CLEAR LWA_OP_SAL_ORD1.
FETCH NEXT CURSOR C1 INTO CORRESPONDING FIELDS OF LWA_OP_SAL_ORD1.
IF SY-SUBRC = 0.
APPEND LWA_OP_SAL_ORD1 TO LI_OP_SAL_OR
enddo.
i think this will help.
‎2008 Nov 27 12:21 PM
Please note if my understanding is correct
if you can avoid nested loops by using READ TABLE statement
it would be better
Regards
Ramchander Rao.K
‎2008 Nov 27 12:22 PM
‎2009 Mar 04 1:19 PM