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

Converting data

Former Member
0 Likes
508

Hi Experts,

suppose i have a field lets say V1 type c and size is 10.

data : v1(10) type c value '10'.

now i want the output as in this format. the output shld b filled with leading zero's and .00 will be added at last.

i.e.,

Output is

0000010.00

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
487

Hi,

Use the FM:

<b>CONVERSION_EXIT_ALPHA_INPUT</b> converts any number into a string fill with zeroes, with the number at the extreme right

Example:

input = 123

output = 0000000000000...000000000000123

Hope this helps.

Reward if helpful.

Regards,

Sipra

5 REPLIES 5
Read only

Former Member
0 Likes
488

Hi,

Use the FM:

<b>CONVERSION_EXIT_ALPHA_INPUT</b> converts any number into a string fill with zeroes, with the number at the extreme right

Example:

input = 123

output = 0000000000000...000000000000123

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

0 Likes
487

and wht abt u adding .00 at the end.

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
487

Hi,

Define the variable as packed and

Use Decimals 2.

data: v type p decimals 2.

Cheers,

Simha.

Read only

Former Member
0 Likes
487

Hi

try like this:

data : c(10) type c value '10'.

data : p type p decimals 2.

data : n(12) type n.

p = c.

  • n = p.

write : / p .

regards

Shiva

Read only

Former Member
0 Likes
487

i think u need to handle this in a code ,

just a pseudo logic ..for ur query ..

data : v1(11) type c value '10'.

data: v3(8) type n .

 v3 = v1.
 concatenate   v3  '.00'   into v1.  
 write:/ v1.

so here if i have a value in place of '.00' as '.13' capture this into a variable for the decimal part and concatenate this into variable .

regards,

vijay.