2007 Dec 06 9:43 AM
Hi everyone,
I like to export some data to excel. I use the FM ALV_XXL_CALL. I use these statement:
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
i_tabname = 'IT_OUT'
IS_LAYOUT = lt_xxl_Layout
it_fieldcat = lt_xxl_fieldcat
TABLES
it_outtab = it_out
EXCEPTIONS
fatal_error = 1
no_display_possible = 2
OTHERS = 3.
The order of Columns in the Excel Sheet is not equal to definition in the lt_xxl_fieldcat definition ( TYPE kkblo_t_fieldcat). I define the order of Column in the field lt_xxl_fieldcat-Column.(the same order like in the it_outtab).
Some problems known about this?
Regards Ralf.
2007 Dec 06 1:38 PM
Try removing this piece of code -
IS_LAYOUT = lt_xxl_Layout
if ur field catalog is fine then i guess - the layout might be creating the problem
2007 Dec 06 1:54 PM
Thx, i removed this statement, but there is still the same problem.
It seems, that in the Excel the character fields listed at first, then the Numeric fields and the date fields, instead of the column definition of the lt_xxl_fieldcat table and the it_out table?
2007 Dec 06 3:01 PM
Hi ,
I have used it like this -
* Transfer to KKBLO format.
CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
EXPORTING
IT_FIELDCAT_LVC = L_FCAT[]
IMPORTING
ET_FIELDCAT_KKBLO = L_KKBLO[]
TABLES
IT_DATA = T_EXCEL[]
EXCEPTIONS
IT_DATA_MISSING = 1
IT_FIELDCAT_LVC_MISSING = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
* Export to Excel now.
L_KKBLO-TABNAME = 'T_EXCEL'.
MODIFY L_KKBLO TRANSPORTING TABNAME WHERE NOT TABNAME IS INITIAL.
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
I_TABNAME = 'T_EXCEL'
IT_FIELDCAT = L_KKBLO[]
TABLES
IT_OUTTAB = T_EXCEL[]
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* Do nothing.
ENDIF.
i.e i created using the LVC_T_FCAT for building the field catalog for the ALV then changed the format to KKBLO. and it works fine.
May be the catalog ur trying to build with KKBLO format is incomplete. if u r already displaying an alv grid - it could have indicated that.
Will it be possible for you to copy and paste ur code here ?
2007 Dec 10 10:16 AM
I prepared the FM call like these , in the Fieldcat und in tha Data Table is the Structure und the Data sequence Ok. But there is still the problem of the unsorted Column display in the Excel File.
2024 Mar 15 5:02 AM
2024 Mar 15 10:09 AM