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: 

How to set format details when converting from xstring to solix?

Former Member
0 Kudos
2,657

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.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
1,641

So that the Excel attachment contains colors, you must have it in Excel native format, like XLSX, that you may build easily using abap2xlsx.

9 REPLIES 9

p244500
Active Contributor
0 Kudos
1,641

Hi,

kindly check sample programs using se38 BCS_* you will get lot of example

Regards,

Nawa

Former Member
0 Kudos
1,641

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,

Sandra_Rossi
Active Contributor
1,642

So that the Excel attachment contains colors, you must have it in Excel native format, like XLSX, that you may build easily using abap2xlsx.

1,641

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.

matt
Active Contributor
1,641

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.

p244500
Active Contributor
0 Kudos
1,641

Hi Nida,

I didn't try this using BCS* program , but you can try using OLE. It will work.

OLE

Regards,

Nawa.

1,641

Most of the time, abap2xlsx is to be used rather than OLE (because OLE is very slow and works only in dialog mode)

gabriel_pill-kahan
Active Participant
0 Kudos
1,641

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.

0 Kudos
1,641
Hi Gabriel,

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.