‎2008 Mar 25 5:28 AM
i have account no 14500, but in program i want it 10 digit e.g. 0000014500.
how to convert account no with zero padding ?
‎2008 Mar 25 5:31 AM
Declare the variable type N.
ex: v_amt(10) type n.
pass the value to v_amt.
‎2008 Mar 25 5:31 AM
data:accno(10) type n.
accno = '1405'.
unpack accno to accno.
Reward if helpful
Regards
Vodka.
‎2008 Mar 25 5:31 AM
Declare the variable type N.
ex: v_amt(10) type n.
pass the value to v_amt.
‎2008 Mar 25 5:31 AM
Use the FM : CONVERSION_EXIT_ALPHA_INPUT to convert it to 10 digit number.
Regards
Gopi
‎2008 Mar 25 5:32 AM
Use the Function Module CONVERSION_EXIT_ALPHA_INPUT
Check the sample code:
data: NUMBER(8) VALUE 0, "Original number without zeros
NUMBER2(8). "numbers with zeros
*Incrementing value.
NUMBER = NUMBER + 1.
*Padding zeros
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = NUMBER
IMPORTING
OUTPUT = NUMBER2.
WRITE: / 'Number 1 ', NUMBER,
'Number 2 ', NUMBER2.
Or
for padding Zeros
use FM Conversion_Exit_alpha_Input
and pass the input field in import paramter as input and to get the output from export parameter declare the field of particular length suppose l_output(15) type c.
this will convert 15 input to 0000000000000015
Reward points if useful.
‎2008 Mar 25 5:32 AM
hi..
may be it is useful...
use conversion exit..
CONVERSION_EXIT_ALPHA_INPUT
if useful please reward....
‎2008 Mar 25 5:33 AM
hi,
use the FM :CONVERSION_EXIT_ALPHA_INPUT
if found helpful do reward
‎2008 Mar 25 5:34 AM
method suggested by Sadiqulla Shaik is the best one and also the simplest
define a variable.
‎2008 Mar 25 5:35 AM
‎2008 Mar 25 5:35 AM
Hi,
Try this,
data:V_Accno(10) type n.
accno = '8889'.
unpack accno to accno
output.
0000008889.
Regards,
S.Nehru.
‎2008 Mar 25 5:36 AM
Hi,
If the data type of your variable is of type N you need not worry.
It will automatically converted to 0000001450.
Else it is of TYPE C,
Use unpack .
Else.
It is of TYPE P.
Use decimals 0.
Regrads,
Sankar.