2014 Dec 18 6:01 AM
Hi All,
i have requirement in which i have to send a mail with excel attachment.
I am using CL_BCS class to acheive this.
Now there is a field batch in the excel. This field is character field in sap. So '0123' and '123' are two different batches.
Now in my excel it is considering this field as number field and is displaying as '123' instead of '0123'.
Can anyone please let me know how to convert this column to a text column instead of number field ?
kindly provide the sample code.
Note: My funtional consultant doesnot want to use =" " or REPLACE (old,length,new) as in the formula bar its showing as ="0123".
He doesnt want the above concatenation for the fields.
Kindly provide any other solution by using some class can i acheive this?
Hi All,
i have requirement in which i have to send a mail with excel attachment.
I am using CL_BCS class to acheive this.
Now there is a field batch in the excel. This field is character field in sap. So '0123' and '123' are two different batches.
Now in my excel it is considering this field as number field and is displaying as '123' instead of '0123'.
Can anyone please let me know how to convert this column to a text column instead of number field ?
kindly provide the sample code.
Note: My funtional consultant doesnot want to use =" " or REPLACE (old,length,new) as in the formula bar its showing as ="0123".
He doesnt want the above concatenation for the fields.
Kindly provide any other solution by using some class can i acheive this?
2014 Dec 18 6:06 AM
2014 Dec 18 6:18 AM
Hi Rajesh,
The above link that you have mentioned was to send an unformatted excel attachement.
I need to know how to convert a column in excel into text format while sending mail.
2014 Dec 18 7:18 AM
2014 Dec 18 7:27 AM
Hi,
Pass the Batch Value like
" ' wa-Batch_value ".
Since in excel, we use ' symbol to display or keep remain same the zero value before the digit.
Regards.
Praveer.
2014 Dec 18 7:53 AM
Hi Praveen,
If I pass the single quote it is showing as single quote in my excel as well and even in the formula bar fx its showing as '0123 which my funtional doesnot want.
Can we make the column as text by any code change.
2014 Dec 18 8:17 AM
Hi,
It's excel functionality, to display the Digit with zero prefix.
Or you have to use the OLE (Object Link Enabled ) method and there you can change the format of a particular columns as text in excel.
Regards.
Praveer.
2014 Dec 18 9:46 AM
2014 Dec 18 10:30 AM
Hi,
can you give the code in OLE that satisfies my requirement.
Thanks
Balaji.A
2014 Dec 18 11:55 AM
Hi,
Please find the below link, which is having most of the functionality of the OLE.
Since, SAP is not provided the actual excel object, so through the OLE we can create the excel file in local system and after creation you can attach the same to send in mail.
Regards.
Praveer,