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

ABAP - Data Type Short Dump

Former Member
0 Likes
1,113

Hello,

I am reading data from an excel sheet into a Function Module. In the excel sheet, when i enter 1000, it gets converted into 1,000.00 since its an amount value. This value is being stored in the function mdoule into an internal table (itab) that has a field 'Value' of type C (Length - 60).

In the FM, i defined a variable 'amt' of data type P.

amt = itab-value.

When i executed the Function Moule, i get a short dump saying 'Unable to interpret '1,000.00' as a number'. How to overcome this issue?

Please suggest.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
924

Hi sachin,

We can make that filed as currency type(CURR) ok..

or we make them declare like this

data: begin of itab occurs 0,

net like vbap-netpr,

end of itab.

Here netpr is of type CURR.

Award points if hellpful.

Kiran Kumar.G.A

5 REPLIES 5
Read only

Former Member
0 Likes
925

Hi sachin,

We can make that filed as currency type(CURR) ok..

or we make them declare like this

data: begin of itab occurs 0,

net like vbap-netpr,

end of itab.

Here netpr is of type CURR.

Award points if hellpful.

Kiran Kumar.G.A

Read only

Former Member
0 Likes
924

Hi,

make the below settings for that field column in you Excel sheet and then try.

selecte the entire column in you excel sheet.

1) right click on the header of that column. choose 'Format cells' option.

2) under the 'number' tab go to 'catagory' list box, select the 'Custom' option.

3) in right side you can find 'Type' list box, select '0' from that list box.

4) immediately above to that list box, you can find one text box (under 'Type' only).

5) there enter as many zeros as of field size, click 'OK' button, and save it.

try to read the data from your excel sheet and then try.

Reward if useful.

Thanks,

Ashok.

Reward if useful.

Thanks,

Ashok.

Edited by: Ashok Kumar P on Jan 9, 2008 5:29 PM

Read only

Former Member
0 Likes
924

Hello Sachin,

Is that you read data from an excel file directly into your FM?

After reading the data from the excel file, try converting the character value to a packed decimal format. Then move that value into your amount field.

Use this FM to convert the char value to a Packed or Float value. OIU_ME_CHAR_TO_NUMBER

Pass itab-value to FM - OIU_ME_CHAR_TO_NUMBER and get the packed digit number. Use that into your amt field.

Hope dump would not come any more on this issue.

Award me points if useful!

Thanks,

Ananth

Read only

Former Member
0 Likes
924

Hi Sachin,

Can you please tel me which Function Module you are using to read data from excel so that I can check.

Read only

Former Member
0 Likes
924

Hello Guys,

Thanks for your replies. I solved the issue.

This is what i did.

*Before these, itab-value has 1,000.00

REPLACE ',' WITH '' INTO itab-value.

  • The output is: 1 000.00

CONDENSE itab-value NO-GAPS.

  • The output is: 1000.00

amt = itab-value.

  • The output is: 1000.00

Thanks