Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Field conversion from char .

Former Member
0 Likes
906

Dear member ,

Is there any way to reduce the prefix zero from sale order 10 digit char .

EG: if 0053549980 is the so no I want to make it 53549980 . I have transfered the vale into integer variable but error is coming data overflow .

Help me to find out the solution .

Regards ,

Joy .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
871

Hi Joy,

Try using the PACK keyword to remove the leading zeros.

PACK <var1> TO <var2>.
CONDENSE <var2>.

Here var1 and var2 both are Character Type variables.

Hope it helps.

Regards,

Himanshu

7 REPLIES 7
Read only

GauthamV
Active Contributor
0 Likes
871

Plz SEARCH in SCN before posting, you will get lot of posts

with this FM.

CONVERSION_EXIT_ALPHA_OUTPUT

Read only

Former Member
0 Likes
871

Thanks ur mail , but this one is the right code .

PACK <var1> TO <var2>.

CONDENSE <var2>.

Read only

Former Member
0 Likes
871

Thanks Himansu , it really workin , problem solve .

Read only

Former Member
0 Likes
871

Hi,

Try

Shift lv_value left deleting leading 0.

or conversion_exit_alpha_output.

Regards,

Himanshu

Read only

venkat_o
Active Contributor
0 Likes
871

Hi, Try this way.

data:num(10) type n VALUE '0053549980'.
WRITE num to num no-ZERO.
WRITE num.
Thanks Venkat.O

Read only

Former Member
0 Likes
871

Hi,

Either use CONVERSION_EXIT_ALPHA_OUTPUT or


data: var(10) type c.

var = '0053549980'.

shift var left deleting leading zeros.

write: var.

Regards,

Vikranth

Read only

Former Member
0 Likes
872

Hi Joy,

Try using the PACK keyword to remove the leading zeros.

PACK <var1> TO <var2>.
CONDENSE <var2>.

Here var1 and var2 both are Character Type variables.

Hope it helps.

Regards,

Himanshu