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

Adding extra zero to the data in internal table

Former Member
0 Likes
2,860

Hi All,

I having an input file which the data have 10 digits of number.

eg: 1000000000.

What I required is to read this data and putiing it in internal table then convert this 10 digits data to 15 digits.

Like adding another 5 zero to it. (000001000000000).

Thank you!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,453

Hi ,

Before appending the data to the table use the unpack command.

Or you can use the data type of the resulting table as 15 type n.

Regards

Arun

8 REPLIES 8
Read only

Former Member
0 Likes
1,454

Hi ,

Before appending the data to the table use the unpack command.

Or you can use the data type of the resulting table as 15 type n.

Regards

Arun

Read only

Former Member
0 Likes
1,453

Hi,

To remove leading zeros and leading blanks

Please use FM

CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal

CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = wf_version

IMPORTING

output = wf_version.

Example:

input = 1230000

output = 12300000000

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
1,453

Hi,

Use FM.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = data

IMPORTING

output = data.

It will give u the no of zeroes u need...

Cheers,

Simha.

Reward all the helpful answers..

Read only

Former Member
0 Likes
1,453

add one more field to ur itab of length 15

loop at itab into wa_itab.

   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = iwa_itab-ten_digit    " ur 10 digit field
 IMPORTING
   OUTPUT        =  wa_itab-fifteen_digit. " new fifteen digit field
          
modify itab from wa_itab.

endloop.

Read only

Former Member
0 Likes
1,453

Little,

Give internal table field length 15.and Use this FM

CONVERSION_EXIT_ALPHA_INPUT

Don't forget ot reward if useful..

Read only

dani_mn
Active Contributor
0 Likes
1,453

HI,

try this.

data: a(15) value '1000000000'.

SHIFT a right by 5 places.
a(5) = '00000'.
write:/ a.

Read only

Former Member
0 Likes
1,453

Hi,

Take one variable of type <b>'N'</b> length <b>15</b>.

And move your variable to this.

<b>data w_numc(15) type n.

w_numc = <your variable>.</b>

Hope this solves your query.

Reward if it helps you.....

Regards,

Sandhya

Read only

Former Member
0 Likes
1,453

Hi,

Try the following code:

shift number right deleting trailing space.

overlay number with '000000000000000'.

The number of zeroes in the overlay statement is 15.

reward all useful answers.