Application Development 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: 

Regarding GUI_UPLOAD

Former Member
0 Kudos

Hello,

I am using the function module GUI_UPLOAD as follows

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = str_file

filetype = 'ASC'

has_field_separator = '|'

TABLES

data_tab = it_upload.

The file is having the data as follows

0000001000083|0000010000029|200804|20080401|20080430|000000002857113.86|Z15|000000002857113.86

and the internal table is it_upload is as follows.

DATA:BEGIN OF it_upload OCCURS 0,

cn_no(13), " type RECNNUMBER,

cust_temp(13), " Customer number

Period_temp(6), " Period

report_from(8),

report_to(8),

net_sales TYPE resrsalesnet,

salestype(3),

sales_temp TYPE resrsalesnet,

END OF it_upload.

Here the problem is i am not getting the data into the fields appropriately.

Please suggest me where i had done mistake and it is urgent

Regards,

Radha.

10 REPLIES 10

Former Member
0 Kudos

In the field seperator parameter you gave '/' as the seperator.

But GUI_UPLOAD is only useful for tab delimiters.

'X': Fields are separated by tabs.

SPACE: Fields are not separated by tabs. In this case, the table must

contain either only one single column or all columns must be contained

in the file in their full length.

I suggest you to read the documentation provided in the function module.

Regards,

Jagadish

Former Member
0 Kudos

I would suggest you better use Excel file for uploading.Make use of FM ALSM_EXCEL_TO_INTERNAL_TABLE.

Former Member
0 Kudos

No i cant change the input file at all and please suggest other function modules where i can use the '|' as field seperator

former_member314455
Participant
0 Kudos

Hi,

If you are using a text file to uplaod these values, use one TAB space between the values . i.e after each value press TAB and then enter the next value.

It is advised to use excel format to upload , as data is copied as it is in the excel sheet.

reward points if you find it useful.

Ajith

Former Member
0 Kudos

Hi,

Make use of the following function modules

SAP_CONVERT_TO_TEX_FORMAT

SAP_CONVERT_TO_TXT_FORMAT.

Refer the following thread for a similar post.

Regards,

Jagadish

former_member188685
Active Contributor
0 Kudos

Change the code and see...

CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = str_file
filetype = 'ASC'

has_field_separator = 'X'

  "not '|'
TABLES
data_tab = it_upload.

Former Member
0 Kudos

Hi

What you do is:

data: begin of itab occurs 0,

data(255) type c,

end of itab.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = str_file

filetype = 'ASC'

TABLES

data_tab = itab.

loop at itab.

split itab-data at '|' into it_upload-cn_no

it_upload-cust_temp

it_upload-Period_temp

it_upload-report_from

it_upload-report_to

it_upload-net_sales

it_upload-salestype

it_upload-sales_temp .

append it_upload.

endloop.

Regards

Gareth

Edited by: Gareth Ellem on Jun 27, 2008 3:49 PM

Former Member
0 Kudos

hi ,

u r having word file right. first convert that into excel . then give file name and save as type " tab delimited " .then save . automatically note pad of the given file name will come. then use that file in ur program with file type 'DAT'.

every thing will be assigned properly.

regards,

diana.

Former Member
0 Kudos

Hi Radha,

In the HAS-FIELD_SEPERATOR option we can have only two options. It is either 'X' or ' '.

'X' implies - It has field seperator

' ' implies - No field seperator.

Hope this helps you.

Regards,

Chandra Sekhar

Former Member
0 Kudos

Hi,

Just make the has_field_seperator = 'X'.

Warm Regards

R Adarsh