W Pub: ABAP Cursosentenciaformat

<html>

<head>

<title>FORMAT</title>

</head>

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

<p align="left">⚠ &lt;b&gt;<span class="titulo">FORMAT</span>⚠ &lt;/b&gt;</p>

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

<p align="left">Se utiliza para dar formato a las sentencias de

  escritura en el dispositivo de salida.</p>

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

<pre>FORMAT <opcin1> [ ON | OFF ] <opcin2> [ ON | OFF ] .....

</pre>

<p>Con esta opcin variante podemos dar opciones de formato estticamente.

  Las opciones de formato <opcin1>, <opcin2> ..., tienen efecto 
  a partir de la ejecucin de esta sentencia y hasta que nos encontremos una de 
  desactivacin (o sea, que ponga OFF). ON y OFF son opcionales, la opcin por 
  defecto es ON.</p>

<p>Algunas de las opciones ms utilizadas son las siguientes:</p>

<table border="0" width="93%">

  <tr> 
    <td width="35%">⚠ &lt;b&gt;Opcin⚠ &lt;/b&gt;</td>
    <td width="65%">⚠ &lt;b&gt;Significado⚠ &lt;/b&gt;</td>
  </tr>
  <tr> 
    <td width="35%">COLOR</td>
    <td width="65%">Color del listado.</td>
  </tr>
  <tr> 
    <td width="35%">INTENSIFIED</td>
    <td width="65%">Intensidad de salida.</td>
  </tr>
  <tr> 
    <td width="35%">INPUT</td>
    <td width="65%">Campos de entrada en el listado.</td>
  </tr>
  <tr> 
    <td width="35%">HOTSPOT</td>
    <td width="65%">Define campos sensibles al cursor (hotspot).</td>
  </tr>

</table>

<pre>FORMAT <opcin1> = <var1> <opcin2> = <var2> ...</pre>

<p>Con esta variante damos formato de manera dinmica. El sistema

  interpreta las variables <var1>, <var2>, ..., como numricas (tipo 
  I). Si el valor de la variable es 0 tiene el mismo efecto que OFF. Si el contenido 
  de la variable es distinto de 0, el efecto es ON. Con la opcin COLOR, el valor 
  indica el color. Si a continuacin de una sentencia FORMAT aparece una sentencia 
  ⚠ &lt;a href="write.htm" tppabs="http://www.gaussr3.com/abap4/sentencias/write.htm"&gt;WRITE⚠ &lt;/a&gt; con opciones de formato, estas ltimas sobreescriben 
  las opciones de FORMAT. Las opciones de la sentencia FORMAT slo tienen efecto 
  sobre el evento (bloque de proceso) donde se ejecuten. Cuando se inicia un bloque 
  de proceso los valores de todas las opciones de formato toman sus valores por 
  defecto. Estos valores son OFF para todas las opciones menos para la opcin 
  INTENSIFIED.</p>

<pre>FORMAT RESET.</pre>

<p>Con esta variante ponemos todas las opciones de formato a sus

  valores por defecto. </p>

<pre>FORMAT COLOR <n> [ ON ] INTENSIFIED [ ON | OFF ] INVERSE [ ON | OFF ].</pre>

<p>Esta variante se utiliza para poder colores de manera esttica.</p>

<pre>FORMAT COLOR = <c> INTENSIFIED = <int> INVERSE = <inv>.</pre>

<p>Con esta variante podemos asignar colores de manera dinmica.

  Los posibles valores de <n> y <c> son los siguientes:</p>

<table border="0" width="100%">

  <tr> 
    <td width="20%">⚠ &lt;b&gt;<n>⚠ &lt;/b&gt;</td>
    <td width="4%">⚠ &lt;b&gt;<c>⚠ &lt;/b&gt;</td>
    <td width="14%">⚠ &lt;b&gt;color⚠ &lt;/b&gt;</td>
    <td width="63%">⚠ &lt;b&gt;Uso recomendado por SAP⚠ &lt;/b&gt;</td>
  </tr>
  <tr> 
    <td width="20%">OFF o COL_BACKGROUND</td>
    <td width="4%">0</td>
    <td width="14%">Depende del GUI</td>
    <td width="63%">Color de fondo</td>
  </tr>
  <tr> 
    <td width="20%">1 o COL_HEADING</td>
    <td width="4%">1</td>
    <td width="14%">Azul</td>
    <td width="63%">Cabeceras</td>
  </tr>
  <tr> 
    <td width="20%">2 o COL_NORMAL</td>
    <td width="4%">2</td>
    <td width="14%">Gris</td>
    <td width="63%">Cuerpo del listado</td>
  </tr>
  <tr> 
    <td width="20%">3 o COL_TOTAL</td>
    <td width="4%">3</td>
    <td width="14%">Amarillo</td>
    <td width="63%">Totales</td>
  </tr>
  <tr> 
    <td width="20%">4 o COL_KEY</td>
    <td width="4%">4</td>
    <td width="14%">Verde azulado</td>
    <td width="63%">Columnas clave</td>
  </tr>
  <tr> 
    <td width="20%">5 o COL_POSITIVE</td>
    <td width="4%">5</td>
    <td width="14%">Verde</td>
    <td width="63%">Significado positivo</td>
  </tr>
  <tr> 
    <td width="20%">6 o COL_NEGATIVE</td>
    <td width="4%">6</td>
    <td width="14%">Rojo</td>
    <td width="63%">Significado negativo</td>
  </tr>
  <tr> 
    <td width="20%">7 o COL_GROUP</td>
    <td width="4%">7</td>
    <td width="14%">Violeta</td>
    <td width="63%">Niveles</td>
  </tr>

</table>

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

<pre>FORMAT INTENSIFIED INPUT.

WRITE 5 'JOHN'.

FORMAT INPUT OFF.

WRITE 40 'CARL'COLOR COL_GROUP.

</pre>

<pre>La salida en pantalla es la siguiente:</pre>

<pre> ....+....10...+....20...+....30...+....40...+</pre>

<pre> JOHN CARL</pre>

<pre>Salida <------->

intensificado: <------------------------------------------>

color: <--->

</pre>

<p>⚠ &lt;b&gt;Vase tambin:⚠ &lt;/b&gt; ⚠ &lt;a href="write.htm"&gt;WRITE⚠ &lt;/a&gt;.</p>

</body>

</html>