Documentos de Académico
Documentos de Profesional
Documentos de Cultura
1. Página inicial
2. Crear una ventana
3. Crear párrrafo por defecto
Finalizando
Seleccionamos Parametrizaciones básicas
Grabamos
Activamos el Formulario
…
Ver el Formulario
…
Datos de Conexión
FORM: ZDUMMY_FORM
o PAGE: MAIN
Ventana: MAIN
o Parrafo: MA
Elemento ITEM
&<FS_PROGRAMAS>-ID_PROG&
&<FS_PROGRAMAS>-NOMBRE_PROG&
printer
screen
telefax
fax
form El nombre del formulario
ESCRIBIR EN UN FORMULARIO
Para enviar datos del programa al formulario se usa la
función WRITE_FORM
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 01.
ELEMENT es el nombre del elemento de textos que deseamos enviarle
datos ITEM
Programa de ejemplo ZFORM.ABAP
Las tablas ITCPO, TOA_DARA y ITCPP son necesarias para poder
ejecutar el SAPScript.
TABLES: ZPROGRAMAS,ITCPO,TOA_DARA,ITCPP.
La variable V_FORM contendrá el nombre del formulario, mientras que
la variable V_SCRIPT nos sirve para determinar si el formulario está
activo o no.
DATA: V_FORM(14) TYPE C,
V_SCRIPT.
Parámetro impresión, salida inmediata
Parámetro impresión, borrar tras salida
Parámetro impresión, tiempo de permanencia en SPOOL
Visualización de impresión.
ITCPO-TDIMMED = '*'.
ITCPO-TDDELETE = '*'.
ITCPO-TDLIFETIME = '7'.
ITCPO-TDPREVIEW = 'X'.
Iniciamos la ejecución del formulario.
CALL FUNCTION 'START_FORM'
EXPORTING
FORM= V_FORM
LANGUAGE= 'S'.
Si la variable V_SCRIPT está vacía, entonces debemos abrir el
formulario, para esto utilizamos el módulo de funciones OPEN_FORM.
IFV_SCRIPT EQSPACE.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM= V_FORM
LANGUAGE= 'S'
OPTIONS= ITCPO
ARCHIVE_INDEX= TOA_DARA
DEVICE = 'PRINTER'
DIALOG = 'X'
EXCEPTIONS
CANCELED = 01.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
V_SCRIPT = 'X'.
ENDIF.
Hacemos un LOOPa la tabla interna T_ZPROGRAMAS y asignamos
los valores al Field-Symbol . Por cada vuelta del LOOP, llamamos al
módulo de funciones WRITE_FORMque lo que hace es llamar a la
ventana de nuestro formulario.
LOOP ATT_ZPROGRAMAS
ASSIGNING<FS_PROGRAMAS>.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT= 'ITEM'
WINDOW= 'MAIN'
EXCEPTIONS
OTHERS= 01.
ENDLOOP.
Con el módulo de funciones END_FORM indicamos que hemos
terminado de utilizar la ventana. Si la variable V_SCRIPTno está
vacía, cerramos el formulario con el módulo de funciones
CLOSE_FORM.
CALL FUNCTION 'END_FORM'
IMPORTING
RESULT = ITCPP.
IFV_SCRIPT NESPACE.
CALL FUNCTION 'CLOSE_FORM'.
ENDIF.
Comandos SAPSCRIPT
Cadenas de caracteres:
Las cadenas de caracteres son elementos de edición para una parte
de un párrafo y son insertadas directamente en el texto. El comienzo
del ámbito de texto es marcado con y el final con </>, siendo XX el
nombre de la cadena de caracteres definida en el formulario.
BOX Command
Effect: draws a box of the specified size at the specified position.
Additions: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME,
you must specify both a measurement and a unit of measurement.
Specify the INTENSITY parameter as a percentage between 0 and
100.
Unit: The following units of measurement may be used:
TW (twip)
PT (point)
IN (inch)
MM (millimeter)
CM (centimeter)
LN (line)
CH (character)
Conversion factors:
1 TW = 1/20 PT
1 PT = 1/72 IN
1 IN = 2.54 CM
1 CM = 10 MM
1 CH = height of a character relative to the CPI specification in the
form header
1 LN = height of a line relative to the LPI specification in the form
header
Example
/: BOX FRAME 10 TW
Draws a frame around the current window with a frame thickness of 10
TW (= 0.5 PT).
/: BOX INTENSITY 10
Fills the window background with shading having a grayscale of 10%.
/: BOX HEIGHT 0 TW FRAME 10 TW
Draws a horizontal line across the complete top edge of the window.
/: BOX WIDTH 0 TW FRAME 10 TW
Draws a vertical line along the complete height of the left hand edge of
the window.
/: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
/: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
/: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
Draws two rectangles and two lines to construct a table of three
columns with a highlighted heading.
POSITION Command
/: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
Effect: Sets the origin for the coordinate system used by the XPOS and
YPOS parameters of the BOX command. When a window is first
started, the POSITION value is set to refer to the upper left corner of
the window (default setting).
Additions: If a parameter value does not have a leading sign, then its
value is interpreted as an absolute value, in other words, as a value
that specifies an offset from the upper left corner of the output page. If
a parameter value is specified with a leading sign, then the new value
of the parameter is calculated relative to the old value. If one of the
parameter specifications is missing, then no change is made to this
parameter.
Example
/: POSITION WINDOW
Sets the origin for the coordinate system to the upper left corner of the
window.
/: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
Sets the origin for the coordinate system to a point 2 cm from the left
edge and 2.5 cm from the upper edge of the output page.
/: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
Shifts the origin for the left upper coordinate 1.5 cm to the left and 1 cm
up.
Comandos
Incluyendo el CB en el SAPScript
Se creo una nueva ventana para el CB
Se creo el Formato del código de barras
C1 para el código de barras
Introducir el texto
Probando
Imprimir físicamente
Escanear con una Tablet
Impresión de salida
Escaneando
Nueva
Nombre
Escojamos Rotado
Aparece nuestro CB
Modificar el Formato de Carácter con el nuevo
código de barras.
Modificar el Layout
EL RESULTADO
Impresión en Impresoras de
ETIQUETAS
Crear el Texto Estándar S010
Subir el texto estándar (formato ITF)
Filosofía
El texto se debe acomodar de acuerdo al párrafo, linea a linea.
Las imágenes BOX se acomodan por aparte con xpos ypos
Son máscaras diferentes
Bibliografia