‎2006 Nov 28 9:38 AM
i'm using the FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT' for export to excel.
how to make excel treat the numeric values as text values?
there is alignment problem for different numbers and text field values.
eg. numbers in excel are aligned to the right, text in excel aligned to the left.
i'm thinking of adding ' (apostrophe) to number...
but problem again..
eg. for the matnr field... it may contain fields like "00000123", "0023", "54".."abc".."abc00"...
how to get rid of the zeros?
Cheers,
Charles
abap newbie
‎2006 Nov 28 12:55 PM
Hi,
to get rid of the leading zeros you may map from internal (= database) to external (= presentation) format by using fm CONVERSION_EXIT_ALPHA_OUTPUT before you add apostrophes.
Regards
‎2006 Nov 28 12:56 PM
hi,
I guess there is a command PACK which would remove the leading zeros. try using that.
santhosh
‎2006 Nov 28 1:07 PM
Hi Charles,
I dont think formatting in excel is possible from the Function Module. I think the best solution here is to create your final internal table with only character variables. Move all the data into this table where the numeric values should be trimmed off with leading zeros using the function module(CONVERSION_EXIT_ALPHA_OUTPUT).Finally pass this final internal table to the function module which will download in the excel format.
Please let me know for any clarifications required.
Regards,
Swaroop
‎2006 Nov 29 2:14 AM
how do i output the single quote '
?
eg... DATA: addchar VALUE '"'.
double quote no problem...but what about single quote?
what's the special character?
Thanks,
Charles
abap newbie
‎2006 Nov 29 2:25 AM
ohhh...found out about the single quote...
using double single quotes..
solved
Thanks,
Charles
abap newbie
‎2006 Nov 29 3:10 AM
Managed to insert the ' doesnt seem to solve the problem...
the output in exel will display the ' until the user manually click and enter the field in excel to be recognised as numeric..
For ALV export to excel output, everything seems ok.
So, is there a better export to excel function to solve this alignment and formatting issue when I use list instead of ALV?
Thanks,
Charles
abap newbie
‎2006 Nov 29 4:32 AM
If possible ,you can try like as this : FIELDCAT-edit_mask = '''__________' .
‎2006 Nov 29 6:51 AM
‎2006 Dec 01 1:33 AM
So, is there a better export to excel function to solve this alignment and formatting issue when I use list instead of ALV?
Thanks,
Charles
abap newbie