07-02-2007 10:03 AM
Hi,
Can anyone suggest a method to replace zeros instead of characters at left side.
I have a component of internal table which accepts character data --> size 10, however before it gets uploaded I want it to look like '0000000012' instead of 12.
I used replace and replace all occurances, I also tried using first SHIFT and later REPLACE but no use.
Can anyone help ?
Appropirate rewards for good answers.
Thank you,
Dipesh Jhala.
07-02-2007 10:05 AM
hi
use fm CONVERSION_EXIT_ALPHA_INPUT to add leading zeroes
if helpful, reward
Sathish. R
07-02-2007 10:05 AM
hi
use fm CONVERSION_EXIT_ALPHA_INPUT to add leading zeroes
if helpful, reward
Sathish. R
07-02-2007 10:05 AM
data : var(10) type n.
var = <your char var>.
write : / var.
or use conversion_exit_alpha_input fn module.
regards
shiba dutta
07-02-2007 10:06 AM
HI ,
You can use CONVERSION_EXIT_ALPHA_INPUT to add leading zeros.
Reward helpful answers.
Regards,
Siddhesh Sanghvi.
07-02-2007 10:10 AM
Hi,
use code as below :
data : a(10), b(10).
a = '12'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = a
IMPORTING
OUTPUT = b
.
write 😕 a.
write 😕 b.
Reward, if helpful,
Sandeep Kaushik
Message was edited by:
Sandeep Kaushik
07-02-2007 10:19 AM
Hi,
You can use the function module 'CONVERSION_EXIT_ALPHA_INPUT' for the same.
07-02-2007 10:21 AM
Hi,
try this:
data : char(10) value '12'.
write 😕 char.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = char
IMPORTING
OUTPUT = char.
*
write 😕 char.
regards, Dieter
07-02-2007 10:31 AM
data:
temp(10).
temp = ' 12'.
overlay temp with '0000000000'.
write temp.
07-02-2007 2:01 PM
Thanks to all for the response.
I had tried all of these things.However I am still going to try and give points to all the answers with function module <b>CONVERSION_EXIT_ALPHA_INPUT</b>
Now the problem lied in the conversion routines attached to the data elements of the fields which were getting used in the internal table.
What I did was I changed the domain to a 'z' domain and obviously avoided the conversion routine.
Thank you all.
Dipesh Jhala.