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.
Categorías: ABAP/4
smartforms, Smartstyles
Comentarios (0)
Trackbacks (0)
Deja un comentario
Trackback