Google Search - Blog...........

ABAP - Use Of CURSOR Keyword With Select Queries.

REPORT ZTEST_DWBLD1.

data: it_ekko like ekko occurs 5 with header line.

data: v_aedat type sy-datum.
DATA: dbcur TYPE cursor.

start-of-selection.

v_aedat = '20001102'.

OPEN CURSOR dbcur FOR
select * from ekko where aedat = '20001102'.

do.
FETCH NEXT CURSOR dbcur INTO table it_ekko package size 5.

if sy-subrc <> 0.
close cursor dbcur.
exit.
else.

loop at it_ekko.
write: / it_ekko-ebeln.
endloop.
refresh it_ekko.
endif.
enddo.

No comments:

Post a Comment