Ver Mensaje Individual
  #4  
Viejo 29/05/06, 09:39:52
carlosalcala carlosalcala is offline
Member
 
Fecha de Ingreso: may 2006
Mensajes: 46
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

CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_file
i_begin_col = p_scol
i_begin_row = p_srow
i_end_col = p_ecol
i_end_row = p_erow
TABLES
intern = lt_intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.

IF sy-subrc <> 0.

FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE:/ 'Error cargando el archivo'.
EXIT.

Espero que te sea de ayuda, Un saludo
Responder Con Cita