If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Hola.
No tengo esa función pero se me ocurre algo que a lo mejor te sirve.
lo guardas todo en una tabla plana tipo:
DATA: BEGIN OF it_salida OCCURS 0,
fichero(2000),
END OF it_salida,
w_it_salida LIKE ztabla.
y utilizas la función:
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = fich_out
filetype = 'ASC'
TABLES
data_tab = it_salida
EXCEPTIONS
OTHERS = 8.
IF sy-subrc NE 0.
WRITE: / ' ** ERROR al grabar el fichero', filename.
EXIT.
ENDIF.
cuando tengas que recuperar este fichero plano para hacer el tratamiento que quieras solo tienes que igualar esta tabla plana con una tabla que te definas tu y que contenga los campos que has guardado. Esto es:
* Tabla interna para la cabecera de tipo C.
DATA: BEGIN OF it_cabecera_texto OCCURS 0,
stype(1) TYPE c VALUE 1,
bsart(4) TYPE c,
lifnr(10) TYPE c,
bedat(8) TYPE c,
ekorg(4) TYPE c,
ekgrp(3) TYPE c,
werks(4) TYPE c,
knttp(1) TYPE c,
kdatb(8) TYPE c,
kdate(8) TYPE c,
ktwrt(18) TYPE c,
ebeln(10) TYPE c,
zterm(4) TYPE c,
END OF it_cabecera_texto.
it_cabecera_texto = w_it_salida.
Y aquí ya tienes todos los campos diferenciados.
Espero que te aclare algo, si tienes cualquier duda pregunta.
estamos en las mismas, yo quiero hacer una funcion excell dinamicamente independientemente de los campos que tenga valga para todas las tablas, sin saber k estructura tiene, es decir tu le pasas 1 tabla, y k te genere el excell independientemente que tenga campos numericos o no
Hola Skadeour, para subir los datos utlizo los objectos ole de excel y vas volcando los datos dnd te interesa y en el formato que quieras con un loop,
seria algo asi,
CREATE OBJECT g_xlapp 'excel.application'." no flush.
CALL METHOD OF g_xlapp 'Workbooks' = g_workbook."no flush.
CALL METHOD OF g_workbook 'Add'.
CALL METHOD OF g_xlapp 'Worksheets' = g_sheet "no flush
EXPORTING #1 = 1 .
CALL METHOD OF g_sheet 'Activate'.
CALL METHOD OF g_sheet 'cells' = g_cell. "no flush.
posiciona la celda
CALL METHOD OF g_sheet 'Cells' = g_cell no flush
EXPORTING #1 = p_fila
#2 = p_columna.
le das el valor
SET PROPERTY OF g_cell 'Value' = p_valor no flush.
y el formato
CALL METHOD OF g_cell 'Font' = g_fuente no flush.
SET PROPERTY OF g_fuente 'Name' = p_fuente no flush.
SET PROPERTY OF g_fuente 'Bold' = 'True' no flush.
SET PROPERTY OF g_fuente 'Size' = p_tamanio no flush.
if not p_color_cell is initial.
CALL METHOD OF g_cell 'Interior' = g_interior no flush.
SET PROPERTY OF g_interior 'ColorIndex' = p_color_cell no flush.
endif.
if not p_borde is initial.
CALL METHOD OF g_cell 'Borders' = g_border no flush.
SET PROPERTY OF g_border 'LineStyle' = 1 no flush.
endif.
luego para traer los datos prueba con esta función, aunque tengas que indicar los valores máximos de columna y fila pon algun valor el cual no se vaya a llegar,es bastante rápida comparadas con otras
Comentario