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

uploading legacy data with filetype 'DAT'

Former Member
0 Likes
1,192

Guyz!

hope u all r growing at a great pace. i am having one doubt. In FM 'GUI_UPLOAD', the supporting file types are 'bin', 'dat', 'asc'. But if you will have a look at the source code of the function module, it has given 2 cases for 'bin' and 'asc'. for other file types it is raising error message stating invalid filetype. but in import tab for filetype, in the long text, it is saying that there is provision for 'dat' filetype. so anybody came accross this situation and found any solution? looking forward to some fruitful reply.

best regards

manas

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
1,131

hi

i too faced some prblm while using dat but i have changed it to asc and it worked fine for me..

Cheers,

Abdul

Guyz!

hope u all r growing at a great pace. i am having one doubt. In FM 'GUI_UPLOAD', the supporting file types are 'bin', 'dat', 'asc'. But if you will have a look at the source code of the function module, it has given 2 cases for 'bin' and 'asc'. for other file types it is raising error message stating invalid filetype. but in import tab for filetype, in the long text, it is saying that there is provision for 'dat' filetype. so anybody came accross this situation and found any solution? looking forward to some fruitful reply.

best regards

manas

6 REPLIES 6
Read only

abdul_hakim
Active Contributor
0 Likes
1,132

hi

i too faced some prblm while using dat but i have changed it to asc and it worked fine for me..

Cheers,

Abdul

Read only

Former Member
0 Likes
1,131

Hi Manas,

1. See the GUI_Upload fm works fine with the file types ASC or BIN. And it is mentioned in the code of the fm too.

2. I just wrote a code to upload a file and passed 'DAT' for the parameter Filetype. (Uncomment all the exceptions mentioned in the fm in the main program).

It gave neither compilation error nor runtime error. But no data was uploaded.

However , with everything remaining the same when you change the filetype to ASC , the data is successfully uploaded.

So, conclusively the fm works fine with the two filetypes 'ASC' or 'BIN'.

Regards,

Kunal.

Read only

Former Member
0 Likes
1,131

Hi Manas,

1. See the GUI_Upload fm works fine with the file types ASC or BIN. And it is mentioned in the code of the fm too.

2. I just wrote a code to upload a file and passed 'DAT' for the parameter Filetype. (Uncomment all the exceptions mentioned in the fm in the main program).

It gave neither compilation error nor runtime error. But no data was uploaded.

However , with everything remaining the same when you change the filetype to ASC , the data is successfully uploaded.

So, conclusively the fm works fine with the two filetypes 'ASC' or 'BIN' only.

Regards,

Kunal.

Read only

Former Member
0 Likes
1,131

Hai Manas

Check the following Code

tables : mara.

data : begin of it_mara occurs 0,

matnr like mara-matnr,

mbrsh like mara-mbrsh,

mtart like mara-mtart,

maktx like makt-maktx,

meins like mara-meins,

end of it_mara.

start-of-selection.

perform upload_data.

&----


*& Form upload_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM upload_data .

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'c:\mat_bdc.xls'

FILETYPE = 'DAT'

DAT_MODE = 'X'

TABLES

DATA_TAB = it_mara.

IF SY-SUBRC = 0.

SORT IT_MARA BY MATNR.

ENDIF.

ENDFORM. " upload_data

the flatfile structure as follows

PRANIT_011 C COUP This is Testing material Kg

PRANIT_012 C COUP This is Testing material Kg

PRANIT_013 C COUP This is Testing material Kg

PRANIT_014 C COUP This is Testing material Kg

PRANIT_015 C COUP This is Testing material Kg

Thanks & regards

Sreenivasulu P

Read only

0 Likes
1,131

Sreenivasulu P

it is not working. it's throwing the same error message: wrong value of the parameter filetype.

Read only

0 Likes
1,131

Hi Manas,

It wont work . this program by Sreenivasulu P also proved this. So the only types that we can work using fun module gui_upload is ASC and BIN.

And this has been mentioned clarely when you go through the code of fm Gui_upload.

Regards,

Kunal.