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

Problem with GUI_UPLOAD

Former Member
0 Likes
1,437

Hi,

Hello,

when i import data from a tab delimited file, with the function module GUI_UPLOAD, i always get the BAD_DATA_FORMAT error.

I have notice that the field who causes the problem is a numeric field(EX: 12.50). If i put only 1250, the problem disappear.

Before i use this function module i use another that is now obsolete WS_UPLOAD, and with this old... function it works very well... the numeric field is convert into the correct format to the internal table.

Us suggested by SAP, we must use the new function module GUI_UPLOAD.

But if we need to change all the programs that use the old WS_UPLOAD to the new one... we must create new internal tables only with char fields and the pass this data to the existent table.

.

Anybody has a clue? or not?

Thanks in advance

AOL

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,152

Kindly check this function module the internal table got after file upload is having string format (DATA_TAB). hence whenever the internal file will having numeric field it will create error.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = i_fname

DAT_MODE = 'X'

TABLES

DATA_TAB = mt_tab.

try function module UPLOAD. It will work.

anya

6 REPLIES 6
Read only

Former Member
0 Likes
1,152

Can you post your internal table declaration and whic field is failing? Most likely is a P data type without decimal points

Read only

Former Member
0 Likes
1,152

The field has the data element ERFMG.

Data type QUAN with 3 decimals.

thanks,

AOL

Read only

0 Likes
1,152

Can you post all the code?

Read only

Former Member
0 Likes
1,152

Hi

Try replacing the . (dot) with , (comma) in a number.

So not 12.50 but 12,50.

Rgds

Mat

Read only

0 Likes
1,152

Hello,

all this thinks were tested, in the GUI_UPLOAD doesn,t work.

What i need to know is: is obligatory move the quantity fields from the source table to text fields in the abap table.

And after that pass to other table with the correspondig fields in quantity format.

Many thanks,

AOL.

Read only

Former Member
0 Likes
1,153

Kindly check this function module the internal table got after file upload is having string format (DATA_TAB). hence whenever the internal file will having numeric field it will create error.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = i_fname

DAT_MODE = 'X'

TABLES

DATA_TAB = mt_tab.

try function module UPLOAD. It will work.

anya