Archivo
Agregar nueva fuente TrueType para Sapscript/Smartforms
Caso: Se desea agregar una nueva fuente Truetype a SAP para utilizarlo en Sapscripts o Smartforms.
Solución: Por la SE73 ingresamos a la opción “Instalar font TrueType”
En la pantalla siguiente, definimos un nombre para la fuente (tomaremos de ejemplo el caso de la fuente Arial)
Las fuentes podemos rescatarlas de C:WindowsFonts o de Internet y en Arial por ejemplo existen 4 formas:
· arial.ttf (normal),
· arialbd.ttf (negrita o bold),
· ariali.ttf (cursiva o italic)
· arialbi.ttf (negrita cursiva o italic).
Esto quiere decir que tendremos que subir cada uno de los archivos cambiando los tildes de los atributos de la pantalla en cada caso.
Agregando la fuente normal, nos abre un popup donde indicamos el fichero Font si no lo indicamos
Nos va a pedir una OT de Workbench:
Y luego un texto
Finalmente nos da un informe:
Hacemos lo mismo con las otras variantes de la fuente Arial, por ejemplo para negrita o bold:
Nos preguntará si instalamos el nuevo Font y le ponemos que si:
Y así con el resto de las variantes de la fuente Arial. Luego en el smartstyles vemos como seleccionar la nueva fuente:
Bajar Smartforms y SmartStyles en forma masiva
Caso: se requiere desplazar hacer un download masivo de los smartforms y smartstyles, sin tener que ingresar uno por uno.
Solución: Hice un programa rudimentario para hacer la descarga utilizando wildcards (por ejemplo Z*). Lo único que como llama a la función estándar de bajada de formularios y estilos, hay que hacer un ENTER por cada uno, ya que solicita siempre mediante un popup el directorio y archivo destino.
*---------------------------------------------------------------------*
* Report ZDOWN_SMARTFORMS
*---------------------------------------------------------------------*
* Download de una lista de smartforms uno a uno
*---------------------------------------------------------------------*
REPORT zdown_smartforms.
TABLES: stxfadm,
stxshead.
CONSTANTS: asterix TYPE string VALUE '*'.
DATA: lt_stxfadm TYPE TABLE OF stxfadm,
lw_stxfadm TYPE stxfadm,
lt_stxshead TYPE TABLE OF stxshead,
lw_stxshead TYPE stxshead.
SELECTION-SCREEN BEGIN OF BLOCK a001 WITH FRAME TITLE text-000.
SELECT-OPTIONS: s_form FOR stxfadm-formname, " Formulario
s_sname FOR stxshead-stylename. " Estilo
PARAMETERS: rform RADIOBUTTON GROUP r1, " Download Formularios
rstyle RADIOBUTTON GROUP r1. " Download Estilos
SELECTION-SCREEN END OF BLOCK a001.
REFRESH: lt_stxfadm[],
lt_stxshead[].
IF rform EQ 'X'.
IF s_form-low CS asterix.
REPLACE ALL OCCURRENCES OF asterix IN s_form-low WITH '%'.
SELECT *
FROM stxfadm
INTO TABLE lt_stxfadm
WHERE formname LIKE s_form-low.
ELSE.
SELECT *
FROM stxfadm
INTO TABLE lt_stxfadm
WHERE formname IN s_form.
ENDIF.
IF lt_stxfadm[] IS NOT INITIAL.
LOOP AT lt_stxfadm INTO lw_stxfadm
WHERE masterlang = sy-langu.
CALL FUNCTION 'FB_DOWNLOAD_FORM'
EXPORTING
i_formname = lw_stxfadm-formname
i_formtype = ' '
i_with_dialog = space
* IMPORTING
* o_formname = space
EXCEPTIONS
no_name = 1
no_form = 2
no_access_permission = 3
illegal_language = 4
illegal_formtype = 5
OTHERS = 6.
ENDLOOP.
ELSE.
MESSAGE i001(00) WITH 'No se encontraron formularios.' 'Realice otra selección'.
ENDIF.
ENDIF.
IF rstyle = 'X'.
IF s_sname-low CS asterix.
REPLACE ALL OCCURRENCES OF asterix IN s_sname-low WITH '%'.
SELECT *
FROM stxshead
INTO TABLE lt_stxshead
WHERE stylename LIKE s_sname-low.
ELSE.
SELECT *
FROM stxshead
INTO TABLE lt_stxshead
WHERE stylename IN s_sname.
ENDIF.
IF lt_stxshead[] IS NOT INITIAL.
LOOP AT lt_stxshead[] INTO lw_stxshead
WHERE active = 'A'
AND vari EQ space.
CALL FUNCTION 'SSF_DOWNLOAD_STYLE'
EXPORTING
i_stylename = lw_stxshead-stylename
i_with_dialog = space
i_builder = ''
* IMPORTING
* O_STYLENAME =
EXCEPTIONS
no_name = 1
no_style = 2
cancelled = 3
no_access_permission = 4
illegal_language = 5
OTHERS = 6.
ENDLOOP.
ELSE.
MESSAGE i001(00) WITH 'No se encontraron estilos.' 'Realice otra selección'.
ENDIF.
ENDIF.