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

Conversion error: right datatype for quantity fix?

Former Member
0 Likes
1,155

Hi all,

I need to pass some data from an excel file to an internal table from type rku01g . I am having a conversion problem with the field mefbtr which is of type quantity 15.

I have define my input field with a type char 15 and it is not working. I even used the component type from the table MEFXXX. Help me fix this conversion error. Which data type should i give to my field that get data from an excel file.

Thanks

1 ACCEPTED SOLUTION
Read only

former_member213275
Contributor
0 Likes
966

Hi Maria,

Use Function module "MOVE_CHAR_TO_NUM". It converst character field to quantity field.

E.g.

     call function 'MOVE_CHAR_TO_NUM'

         exporting

              chr             = Charvariable

         importing

              num             = qty_variable

         exceptions

              convt_no_number = 1

              convt_overflow  = 2.

Srikanth.

6 REPLIES 6
Read only

former_member213275
Contributor
0 Likes
967

Hi Maria,

Use Function module "MOVE_CHAR_TO_NUM". It converst character field to quantity field.

E.g.

     call function 'MOVE_CHAR_TO_NUM'

         exporting

              chr             = Charvariable

         importing

              num             = qty_variable

         exceptions

              convt_no_number = 1

              convt_overflow  = 2.

Srikanth.

Read only

0 Likes
966

Srikanth,

Try using RS_CONV_EX_2_IN.

Read only

Former Member
0 Likes
966

Hi Maria,

Take the type string for that field while uploading into internal table.

Declare one variable of type MEFXXX.

Move that string variable into variable of type MEFXXX.

Read only

0 Likes
966

This message was moderated.

Read only

Former Member
0 Likes
966

This message was moderated.

Read only

venkateswaran_k
Active Contributor
0 Likes
966

what is your conversion error ? can you please post it.

1. Try using Type  P decimals 3

Or

2. Try using MENGE_D

In one of my requirement, I fetch quantity from Excel sheet as follows:

TYPES: BEGIN OF t_upload,

         srno     TYPE int2,

         material TYPe lips-matnr,

         quantity TYPE lips-lfimg,

         hdrtxt   type string,

       END OF t_upload.