2008 Apr 17 6:51 AM
hi
i wnat to put zero digit bofre a number which is coming in a variable...pls sugest for that
do we use concatenate or i dont want to use alpha input etc functionon module only one zero i want to put not all empty space to zero
so pls suggest how to put a zero before a number
egang;e number in varialbe as comiing is 587
i want it like to be 0587 ie zero in fron of it
rgds
arora
2008 Apr 17 7:34 AM
hi,
Try the below code and reward accordingly.
DATA: var(10) TYPE c.
MOVE '587' TO var.
CONCATENATE '0' var INTO VAR.
Regards,
Prasanna
hi
i wnat to put zero digit bofre a number which is coming in a variable...pls sugest for that
do we use concatenate or i dont want to use alpha input etc functionon module only one zero i want to put not all empty space to zero
so pls suggest how to put a zero before a number
egang;e number in varialbe as comiing is 587
i want it like to be 0587 ie zero in fron of it
rgds
arora
2008 Apr 17 6:57 AM
data:accno(10) type n.
accno = '1405'.
unpack accno to accno.
OR
Declare the variable type N.
ex: v_amt(10) type n.
pass the value to v_amt.
Or
Use the FM : CONVERSION_EXIT_ALPHA_INPUT to convert it to 10 digit number.
Reward points..
2008 Apr 17 7:00 AM
hi murali
as i told i dont want to use this FM as it put leading zeros in front i want only single zeroo not leading zeros
regards
Nishant
2008 Apr 17 7:00 AM
Hi Nishant,
the easiest way is declare it of type N
data : var(4) TYPE N.
2008 Apr 17 7:12 AM
Hi,
option 1.
concatenate '0' '8' into variable name.
option2.
declare a vairable like below.
data: myvar(2) type n.
move: '8' to myvar.
now my var will be 08
Regards
Kiran Sure
2008 Apr 17 7:29 AM
hi all
my restrictio nis to declare the varialble type C
and i want to put a leading zero in front of values in the varialbel
fir egh variable has valure
659
i want to pass it further as 0659
pls suggest
2008 Apr 17 7:34 AM
hi,
Try the below code and reward accordingly.
DATA: var(10) TYPE c.
MOVE '587' TO var.
CONCATENATE '0' var INTO VAR.
Regards,
Prasanna
2008 Apr 17 7:42 AM
hi
i suppose u are not getting my point
i have a varialbe say var1 it has value 567
i want to put a leading zero infront of this value ONLY
now after puting leading zero the var1 is = 0567
and concetenate doesentl work as var1 is a char field it give error
pls suggest
2008 Apr 17 7:48 AM
Hi ,
Send the declarations which you have done.
so that i can test before posting the solution.
See the code i sen works fine in my system.
And var variable in my last post is defined as char type only, you can have a one more look at it.
Regards,
prasanna
2008 Apr 17 7:51 AM
Hi Arora,
Proceed as follows.
DATA: v_cout TYPE charn. "Here replace 'n' by any number say char20
v_cout = '123456'.
CONCATENATE '0' v_cout INTO v_cout.
WRITE:/ v_cout.
Now the output gets displayed as 0123456.
If this doesn't work out then send me your code so that I can modify the same and send it back to you.
Reward accordingly.
Thanks and Regards,
Maddineni Bharath.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |