10-19-2007 9:14 AM
Hi,
I have a string ' 23.45-'. It is a negative value. How do i present it in '-23.45' ?
I don't have the function module CLOI_PUT_SIGN_IN_FRONT in the system.
How to achieve that?
Regards,
Rayden
10-19-2007 9:24 AM
Hi
Do like this.
DATA: TEXT1(1) TYPE C,
VALUE(5) type c.
value = '90-'.
SEARCH VALUE FOR '-'.
IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
SPLIT VALUE AT '-' INTO VALUE TEXT1.
CONDENSE VALUE.
CONCATENATE '-' VALUE INTO VALUE.
ELSE.
CONDENSE VALUE.
ENDIF.
Regards
Haritha.
10-19-2007 9:17 AM
10-19-2007 9:20 AM
Hi pavan,
I don't have the function module CLOI_PUT_SIGN_IN_FRONT in the system.
Is there any other way to do that?
Regards,
Rayden
10-19-2007 9:19 AM
go to your system control panel -> Regional and Language Options->Customize->
choose negative number format -> -1.1
10-19-2007 9:20 AM
replace '-' in variable with space.
concatenate '-' 'variable' into 'variable'.
this will sove your issue
tc
saji
10-19-2007 9:21 AM
go to your system control panel -> Regional and Language Options->Customize->
choose negative number format -> -1.1
or
SHIFT string BY 1 PLACES CIRCULAR
10-19-2007 9:24 AM
Hi
Do like this.
DATA: TEXT1(1) TYPE C,
VALUE(5) type c.
value = '90-'.
SEARCH VALUE FOR '-'.
IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
SPLIT VALUE AT '-' INTO VALUE TEXT1.
CONDENSE VALUE.
CONCATENATE '-' VALUE INTO VALUE.
ELSE.
CONDENSE VALUE.
ENDIF.
Regards
Haritha.
10-19-2007 9:24 AM
Check out below way...
using <b>edit mask</b> you can achieve it..
WRITE variablename using edit mask<b> 'LLV_________.__'.
</b>
if your variable has value 1.00- then it should appear as -1.00.
<b>Hope it will solve your problem</b>
Thanks & Regards
ilesh 24x7
10-19-2007 9:31 AM
Please try this....
data: string type string value '1100.00-'.
data: d type i.
d = strlen( string ).
d = d - 1.
SHIFT string BY d PLACES CIRCULAR.
write:/ string.
Message was edited by:
Muthurajan Ramkumar
10-19-2007 9:40 AM
hi,
use :
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.
reagrds,
ritika malhotra
10-07-2020 9:32 AM
data(lv_test) = '120-'.
shift lv_test BY strlen( lv_test ) - 1 PLACES CIRCULAR.
write:/ lv_test.