#1
|
|||
|
|||
crear una excel de varias hojas desde sap
Hola a todos,
Estoy haciendo una función que a partir de N tablas internas genere un excel con tantas hojas como tablas internas tengo. He hecho todo y me genera el excel, pero no me lo guarda. Utilizo el método siguiente: call method of sheet 'SaveAs' EXPORTING #1 = ruta_file "Ruta del fichero #2 = 1. Pero me abre el excel, con toda la información de las tablas bien informada y en cada hoja, pero tengo que guardarlo manualmente. No me lo crea en la ruta indicada. ¿Alguien sabe decirme como soluionarlo por favor? Otra cosilla por si alguien puede ayudarme: una vez generada la excel tengo que pasarlo a base64...¿hay alguna función para esto? Muchas gracias y saludos Os adjunto el código ejemplo que utilizo para informar una tabla: data: application type ole2_object, workbook type ole2_object, sheet type ole2_object, cells type ole2_object, column type ole2_object, rango type ole2_object, row type ole2_object, int type ole2_object, font type ole2_object, we type ole2_object, borders type ole2_object. * Crea el objeto excel create object application 'excel.application'. * Hace visible la aplicación set property of application 'visible' = 1. * Creo el libro call method of application 'Workbooks' = workbook. call method of workbook 'Add'. * Agrego una hoja al libro call method of application 'Worksheets' = sheet. call method of sheet 'Add'. clear: lineas, index. describe table l_t_tabla lines lineas. if lineas ne '0'. * Creo la segunda hoja call method of application 'Worksheets' = sheet EXPORTING #1 = 3. * Doy nombre a la hoja excel set property of sheet 'Name' = 'Datos'. call method of sheet 'Activate'. * MONTO CABECERA GRID call method of sheet 'RANGE' = rango EXPORTING #1 = 'A1'. set property of rango 'FORMULAR1C1' = ' <nombre_campo>'. FREE OBJECT RANGO. call method of sheet 'RANGE' = rango EXPORTING #1 = 'B1'. set property of rango 'FORMULAR1C1' = '<nombre_campo>'. FREE OBJECT RANGO. call method of sheet 'RANGE' = rango EXPORTING #1 = 'C1'. set property of rango 'FORMULAR1C1' = '<nombre_campo>'. FREE OBJECT RANGO. call method of sheet 'RANGE' = rango EXPORTING #1 = 'D1'. set property of rango 'FORMULAR1C1' = '<nombre_campo>'. FREE OBJECT RANGO. call method of sheet 'RANGE' = rango EXPORTING #1 = 'E1'. set property of rango 'FORMULAR1C1' = '<nombre_campo>'. FREE OBJECT RANGO. loop at l_t_tabla into l_wa_tabla. index = c_row_max * sy-tabix . perform informa_celda using l_wa_tabla-datum index. perform bordes. perform informa_celda using l_wa_tabla-campo index. perform informa_celda using l_wa_tabla-campo index. perform informa_celda using l_wa_tabla-campo index. perform informa_celda using l_wa_tabla-campo index. endloop. CALL METHOD OF sheet 'Columns' = column NO FLUSH. FREE OBJECT sheet NO FLUSH. CALL METHOD OF column 'Autofit' NO FLUSH. FREE OBJECT column NO FLUSH. CALL FUNCTION 'FLUSH'. endif. Úlima edición por cirsgo fecha: 23/08/11 a las 11:27:43. |
#2
|
|||
|
|||
Buenas tardes.
Espero este código te sirva de ayuda Saludos. |
#3
|
|||
|
|||
Re: crear una excel de varias hojas desde sap
Saludos, Quote como puedo ver el código que comparte, alguien pudiera ayudarme sobre como generar un excel desde abap pero en ubuntu porfavor!!
necesito ayuda |
Herramientas | Buscar en Tema |
Desplegado | |
|
|