10-13-2008 6:47 AM
Hi Guru's,
i want to remove 0 . my amount is 14.0000 . how i convert this.
please suggest me.
thanks.
regards.
sam.
Edited by: sam saswade on Oct 13, 2008 7:48 AM
10-13-2008 6:49 AM
Hi
Move the value to character field and use REPLACE statement
Regards
Madhan
10-13-2008 6:49 AM
Hi
Move the value to character field and use REPLACE statement
Regards
Madhan
10-13-2008 6:50 AM
10-13-2008 6:58 AM
hiiii
i think for this u can use shift command to remove zero like
SHIFT STRING BY 3 PLACES RIGHT
regards
vikalp
10-13-2008 6:50 AM
data: X type I value '14.0000'.
X = '14.000'.
write: X.
X value will be 14.
Edited by: Mahalakshmi Padmanaban on Oct 13, 2008 7:57 AM
10-13-2008 6:51 AM
Hi,
Just assign that to an integer...
eg.. w_integer type i,
w_pack type p decimals 4.
w_pack = '10.1234'.
w_integer = w_pack.
Rgrds,
Madan....
10-13-2008 6:51 AM
Hi Boss,
Use Coversion Exits for this
Conversion_exit_alpha_input
Conversion_exit_alpha_output
Use this function module pass the require parameters .I think
it may help you.
With Regards,
Narasimha Rao.
10-13-2008 6:52 AM
10-13-2008 6:56 AM
data: amount(10) type c value '14.0000'.
replace all occurrences of '0' in amount with space.
replace '.' with space into amount.
condense amount no-gaps.
write amount.
10-13-2008 7:09 AM
Hi Srividya
replace all occurrences of '0' in amount with space.
we should not do this
what if the value is 10004.000.
It will become 14.
Regards
Madhan
10-13-2008 7:01 AM
Hi,
We can use ' ROUND' Function Module.
data input type p decimals 4 value '14.0000'.
data output type i.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 0
input = input
SIGN = '+'
IMPORTING
OUTPUT = output
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
thanx.
10-13-2008 7:09 AM
Hi Sam,
In case you want to store value without decimals as string.
data : pack(13) type p decimals 4,
xyz(13).
WRITE pack NO-GROUPING DECIMALS 0 to xyz.
or
In case you want to store value without decimals as TYPE P.
data: pack(13) type p decimals 4.
FIELD-SYMBOLS <pack> TYPE p.
ASSIGN pack TO <pack> CASTING DECIMALS 0.
Regards
Hussain