Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV_XXL_CALL

Former Member
0 Kudos
1,110

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.

6 REPLIES 6

Former Member
0 Kudos
661

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

0 Kudos
661

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?

0 Kudos
661

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 ?

0 Kudos
661

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.

0 Kudos
644

Could you provide more pieces of code?

0 Kudos
630

A former member is usually not an active user... 😎