Doubt on gui_upload
Hi
I am working with r/3 version 4.6 B . I ma using gui_upload to read the data froma text file from desktop. the text file contains tow columns of data separated by tab space. when i pass this to the gui_upload the two columns data is going into first column of the internal table. the code is shown below
DATA : BEGIN OF itab_bdc OCCURS 0,
konob LIKE table-konob,
matnr LIKE table-matnr,
END OF itab_bdc
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file1
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
read_by_line = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab_bdc
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
when i see the internal table itab_bdc the field konob contains both the columns data of the text file. It is not splitting the konob and matnr data into two different columns. what shd i do ??
thanks
sankar
This question had been answer in other thread...
[GUI_UPLOAD FM;
Please do not duplicate threads...Locking this one...
Greetings,
Blag.
Similar Messages
-
Doubt in GUI_UPLOAD function
Hi friends,
CALL FUNCTION 'GUI_UPLOAD '
EXPORTING
FILENAME = FILE
FILETYPE = 'ASC'
*HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ITAB.
In the GUI_UPLOAD function what the filetype should be and has_field_separator should be given what value? What does it mean.How should i prepare the file for example for VA01 transaction if i have a file like this it is not working. What is the problem. I am new to BDC so i need your help on this.
Thanks in Advance.try the following.
DATA: begin of ITAB occurs 0,
field1 type char10,
field2 type char10,
end of itab.
data: filename type string value 'C:\TMP.TXT'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = filename
FILETYPE = 'ASC'
TABLES
DATA_TAB = itab.
loop at itab.
write:/ itab-field1, 20 itab-field2.
endloop.
create a file with tab-delimitations. -
Doubt with FM 'GUI_UPLOAD'
DATA: BEGIN OF WA_MARA,
matnr type matnr,
numero type n,
valor(2) type c,
END OF WA_MARA.
DATA: FF_PATH TYPE STRING.
FF_PATH = 'C:\test_file.txt'.
DATA: IT_MARA LIKE TABLE OF WA_MARA WITH HEADER LINE .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FF_PATH
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X '
TABLES
DATA_TAB = IT_MARA.
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
WRITE / 'the uploaded records in the internal table are'.
WRITE /.
LOOP AT IT_MARA.
WRITE: / IT_MARA.
ENDLOOP.
I have the following doubt. I am using a file with fields separated by a tab for upload to the internal table , however the system not display exception when i upload for example (image, or other format different).
How can do this?
Regards
JuanHey
From my point of view, how can the systmem know what you are uploading is not correct?, all files have text, either if they are bitmaps, excel or whatever, so th only way, is to show to the user what they just uploaded and ask him if the information is correct.
Bye, -
Gui_upload and ws_upload
hi friends,
i have a small doubt i just want to know the difference betweeen
GUI_UPLOAD and WS_UPLOAD which one i have to use.
which function module is useful and most preferred.
regards
srinivasWS_UPLOAD and WS_DOWNLOAD, the function modules used until now are not part of the standard set of ABAP commands. They are used to display the file interface on the presentation server. WS_UPLOAD and WS_DOWNLOAD are not compatible with USs and have been replaced by GUI_UPLOAD and GUI_DOWNLOAD.
The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also allows you to write Unicode format to the local hard drive. For a description of these interfaces, refer to the documentation for each function module, available under SAP Easy Access " Development " Function Builder " Goto " Documentation. -
i want to upload some records from the flat file to internal table. when i use GUI_UPLOAD function module in tables parameter i have given the work area. but when i use CL_GUI_FRONTEND_SERVICES-=>FILE_OPEN_DIALOG and then CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD i have given the internal table body in the changing parameters. my doubt is we have used GUI_UPLOAD in both occassions but when we use GUI_UPLOAD alone we are giving the internal table workarea but when we use it along with class CL_GUI_FRONTEND_SERVICES we are giving the internal table body. whats is the reason or logic behind this?.
Hi guys -- the answers you've given are correct but an example IMO is 100% better
go_guiobj type ref to cl_gui_frontend_services., "For Windows file dialog
form load_data using e_file type string
e_table.
field-symbols <int_table> type standard table.
assign e_table to <int_table>.
if go_guiobj is initial.
create object go_guiobj.
endif.
call method go_guiobj->gui_download
exporting
filename = e_file
filetype = 'ASC'
write_field_separator = 'X'
changing
data_tab = <int_table>.
endform
* For Directory look up service (Windows)
at selection-screen
on value-request for p_direct.
search_path = p_direct.
perform directory_lookup using search_path.
if not gv_folder is initial.
p_direct = gv_folder.
endif.
form directory_lookup using directory type string.
if go_guiobj is initial.
create object go_guiobj.
endif.
call method go_guiobj->directory_browse
exporting
window_title = 'Select Directory'
initial_folder = directory
changing
selected_folder = gv_folder.
endform. "directory_lookup
Cheers
jimbo -
Uploading into database table from text file using tab (GUI_UPLOAD)
i have small doubt
i have 3 fiels in text file using tab as separator
i need to update into database table 'ZABPSP_01'
from 's.txt' located in local disk.
My code is below.
Please let me know the correction.
Awaiting for ur response.
Thanks in advance
REPORT ZABPSPPRG_02.
TABLES: LFA1,MARA,KNA1,ZABPSP_01.
DATA: begin of itab occurs 0,
IKUNNR type zabpsp_01-kunnr,
IMATNR type zabpsp_01-matnr,
IADRNR type zabpsp_01-adrnr.
DATA:END OF ITAB.
DATA: FILENAME1 TYPE STRING.
FILENAME1 = 'C:/s.txt'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME1
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = itab.
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc EQ 0.
zabpsp_01-kunnr = ITAB-IKUNNR.
zabpsp_01-matnr = ITAB-IMATNR.
zabpsp_01-adrnr = ITAB-IADRNR.
WRITE : / ' UPLOAD SUCCESS ' .
ENDIF.
\[subject changed, don't write everything in upper case!\]
Edited by: Jan Stallkamp on Aug 6, 2008 2:39 PMHi,
After upload modify the code like below. Also change the file name as some one suggested already. If u are still facing problems then check in debug mode what is happening after FM call.
CALL GUI_UPLOAD FM.
IF sy-subrc EQ 0
IF NOT itab[] IS INITIAL.
MODIFY ZABPSP_01 FROM TABLE itab.
WRITE : / ' UPLOAD SUCCESS ' .
ELSE.
WRITE 'No data in file'.
ENDIF.
ELSE.
WRITE 'Upload failure'.
ENDIF.
Thanks,
Vinod. -
Does 'GUI_UPLOAD' support 'DAT' filetype..?
Hi All,
I am working on an Upload program. In that they have used the file type as 'DAT'.
My doubt is whether <b>'GUI_UPLOAD'</b> supports <b>'DAT'</b> filetype or not.
Bacause, while uploading the tool, I am getting '<b>Invalid file type error</b>'.
can anyone let me know the reason this issue.
Thanks & Regards,
Paddu.<b>GUI_UPLOAD does support "ASC", "BIN" & "DAT" Filetypes.</b>
details regd filetypes:
'BIN'
A binary representation of the internal table is read from the file.
No conversion or interpretation is carried out. Usually, this produces
meaningful results only if the internal table consists of a single
column of type 'X'.
'DAT'
The components of the internal table are filled from the file. If the
table contains more than one column, the entries in the file must be
separated by tabs. Conversion exits are not carried out.
For the different data types, the following applies:
I or N or P or F
The numbers must be formatted according to the decimal representation
defined in the user settings.
D
The date must be formatted according to the date format defined in the
user settings.
T
The time must have format hh:mm:ss.
'ASC'.
The components of the internal table are filled from the file. Only data
types of fixed length are allowed. The data must be contained on the
file in its entire length.
refer from the documentation of gui_upload from tcode se37.
regards,
srinivas -
Doubts about some popular function modules?
Hi all,
I have doubts about these function modules (see in parenthesis)
ws_filename_get (to get the file name at ...?)
ws_query (to get file size and environment variables from the presentation server to the ...?)
upload and download (what are the new function modules used in place of these (I know they are obsolete now)
what is the Object oriented equivalents of these functions?
Thanks.
Charles.
++++++++++++++++++++++++++++++++++++<i>(1)What is the use of ws_filename_get? Please be specific in your answer, about where the file resides: application server, presentation server or the ABAP program.</i>
It is simply providing an interface for the user to choose a filename which resides on the frontend PC(presentation server). As suggested already, this has been replaced with FILE_OPEN_DIALOG method of the class CL_GUI_FRONTEND_SERVICES.
<i>2)What is the use of ws_query? Please be specific in your answer, about where the file resides: application server, presentation server or the ABAP program.</i>
Again, already answered, this has been replace by multiple more specific methods of the same class mentioned above.
<i>How can GUI_UPLOAD be a substitute of Upload? It is a substitute of WS_UPLOAD as upload is used to transfer data from presentation server to the ABAP program, whereas the other two are used to get it from presentation server to the application server.</i>
They all transafer data from the presentation to your application. They are all interchangable(in a sense), but you should be using the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES.
Regards
Rich Heilman -
hi i have a doubt....
in fbl1n transaction, there are open items and cleared items.
in it the cleared items for certain document types such as invoice etc is not present in the open item table (bsik)
however the cleared items for document types such as general voucher its present in the open items table (bsik)
is this possible as all cleared item entries shld b present in the open item table with an indicator set for cleared or not...
plz exlain!Hi
There are 2 tables(open and Closed Items) in FI for Account Payables and Account Receivables and GL accounts
1.Account payables: BSIK is Open Items and BSAK is Closed items
2.Account Receivables; BSID and BSAD for OPEN and closed items
3/GL accounts : BSIS and BSAS for Open and Closed Items
<b>Reward points for useful Answers</b>
Regards
Anji -
Doubt in creation of a new object
Hi All,
I have one doubt in creation of a new object.If a new object is to be created and it is not a subtype
of any existing object, then what should we enter in the Program field for creating the object?
I hope I am clear with my question.
Thanks in Advance,
Saket.Hi Saket,
Following will be required for created a custom business object.
1. Object Type - ZTEST (Internal Techincal Key)
2. Object Name - ZTESTNAME (Technical Key Name)
3. Name - TEST (Name of BO, it is used while selecting the object type)
4. Description - (Short Description of BO)
5. Program - ZTESTPROGRAM (ABAP program in which the methods of the object type are implemented)
6. Application - A or B.. etc (Area to which your BO is related)
Please remember that you can learn these basic things by giving F1 help on those fields and in HELP.SAP.COM.
Regards,
Gautham Paspala -
Difference between GUI_UPLOAD and WS_UPLOAD
Hi,
Please make me clear about the difference between GUI_UPLOAD and WS_UPLOAD. In which cases we need to use these modules...??
Thanks,
SatishI would suggest to always use the GUI_UPLOAD. I say this because this is the function module which is used in the GUI_UPLOAD method of the class CL_GUI_FRONTEND_SERVICES. Really, you should probably use the class/method instead of the function module.
data: filename type string.
filename = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = filename
filetype = 'ASC'
changing
data_tab = iflatf
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
no_authority = 6
unknown_error = 7
bad_data_format = 8
unknown_dp_error = 12
access_denied = 13
others = 17.
Regards,
Rich Heilman -
WS_UPLOAD,WS_DOWNLOAD and GUI_UPLOAD,GUI_DOWNLOAD.
Hi,
Any one Explain difference between WS_UPLOAD,WS_DOWNLOAD and GUI_UPLOAD,GUI_DOWNLOAD.
Regards,
Mayahi maya,
ws_upload and gui_upload, will do the same funtionality.
ws_download and gui_download will do the same functionality.
but ws* are obsolete.
Regards....
Arun.
Reward points if useful. -
Hi Everyone,
Can we read and validate the attachment of the mail.If so how to do it.
Thanks in advance,
SakthiHi Sakthi,
Please refere the below links:
http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/0d/52b240ac052817e10000000a1550b0/frameset.htm
Let me know if you have any doubts regarding this.
Thanks,
sekhar. -
"Cannot interpret data in file" error while using GUI_UPLOAD for .xls file
Hi,
I have made a program using FM GUI_UPLOAD to upload an .xls file to an internal table. But upon executing ,it gives error "Cannot Interpret data in file". I have seen in other posts people talking about GUI_UPLOAD FM to upload data from excel directly into internal table. Kindly help.
Here is my code. I had tried using different combination for HAS_FIELD_SEPARATOR but still its not working.
In my emp1.xls file , the data in each column is present in the same order as in the internal table. Although the first column in my internal table is NUMC. I dont know if that is causing the problem.
REPORT ZUPLOAD_1.
data: itab TYPE TABLE OF zempl_master WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\empl1.xls'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = itab.
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_READ_ERROR = 2
* NO_BATCH = 3
* GUI_REFUSE_FILETRANSFER = 4
* INVALID_TYPE = 5
* NO_AUTHORITY = 6
* UNKNOWN_ERROR = 7
* BAD_DATA_FORMAT = 8
* HEADER_NOT_ALLOWED = 9
* SEPARATOR_NOT_ALLOWED = 10
* HEADER_TOO_LONG = 11
* UNKNOWN_DP_ERROR = 12
* ACCESS_DENIED = 13
* DP_OUT_OF_MEMORY = 14
* DISK_FULL = 15
* DP_TIMEOUT = 16
* OTHERS = 17
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP at itab.
write:/ itab-emp_no,itab-name.
endloop.hi amber22 you need to use the below fm to upload an xls file
FORM EXCEL_UPLOAD .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = FILENAM
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 6
I_END_ROW = 100
TABLES
INTERN = xl_itab.
* EXCEPTIONS
* INCONSISTENT_PARAMETERS = 1
* UPLOAD_OLE = 2
* OTHERS = 3 .
IF SY-SUBRC = 0.
MESSAGE 'DATA UPLOADED SUCCESSFULLY' TYPE 'I'.
ENDIF.
ENDFORM. " EXCEL_UPLOAD -
PI' RFC Connection pool doubt.
Hi PI exports:
i have a doubt about pi' RFC Connection pool ,pi RFC receive channel can set the conn pool size ,but when start the rfc receiver channel ,is there always only one Connection pool ,or there is only one Connection pool instance?
thinks
Edited by: kevin liang on Oct 19, 2009 6:45 AMHi,
Connection poolins size means how many number of connection you want to make open to send data to ECC, We can define maximum number of connection in Receiver RFC Adapter,Go to additional parameters section and define Max Number of connection give the number there,thats it.Internally it works as Connection poolin mechanism.
Regards,
Raj
Maybe you are looking for
-
Mid 2010 Macbook Pro battery will not charge after plugging in firewire cable shut down computer
I have a mid 2010 15" Macbook pro with Lion installed. I was running off battery, and I went to plug in a firewire cable, not plugged into anything, and when I inserted it, the computer shut off. The computer would not turn on again without being plu
-
Why are the additional effects on Photo Booth not working?
I upgraded my OS to Mountain Lion a few hours ago and I tried out the Photo Booth and found out that the first page of effects (the new ones) were not working. Is there any way to fix this?
-
Anyone else still have battery issue?
Just downloade 10.8.1. Still having issues with my battery... Just wondering if anyone else is still having issues??? Come on 10.8.2... Please help...
-
Hello, I created generic Data Source as ZMM_MAIN, I selected LBKUM(Total Valuated Stock) data type as "QUN" refference field as 0UNIT in the data source so that I can have selection criteria in infopackage. When i replicate this datasource in BI , Un
-
Non-working time for particular resources
I have reviewed the suggested answers and they don't seem to fit my case. Project 2013 Pro. I have a particular resource who takes three days off. These days occur in the middle of an 8 day task, fixed duration, on which he is only working 20%. He