09-05-2008 3:18 PM
Hi all,
i'm transportin data from an internal table to an excel sheet. Amounts are like '1954.52-' in internal table when amount is négative ( minus sign at right ). when exporting in excel sheet the format is an shown.
I hope to have amount with minus sign in beginin (at left) of cell as folowing :'-1954.52'.
How can i do it?
Thank you for you responses
09-05-2008 3:22 PM
FM CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are
09-05-2008 3:26 PM
Hi Mohammed,
Use CLOI_PUT_SIGN_IN_FRONT function module to get the minus sign to be front for negative numbers.
Thanks,
Vinay
09-05-2008 3:35 PM
Thank you Vinaykumar,
would you like to take me abap code to do that. I tried to do that with folowing code but it dosen't work
call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
exporting value = lv_mntsld.
09-05-2008 3:44 PM
I've found it
call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
changing value = lv_mntval.
Thanks all,
The problem is solved
09-05-2008 3:49 PM
Hi Mohammed,
As 'value' is changing parameter, value is considered as both import and export parameter. The 'value' parameter will itself holds the resutls after execution of function modue.
Try with this code.
data lv_mntsld type i value '100-'.
write lv_mntsld. "Output as 100-
call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
exporting value = lv_mntsld.
write lv_mntsld. "Output as -100
Thanks,
Vinay