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: 

excel output from alv

Former Member
0 Kudos
197

hello

I have a report that produce a alv and when I convert it to excel file using menu(list-save-file-excel spredsheet) I see some

field data is absent .really a field is include next fields data.

but ı can convert it properly using right click on alv and excel spredsheet (mhtml)

have you goy any ideas?

regards

10 REPLIES 10

Former Member
0 Kudos
152

check -ALV/ColoredOutput/Program.htm from saptechnical

regards,

Amruta

Edited by: amruta1 on Feb 25, 2010 11:25 AM

Edited by: amruta1 on Feb 25, 2010 11:26 AM

0 Kudos
152

thanks for your reply but ı have already a alv output on screen but ı can not convert it properly to a excel spread sheet using alv menus.(list-save-file)

0 Kudos
152

HI,

call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = sy-cprog
      i_callback_user_command  = 'USER_COMMAND'
      is_layout                = gs_layout
      i_callback_pf_status_set = 'SET_PF_STATUS'
      it_fieldcat              = gt_fieldcat[]
      i_save                   = gc_a
    tables
      t_outtab                 = ist_final[].

form set_pf_status using rt_extab type slis_t_extab.        "#EC CALLED

  set pf-status 'ZPP_NCO_STATUS_PTEI' excluding rt_extab.

endform.      

form user_command using p_ucomm    type sy-ucomm            "#EC CALLED
                        wa_selfield type slis_selfield .    "#EC CALLED

  case p_ucomm.
* When user clicks on the Download button
    when '&DOWNLOAD'.

      call function 'F4_FILENAME'
        importing
          file_name = path1.
*      rlgrap-filetype = 'DAT'.

      refresh ist_fc_download.
      loop at gt_fieldcat into wa_fieldcat.
        wa_fc_download-fieldname  = wa_fieldcat-seltext_l.
        append wa_fc_download to ist_fc_download.
        clear: wa_fc_download,wa_fieldcat.
      endloop.
      path = path1.

      call function 'GUI_DOWNLOAD'
        exporting
          filename              = path
          filetype              = 'ASC'
          write_field_separator = 'X'
        tables
          data_tab              = ist_final
          fieldnames            = ist_fc_download
        exceptions
          others                = 22.
      if sy-subrc <> 0.
        message text-104 type gc_i.
      endif.

      describe table ist_final lines lv_lines.
      concatenate lv_lines text-102 into lv_text separated by space.
*       " 'Records Displayed'
      message lv_text type gc_s.
      wa_selfield-refresh    = gc_x.
      wa_selfield-row_stable = gc_x.

    when 'OTHERS'.
      clear p_ucomm.
  endcase.
endform.                    "USER_COMMAND

Br

Ram

0 Kudos
152

hi

can ı do it using menu items(list-save-file) ?

really tranfer is ok but not corretly

0 Kudos
152

hii

Use the Local file button on the toolbar of ALV.By clicking on this you will be able to export data in to excel sheet.

also refer to following link

If your requirement is to download data programetically then you can use

GUI_DOWNLOAD Function Module..

regards,

Amruta

mukundkansara
Participant
0 Kudos
152

Hi,

Check your field catalog during debug. May be there some values are missing. Also check Value of your Layout

Edited by: Mukund Kansara on Feb 25, 2010 12:46 PM

0 Kudos
152

thanks for all replies

0 Kudos
152

Is your problem solved?

Regards,

Amruta

0 Kudos
152

not yet but ı think problem is about alv cataloq

there are 2 cataloq merged on screen

second alv cataloq is begining at x column on screen

ı think problem is begining point of 2 cataloq

thank you

Former Member
0 Kudos
152

Hi,

You can also try to take - 'Local file' option from application toolbar. (Func. code - %PC, ICON_EXPORT)

One more thing, Once I face the same problem (two fields data were merged when export in spread sheet).

At that time one of the field (material desc.) in few cases has only one inverted comma. (Like - "Service material for System )

Can you check is it the case? In such cases, for ALV to excel sheet - data merge or overwrite in next column.