07-01-2009 2:46 PM
Hi All,
I have one internal table it_final whose data i have to download in
excel file .I am using GUI_DOWNLOAD for that .
In my internal table i have fields having decimals data. Like
1,444.25-. in the ALV output. But when i download that internal table
in excel it comes like 1444.25-. My requirement is those negative values
on download should be left aligned in the excel file and should come
like 1,444.25 and not 1444.25.
Kindly Help
Mansi
07-02-2009 4:20 PM
Hi Manasi,
You can do it in two ways
Using function module CLOI_PUT_SIGN_IN_FRONT.
OR
concatenate the sign.
e.g.
data: int type i,
char(10).
int = -4.
int = int * -1.
write int to char.
concatenate '-' char into char.
07-01-2009 2:56 PM
they are being stored as 1442.45- as a general number format
try FM : C14W_NUMBER_CHAR_CONVERSION
it will convert the num to char.
then u can download it as ur requirement,
07-01-2009 2:57 PM
I faced the same problem
but for what I have seen, is not a reporting problem but excel problem that format numeric fields as "he" wants.
Time ago I solved converting number to string and adding manually dot and comma on the number and giving it to excel like a string.
I think you can solve also with ole2object, but you need to handle all file in this way ...
hope this helps
gabriele
07-02-2009 6:38 AM
Hi Mansi,
Only character type (Text) fields are left aligned in an excel sheet. So one way is convert all the numbers in ur internal table to character format and then download them (As soumya explained) or if you have downloaded the number format itself, you must select that column in the excel sheet, go to format option, select number type . You have an option of selectingthe number of decimal places and and the thousands separator too.
ex. if downloaded file has no :1235465.26
after manual formatting of the excel colum ift becomes :1,235,465.26
Hope this answers your query.
07-02-2009 4:20 PM
Hi Manasi,
You can do it in two ways
Using function module CLOI_PUT_SIGN_IN_FRONT.
OR
concatenate the sign.
e.g.
data: int type i,
char(10).
int = -4.
int = int * -1.
write int to char.
concatenate '-' char into char.
07-02-2009 4:47 PM
Hi,
After downloading the excel sheet contents into the internal tables, take another internal table, which contains the value fileld of different format.
Looping on first internal table, move the contents to second internal table by changing it to the resulttant format.
Regards,
Nangunoori.
03-09-2012 6:00 AM
08-28-2013 8:56 AM