<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>FETCH</title> <link rel="stylesheet" href="../../gaussr3.css" tppabs="http://www.gaussr3.com/gaussr3.css" type="text/css"> </head><body>
<p align="left">⚠ <b>
<span class="titulo">FETCH</span>⚠ </b>
</p>
<p align="left" class="gaussr3">⚠ <b>
Definicin⚠ </b>
</p>
<p align="left" class="gaussr3">Para obtener la siguiente lnea del resultado
de la orden⚠ <a href="open_cursor.htm" tppabs="http://www.gaussr3.com/abap4/sentencias/open_cursor.htm">
OPEN CURSOR⚠ </a>
utilizaremos la sentencia FETCH.</p>
<p align="left" class="gaussr3">⚠ <b>
Sintaxis:⚠ </b>
</p>
Las lneas ledas sobre el rea de trabajo <destino>, que se especifica en la clusula INTO. Si se puede leer la siguiente lnea la variable SY-SUBRC valdr 0, en caso contrari valdr 4.</p>
<p class="gaussr3">⚠ <b>
Ejemplo:⚠ </b>
</p>
WA LIKE SBOOK.
OPEN CURSOR C FOR SELECT * FROM SBOOK
WHERE CARRID = 'LH ' AND CONNID = '0400' AND FLDATE = '19950228' ORDER BY PRIMARY KEY.
DO.
FETCH NEXT CURSOR C INTO WA. IF SY-SUBRC <> 0. CLOSE CURSOR C. EXIT. ENDIF. WRITE: / WA-BOOKID, WA-CUSTOMID, WA-CUSTTYPE, WA-SMOKER, WA-LUGGWEIGHT, WA-WUNIT, WA-INVOICE.
ENDDO.</pre>
<span class="gaussr3">⚠ <b>
Vase tambin:⚠ </b>
⚠ <a href="open_cursor.htm" tppabs="http://www.gaussr3.com/abap4/sentencias/open_cursor.htm">
OPEN CURSOR⚠ </a>
,
⚠ <a href="close_cursor.htm" tppabs="http://www.gaussr3.com/abap4/sentencias/close_cursor.htm">
CLOSE CURSOR⚠ </a>
. </span>
</body>
</html>