2018 Dec 31 12:08 PM
Hi,
I am using CL_BCS_CONVERT to convert internal table data fetched from submit command and converting it to binary before mailing it to a recipient using CL_BCS_CONVERT=>XSTRING_TO_SOLIX .
Now I am getting proper data in excel attachment but would also like to add format details like subtotal ,color formatting of cells etc.
Thanks and regards.
2018 Dec 31 4:55 PM
So that the Excel attachment contains colors, you must have it in Excel native format, like XLSX, that you may build easily using abap2xlsx.
2018 Dec 31 3:47 PM
Hi,
kindly check sample programs using se38 BCS_* you will get lot of example
Regards,
Nawa
2019 Jan 02 5:38 PM
Hi Nawanandana,
Thanks for replying.
My current program was developed with reference from BCS_EXAMPLE_7 program.
Now my only requirement is to add some colors to cells or maybe make cell fonts bold which I have not found in BCS* programs
the report which I am executing has alv output with desired formatting, if I am able to get this output to excel via background job would do as well.
Regards,
2018 Dec 31 4:55 PM
So that the Excel attachment contains colors, you must have it in Excel native format, like XLSX, that you may build easily using abap2xlsx.
2019 Jan 02 5:25 PM
Thanks for your reply Sandra,
Currently my requirement is met with CL_BCS class for preparing and sending document in excel format via mail.
I was hoping formatting to be done through same class so my report output, which is to be scheduled periodically in background get mailed with formatted excel.
Regards.
2019 Jan 03 8:25 AM
Your hope will never be fulfilled. Although your current requirement is met with CL_BCS, your new requirement isn't. You really do need to use abap2xlsx.
2019 Jan 02 7:33 PM
Hi Nida,
I didn't try this using BCS* program , but you can try using OLE. It will work.
Regards,
Nawa.
2019 Jan 02 7:44 PM
Most of the time, abap2xlsx is to be used rather than OLE (because OLE is very slow and works only in dialog mode)
2019 Jan 02 10:56 PM
Hi,
You say you're using ALV output. I hope you mean your program is using CL_SALV_TABLE. If this is the case, then you can use method TO_XML of this class. Set parameter XML_TYPE to IF_SALV_BS_XML=>C_TYPE_XLSX. The method will return an XSTRING that you can convert to type SOLIX_TAB with method CL_BCS_CONVERT=>XSTRING_TO_SOLIX. Save the length of the XSTRING variable and use it when you add the attachment in the email.
2019 Jan 04 4:40 AM
I am not using CL_ALV_TABLE but Grid Display FM.
Have developed another program that uses submit and CL_RUNTIME_GET_INFO class for fetching internal table from submit program.
Now I get final table data used in grid display but not is field catalog or sort entries.
After getting final table data I convert it using CL_BCS_CONVERT and then using CL_BCS* class for sending as attachment.
in all this i am not able to format cells in excel attached as .XLS doc type.
Regards.