2008 Dec 04 5:28 AM
I have a variable g = 00000005. Now when I am adding g = g + 1.
The result is coming 6 but without leading zeroes.How could I retain leading zero after sum operation.
2008 Dec 04 5:28 AM
2008 Dec 04 5:35 AM
hello
use this FM CONVERSION_EXIT_ALPHA_OUTPUT.
to over come this ..
Thank u
santhosh
2008 Dec 04 5:36 AM
I have used it but before i had 5 leading zeros after 6 eg 000006 but after using this function module it is giving 00000000000006..which is not required.
2008 Dec 04 5:41 AM
hi,
got it...
we have fm with same name CONVERSION_EXIT_ALFAN_OUTPUT i think u r using this check it properly it will work....
USE THIS CONVERSION_EXIT_ALPHA_OUTPUT
Edited by: santhosh kumar on Dec 4, 2008 6:41 AM
2008 Dec 04 5:44 AM
Hi Priya,
Use TYPE N
DATA
: VAL1(6) TYPE N VALUE '000001'.
DO 10 TIMES.
VAL1 = VAL1 + 1.
WRITE / VAL1.
ENDDO.
Regards
2008 Dec 04 5:43 AM
Hi Priya,
Declare the g as type N.. then do sum.. okay..
ex :
data : d(7) type n value '0000005'.
g = g + 1.
write : g.
output is : 0000006.
Raghunath.S
2008 Dec 04 5:52 AM
Hi Priya,
Please declare variable g as a numeric of length 8(you can change the length as per the requirement).
Data g(8) type n.
Now if you add 1 to variable g which is 0000005, you will get the result as 0000006. Please try this out.
Thanks,
Deepthi
2008 Dec 04 5:58 AM
REPORT ZSRK_077 .
DATA : G(14) VALUE '000005',
LEN TYPE I.
FIELD-SYMBOLS : <FS_G> TYPE N.
LEN = STRLEN( G ).
ASSIGN G+0(LEN) TO <FS_G> CASTING TYPE N.
<FS_G> = <FS_G> + 1.
WRITE : / 'FS_G = ' , <FS_G>,
/ 'G = ' , G.