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 in Gui_Upload

Former Member
0 Likes
1,265

Hi all,

I am using Gui_Upload to upload a flat file as below.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = i_fname

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

tables

data_tab = i_final.

I am getting '###' in the internal table. I checked the file structure also. Pls help me.

Thanks,

Praveena

10 REPLIES 10
Read only

Former Member
0 Likes
1,240

Hi,

Check if in ur flat-file two fields are seperated by one tab space.....

Read only

Former Member
0 Likes
1,240

Hi

you specified

HAS_FIELD_SEPARATOR = 'X'

so save that file as tab delimited file then it will come in order

if you save that as normal file then it will display that ## symbols

Read only

Former Member
0 Likes
1,240

Check your file data structure. Is it a tab-delimitted file?

IT_FINAL should have the same structure as that of the Input file data. Check that.

Check these and revert back.

Hope this helps.

Thanks,

Balaji

Read only

Former Member
0 Likes
1,240

Hi,

Check out if u have given correct tab space in ur file.

Regards,

Ramya

Read only

Former Member
0 Likes
1,240

hi

check the ur flat file values are tab milimeter format r not

and check the fm in types of export parameters

regards

kk .

Read only

Former Member
0 Likes
1,240

Hi,

What is a delimiter u are using.

If tab is your delimiter use FILETYPE = 'DAT'

If delimiter is 'X' then replace it with ',' (comma) and try.

Regards,

Sreekanth

Read only

Former Member
0 Likes
1,240

hi,

Does ur flat file contains data. When u use tab delimited flat file u will get details seperated by '#'.

Just run this program and see.ur internal table has that '#' symbol with data . In this i have used gui_download to download data into another flat file. (use tab delimited flat file)

REPORT zflatfile_upper_f4help.

*----


  • INTERNAL TABLE

*----


DATA: BEGIN OF wi_upp OCCURS 0,

text TYPE string,

END OF wi_upp.

DATA: BEGIN OF wi_upp1 OCCURS 0,

text1 TYPE string,

END OF wi_upp1.

*----


  • DATA

*----


DATA: var1 LIKE rlgrap-filename.

DATA: var2 LIKE rlgrap-filename.

DATA : name1 TYPE string ,

name2 TYPE string.

*&----


*& CALLING FUNCTIONAL MODULE 'KD_GET_FILENAME_ON_F4'

*&----


CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

program_name = syst-repid

dynpro_number = syst-dynnr

CHANGING

file_name = var1.

IF sy-subrc <> 0.

ENDIF.

name1 = var1.

*&----


*& CALLING FUNCTIONAL MODULE 'GUI_UPLOAD'

*&----


CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = name1

filetype = 'ASC'

TABLES

data_tab = wi_upp.

LOOP AT wi_upp.

WRITE:/ wi_upp-text.

TRANSLATE wi_upp-text TO UPPER CASE.

APPEND wi_upp TO wi_upp1.

WRITE:/ wi_upp-text.

ENDLOOP.

*&----


*& CALLING FUNCTIONAL MODULE 'KD_GET_FILENAME_ON_F4'

*&----


CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

program_name = syst-repid

dynpro_number = syst-dynnr

CHANGING

file_name = var2.

name2 = var2.

*&----


*& CALLING FUNCTIONAL MODULE 'GUI_DOWNLOAD'

*&----


CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = name2

filetype = 'ASC'

TABLES

data_tab = wi_upp1.

hope this helps u,

B.S.Arunsri

Read only

0 Likes
1,240

Hi all,

Thank u for ur answers... Am getting other error now. "Cannont interpret the data in the file".

ArunaSri I tried ur prg the file is uploading well and the result is also getting with one # seperator. Thank u for this.

With ur prg the file is working fine but in my prg am getting the error. Please help me..

Points will be rewarded,

Thanks in advance,

praveena

Read only

Sultanuddin
Explorer
0 Likes
1,240

First thing, the structure of the flat file and the internal table must be same.

Check the data type of the fields for which you are getting an error.

Use .csv file or .txt file to upload the data.

I think this should do...

Read only

Sultanuddin
Explorer
0 Likes
1,240

First thing, the structure of the flat file and the internal table must be same.

Check the data type of the fields for which you are getting an error.

Use .csv file or .txt file to upload the data.

I think this should do...

---

Reward points if helpful