‎2008 Apr 09 3:40 PM
Guys , I need an advice, I'm doing the following code, but I´n not sure if it can work or could be very slow , the thing is that que ti_referenc could have more than 1 million entries , what else is possible to do ?
LOOP AT ti_referenc.
OPEN CURSOR WITH HOLD cursor1 FOR
SELECT * FROM zpf_cob_doc_ext
WHERE referencia = ti_referenc-ref.
FETCH next cursor cursor1
APPENDING CORRESPONDING FIELDS OF TABLE it_zpf_cob_doc_ext
PACKAGE SIZE p_commit.
CLOSE CURSOR cursor1.
ENDLOOP.
thank you a lot.
‎2008 Apr 09 3:44 PM
hi,
You can even add additional code as below ..
OPEN CURSOR WITH HOLD cursor1 FOR
SELECT * FROM zpf_cob_doc_ext
WHERE referencia = ti_referenc-ref.
DO.
FETCH next cursor cursor1
APPENDING CORRESPONDING FIELDS OF TABLE it_zpf_cob_doc_ext
PACKAGE SIZE p_commit.
IF sy-subrc <> 0.
CLOSE CURSOR cursor1.
EXIT.
ENDIF.
ENDDO.
‎2008 Apr 09 3:44 PM
hi,
You can even add additional code as below ..
OPEN CURSOR WITH HOLD cursor1 FOR
SELECT * FROM zpf_cob_doc_ext
WHERE referencia = ti_referenc-ref.
DO.
FETCH next cursor cursor1
APPENDING CORRESPONDING FIELDS OF TABLE it_zpf_cob_doc_ext
PACKAGE SIZE p_commit.
IF sy-subrc <> 0.
CLOSE CURSOR cursor1.
EXIT.
ENDIF.
ENDDO.