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 Allignment not appearing correctly using class method

dhinesh_thirugnanam
Contributor
0 Likes
453

Hi ,

In my 'XLS" attachment data alignment is not appearing correctly when using classes.please let me know what needs to be done.

below is the code.

DATA : lt_att_content_table TYPE soli_tab,

          ls_text              TYPE soli.


CONCATENATE 'USERID' 'USER NAME' 'PS No.'

         INTO ls_text SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

       APPEND ls_text TO lt_att_content_table.

       CLEAR:ls_text.

       LOOP AT gt_usr02_attach INTO gs_usr02_attach.

         CONCATENATE gs_usr02_attach-userid gs_usr02_attach-ename

                     gs_usr02_attach-pernr

          INTO ls_text SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

         APPEND ls_text TO lt_att_content_table.

         CLEAR:ls_text.

       ENDLOOP.

**mail cc to HR

       lv_attach_name = 'SAP Logon Details.xls'.

       CALL METHOD lref_document->add_attachment

         EXPORTING

           i_attachment_type    = 'XLS'

           i_attachment_subject = lv_attach_name

           i_att_content_text   = lt_att_content_table.


Screenshot in the attached xls file.:

1 ACCEPTED SOLUTION
Read only

NagaPrakashT
Contributor
0 Likes
424

Hi Dhinesh,

BCS_EXAMPLE_7 - is the example program which uses Cl_BCS class to send email with XLS attachement. Please refer to it. I think you need to add  CL_ABAP_CHAR_UTILITIES=>CR_LF to trigger a new line.

Thanks,

Naga

1 REPLY 1
Read only

NagaPrakashT
Contributor
0 Likes
425

Hi Dhinesh,

BCS_EXAMPLE_7 - is the example program which uses Cl_BCS class to send email with XLS attachement. Please refer to it. I think you need to add  CL_ABAP_CHAR_UTILITIES=>CR_LF to trigger a new line.

Thanks,

Naga