‎2010 Mar 16 4:17 AM
Hi Friends,
i have created a program to send a mail with Excel Sheet attachment.
After receiving the mail, While i am opening the Excel Sheet,all the line item details are in a single line instead of one by one.
I cant get the correct alignment in the attachment as like my final internal table .How can i align/format the attachment datas while sending the mail?
Thanks & Regards,
Sakthivel.VT
‎2010 Mar 16 5:17 AM
Hi,
For making internal table properly aligned you can fill your final table like:
DATA: BEGIN OF st,
f1(2) TYPE c,
f2(2) TYPE n,
END OF st.
DATA: itab1 LIKE TABLE OF st WITH HEADER LINE,
objbin1 LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_ret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
LOOP AT itab1.
CONCATENATE itab1-f1 itab1-f2 INTO objbin1 separated BY c_tab.
CONCATENATE c_ret objbin1 INTO objbin1.
APPEND objbin1.
ENDLOOP.
Hope it helps
Regards
Mansi
‎2010 Mar 16 5:10 AM
Hi Sakthivel,
Please check your internal table data, There is any special characters or not (Ex: ! @ # $ % ^ & * " : ? > etc.). If there is some special characters plz avoid those things in your internal table. Then only you will get correct alignment data in excel.
Thanks & Regards
Muralidhar.
‎2010 Mar 16 5:17 AM
Hi,
For making internal table properly aligned you can fill your final table like:
DATA: BEGIN OF st,
f1(2) TYPE c,
f2(2) TYPE n,
END OF st.
DATA: itab1 LIKE TABLE OF st WITH HEADER LINE,
objbin1 LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_ret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
LOOP AT itab1.
CONCATENATE itab1-f1 itab1-f2 INTO objbin1 separated BY c_tab.
CONCATENATE c_ret objbin1 INTO objbin1.
APPEND objbin1.
ENDLOOP.
Hope it helps
Regards
Mansi