Application Development and Automation 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: 
Read only

Data missing when Exporting or print preview from ALV report

Former Member
0 Likes
714

Hi

I have a alv report which is showing fine but when i try to export it to say excel sheet or do print preview some of the data is missing. Can anyone tell me how to fix this. or at least point to some document that discuss this problem.

Here is my ALV CODE


************************************************************************
*  CALL_ALV
************************************************************************
form call_alv.
*  v_repid = sy-repid.
  perform build_field_catalog using field_tab[].
  perform build_eventtab      using events[].
  perform comment_build       using header_alv[].
  perform build_sorttab       using gt_sort[].
*  perform build_layout.
*  v_variant-variant = '/TEST3'.
* Call ABAP List Viewer
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program      = v_repid
      i_callback_user_command = ''
      i_structure_name        = 'REC'
      it_fieldcat             = field_tab[]
      it_special_groups       = gt_sp_group[]
      it_sort                 = gt_sort[]
      i_save                  = v_save
      is_variant              = v_variant
      it_events               = events[]
*      is_layout               = gd_layout
    tables
      t_outtab                 = REC
    exceptions
      program_error            = 1
      others                   = 2.
endform.

From my Catalog this data is missing


************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog USING pt_fieldcat type
                               slis_t_fieldcat_alv.
  data:  ls_fieldcat type slis_fieldcat_alv.
  clear: fieldcat, pt_fieldcat[].

  ls_fieldcat-tabname        =                'REC'.
  ls_fieldcat-edit           =                ' '.
**********************************************************************
    ls_fieldcat-fieldname      =                'PERNR'.
    ls_fieldcat-seltext_s      =                'Employee #     '.
    ls_fieldcat-seltext_m      =                'Employee #           '.
    ls_fieldcat-seltext_l      =                'Employee #           '.
    ls_fieldcat-datatype       =                'C'.
    append ls_fieldcat to pt_fieldcat.

There r coupole that's missing

But there couple that show's up like this one


**********************************************************************
    ls_fieldcat-fieldname      =                'STIME'.
    ls_fieldcat-seltext_s      =                'ST   '.
    ls_fieldcat-seltext_m      =                'St Tm     '.
    ls_fieldcat-seltext_l      =                'Start Time          '.
    ls_fieldcat-datatype       =                'C'.
    append ls_fieldcat to pt_fieldcat.
**********************************************************************
    ls_fieldcat-fieldname      =                'ETIME'.
    ls_fieldcat-seltext_s      =                'ET      '.
    ls_fieldcat-seltext_m      =                'Et Tm           '.
    ls_fieldcat-seltext_l      =                'End Time             '.
    append ls_fieldcat to pt_fieldcat.

I always reward points.

Thanks

1 ACCEPTED SOLUTION
Read only

michaelmerny
Participant
0 Likes
562

Hello,

It could be linked to security settings in MS Office. here is an interesting link on this subject http://www.leeds.ac.uk/iss/projects/sap_upgrade/ALV_Superuser_message.doc

Hi

I have a alv report which is showing fine but when i try to export it to say excel sheet or do print preview some of the data is missing. Can anyone tell me how to fix this. or at least point to some document that discuss this problem.

Here is my ALV CODE


************************************************************************
*  CALL_ALV
************************************************************************
form call_alv.
*  v_repid = sy-repid.
  perform build_field_catalog using field_tab[].
  perform build_eventtab      using events[].
  perform comment_build       using header_alv[].
  perform build_sorttab       using gt_sort[].
*  perform build_layout.
*  v_variant-variant = '/TEST3'.
* Call ABAP List Viewer
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program      = v_repid
      i_callback_user_command = ''
      i_structure_name        = 'REC'
      it_fieldcat             = field_tab[]
      it_special_groups       = gt_sp_group[]
      it_sort                 = gt_sort[]
      i_save                  = v_save
      is_variant              = v_variant
      it_events               = events[]
*      is_layout               = gd_layout
    tables
      t_outtab                 = REC
    exceptions
      program_error            = 1
      others                   = 2.
endform.

From my Catalog this data is missing


************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog USING pt_fieldcat type
                               slis_t_fieldcat_alv.
  data:  ls_fieldcat type slis_fieldcat_alv.
  clear: fieldcat, pt_fieldcat[].

  ls_fieldcat-tabname        =                'REC'.
  ls_fieldcat-edit           =                ' '.
**********************************************************************
    ls_fieldcat-fieldname      =                'PERNR'.
    ls_fieldcat-seltext_s      =                'Employee #     '.
    ls_fieldcat-seltext_m      =                'Employee #           '.
    ls_fieldcat-seltext_l      =                'Employee #           '.
    ls_fieldcat-datatype       =                'C'.
    append ls_fieldcat to pt_fieldcat.

There r coupole that's missing

But there couple that show's up like this one


**********************************************************************
    ls_fieldcat-fieldname      =                'STIME'.
    ls_fieldcat-seltext_s      =                'ST   '.
    ls_fieldcat-seltext_m      =                'St Tm     '.
    ls_fieldcat-seltext_l      =                'Start Time          '.
    ls_fieldcat-datatype       =                'C'.
    append ls_fieldcat to pt_fieldcat.
**********************************************************************
    ls_fieldcat-fieldname      =                'ETIME'.
    ls_fieldcat-seltext_s      =                'ET      '.
    ls_fieldcat-seltext_m      =                'Et Tm           '.
    ls_fieldcat-seltext_l      =                'End Time             '.
    append ls_fieldcat to pt_fieldcat.

I always reward points.

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
562

hi Anwarul,

Try the following code:

************************************************************************
*  CALL_ALV
************************************************************************
form call_alv.
*  v_repid = sy-repid.
  perform build_field_catalog using field_tab[].
  perform build_eventtab      using events[].
  perform comment_build       using header_alv[].
  perform build_sorttab       using gt_sort[].
*  perform build_layout.
*  v_variant-variant = '/TEST3'.
* Call ABAP List Viewer
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program      = v_repid
      i_callback_user_command = ''
      i_structure_name        = 'REC'
      it_fieldcat             = field_tab[]
      it_special_groups       = gt_sp_group[]
      it_sort                 = gt_sort[]
      i_save                  = v_save
      is_variant              = v_variant
      it_events               = events[]
*      is_layout               = gd_layout
    tables
      t_outtab                 = REC
    exceptions
      program_error            = 1
      others                   = 2.
endform.

form build_field_catalog USING pt_fieldcat type
                               slis_t_fieldcat_alv.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
I_PROGRAM_NAME  = sy-repid
I_STRUCTURE_NAME = 'REC'
changing
CT_FIELDCAT          = pt_fieldcat.

When you export to excel, the character fields and numeric columns gets re-arranged, but all the fields will be displayed in this case.

hope this helps.

Read only

0 Likes
562

Thanks for the code. Now Excell is opening within my program and showing all the data but still if i try to save it or print it its doing the same old thing. One thing I want mention is I am actually missing some data not just columns r rearranging or something.

If my columns starts from

Employee #, Name, Type, Date, Daily Schedule, Start time, End Time...

Data starts from (in print preview/ exporting datat)

Start Time, End Time...

Read only

michaelmerny
Participant
0 Likes
563

Hello,

It could be linked to security settings in MS Office. here is an interesting link on this subject http://www.leeds.ac.uk/iss/projects/sap_upgrade/ALV_Superuser_message.doc