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

Convert into number format

Former Member
0 Likes
345

I am uploading data in to table and one of that field is num format.

e.g. data coming from file is '1'

and i am storing it into internal table with field format NUM lenth 2.

now when i am transfering file data to internal table it stores in that field as 1 and i want it to store it like '01'. can anybody help meon that.

thanks

2 REPLIES 2
Read only

Former Member
0 Likes
313

Hi,

Move to a numc variable..

DATA: V_CHAR(1) VALUE '1'.

DATA: V_NUMC(2) TYPE N.

V_NUMC = V_CHAR.

WRITE: V_NUMC.

Thanks,

Naren

Read only

Former Member
0 Likes
313

Hi,

Declare the field as NUMC, and if you do not see the prefix zero, then call this func.module

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = itab-num

IMPORTING

OUTPUT = itab-num .

This will prefix itab-num with zeroes upto the total length of the field.

regards

Subramanian