W Pub: ABAP Cursosentenciadefine

<html>

<head>

<title>DEFINE .. END-OF-DEFINITION</title>

</head>

<BODY BGCOLOR="#000000" TEXT="#FFFFFF" LINK="#0099FF" VLINK="#AA0000">

<p align="left">⚠ &lt;b&gt;<span class="titulo">DEFINE .. END-OF-DEFINITION</span>⚠ &lt;/b&gt;</p>

<p align="left">⚠ &lt;b&gt;Definicin⚠ &lt;/b&gt;</p>

<p align="left">Define una macro que contiene parte de cdigo

  fuente, con la posibilidad de utilizar parmetros.</p>

<p align="left">⚠ &lt;b&gt;Sintaxis:⚠ &lt;/b&gt;</p>

<pre>DEFINE <macro>.

... [ <&1> ... <&9> ]

END-OF-DEFINITION.</pre>

<pre><macro> [ <p1> ... <p9> ]</pre>

<p>Para definir una macro se utilizan las palabras claves DEFINE

  y END-OF-DEFINITION. Entre ellas se incluyen las sentencias que formarn la 
  macro. Se pueden incluir parmetros ( <&1> ... <&9> ) que 
  sern sustituidos en la llamada. La llamada a la macro se realiza con el nombre 
  de la macro. Durante la generacin del programa el sistema reemplaza los parmetros 
  utilizados en la llamada.</p>

<p>⚠ &lt;b&gt;Ejemplo:⚠ &lt;/b&gt;</p>

<pre>DEFINE ++.

ADD 1 TO &1.

END-OF-DEFINITION.

DATA: NUMBER TYPE I VALUE 1.

...

++ NUMBER.

⚠ &lt;b&gt;Vease tambin: ⚠ &lt;/b&gt;⚠ &lt;a href="form_endform.htm" tppabs="form_endform.htm"&gt;FORM⚠ &lt;/a&gt;, ⚠ &lt;a href="function_endfunction.htm" tppabs="function_endfunction.htm"&gt;FUNCTION⚠ &lt;/a&gt;.</pre>

</body>

</html>