Problem in GUI_upload
Hi everyone,
I am using the FM GUI_upload to upload a .txt tab seperated
file .
when when the FM executes i am finding that the internal table
does not hold all the values in the file.
i ckecked and the no of fields and their type is equal in both the internal table and the file.
what could be the reason for this?
Hi Aditya,
Check out the other sample program to upload the data into the xls file.
REPORT ZCC_EXCEL_UPLOAD.
type-pools: truxs.
data:p_file type RLGRAP-FILENAME.
p_file = 'H:\INT221\testmat1.xlsx'.
*data : sw_string type string.
*sw_string = 'H:\INT221\testmat1.xlsx'.
*p_file = sw_string .
types:begin of t_mara,
matnr(10) ,
end of t_mara.
data:it_tab type standard table of t_mara with header line.
data:w_tab type TRUXS_T_TEXT_DATA.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
I_LINE_HEADER = 'X'
i_tab_raw_data = w_tab
i_filename = p_file
tables
i_tab_converted_data = it_tab
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
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 it_tab.
write:/ it_tab-matnr.
endloop.
Thanks,
Chidanand
Similar Messages
-
Problem in GUI_Upload only first field is appending into table
Hi all,
I m using code :-
DATA : BEGIN OF RAWDATA OCCURS 0,
RECORD type string,
END OF RAWDATA.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = g_file
FILETYPE = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = RAWDATA
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
structure of g_file is like ---
TEST1 MAT1 2 EA 15.00 1
TEST2 MAT2 2 EA 20.00 1
TEST3 MAT1 2 EA 15.00 1
TEST4 MAT2 2 EA 25.00 1
TEST5 MAT2 2 EA 30.00 1
now my problem is in rawdata table record is coming as
test1
test2
but i need it as
test1mat12EA.......
Thanks & Regards,
Ruchi TiwariHi Ruchi,
Are you using excel sheet to upload or text file?
If you are using excel sheet for uplaoding then you can refer to the below code:
P_FILE TYPE FILE_NAME OBLIGATORY.
lv_FILE = P_FILE.
****************** CALL FUNCTION MODULE GUI_UPLOAD******************
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = lv_FILE
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_string.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I hope this helps.
Thanks,
Archana -
Bdc upload file data into internal table problem with gui_upload fm
Hello experts,
my coding is like this ..
data : begin of itab occurs 0 .
field1 like mara-matnr,
field2......
etc,
end of itab.
data: file1 type string.
parameter :file like rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
mask = space
field_name = 'FILE'
CHANGING
file_name = file.
START-OF-SELECTION.
FILE1 = FILE . "HERE I AM PASSING INTO STRING
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILE1
FILETYPE = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
file structure is same as the internal table.
I stored the file as .txt( ie in notepad).
my file is like this..
10000 200 323 sunndarrr.......
i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
when i am using the ws_upload it is working fine.
please guide me where i have done the mistake.
thank you so much for all the replies.Hi,
Have a look on the following code.
TABLES: kna1.
DATA: BEGIN OF itab1 OCCURS 0,
str(255),
END OF itab1.
DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'D:\ABAP EVE\ffile1.txt'
filetype = 'ASC'
TABLES
data_tab = itab1
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
no_authority = 10
OTHERS = 11.
IF sy-subrc <> 0.
WRITE:/ 'sorry'.
ELSE.
LOOP AT itab1.
SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
APPEND itab2.
ENDLOOP.
IF sy-subrc = 0.
LOOP AT itab2.
WRITE:/ itab2-kunnr,itab2-name1.
INSERT INTO kna1 VALUES itab2.
ENDLOOP.
IF sy-subrc = 0.
WRITE:/ 'inserted'.
ELSE.
WRITE:/ 'not inserted'.
ENDIF.
ELSE.
WRITE:/ 'fail'.
ENDIF.
ENDIF.
Flat file:
10001,Sadney
10003,Yogesh
20005,Madan
1.U need to define internal table with one field of max size
2.upload the flat file data into that internal table
3.split that internal table data into another internal table(having fields)
<REMOVED BY MODERATOR>
thanks,
Chandu
Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM -
Problem with GUI_UPLOAD FM
Hi All,
I have trouble using the FM GUI_UPLOAD. I am using this FM to upload text-delimited file data into an ITAB of same structure. The problem is that it is reading only the 1st record and returning sy-subrc = 8. The no of columns in file is 89. When I am reducing the no of columns of this file, then it is reading the data. There is not data format conversion problem, I have check the same. Does any one know why this is happening? Thanks in advance.
Regards,
Prashant.hi prashant,
try this oops concept.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_v_filepc
filetype = 'TXT'
has_field_separator = ' '
header_length = 0
read_by_line = 'X'
dat_mode = SPACE
codepage = SPACE
ignore_cerr = ABAP_TRUE
replacement = '#'
virus_scan_profile =
IMPORTING
filelength =
header =
CHANGING
data_tab = fp_it_pernr_infty "fp_it_pernr
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
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19 .
IF sy-subrc <> 0.
ENDIF. -
Decimals Problem with GUI_UPLOAD
Hi Experts,
Can any one help me,
I am using GUI_UPLOAD FM,the problem is the Decimal Format of the Data which I am uploading is changing to another format.
When using WS_UPLOAD its working fine.
Example:
In SAP it is trying to post as 1 249 400,00 CZK, however it's only 12 494,00 CZK.
value which i am passing to FM is 12494.00
But its converting to 00000001249400
the field is of type N length is 14.Hi SAP58,
Try these
1. Try passing the value as 12494,00 or 12494 to the function module
2. Check the user settings
3. And importanly try debugging the program once, Check how thw value is getting populated to the field(of type N)
Regards,
Amuktha -
Problem with GUI_UPLOAD using excel sheet
Hi,
I am trying to upload excel sheet thru GUI_UPLOAD ... this excel sheet has a header line and 3 line of data. Even if I remove the header line then also the internal while debugging is showing 28 lines of entries with "#" "squares" in some columns ... while in others where data should be there shows all Zeros....
The excel sheet has the following info
Rate Type Valid From Date From Currency To Currency Indirect Quote Direct Quote
M 29.09.2006 SGD USD 1.6932
M 29.09.2006 USD SGD 1.6932
M 29.09.2006 SGD MYR 2.19653
KURST GDATU FCURR TCURR INUKURS DUKURS
###ࡱ |########|#####|### #| 0.00000 |0.00000 |
##29 |00000000| | | 0.00000 |0.00000 |
o#d# |00000000| | | 0.00000 |0.00000 |
The code that I am writing is as follows:-
*& INTERNAL TABLES
DATA : BEGIN OF T_INPUT occurs 0,
KURST LIKE TCURV-KURST, " Exchange rate type
GDATU LIKE SY-DATUM, " Date from which rate is effective
FCURR LIKE TCURC-WAERS, " From currency
TCURR LIKE TCURC-WAERS, " To currency
INUKURS LIKE TCURR-UKURS, " Indirect Quote
DUKURS LIKE TCURR-UKURS, " Direct Quote
END OF T_INPUT.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Perform to upload the excel file.
PERFORM UPLOAD_EXCEL_FILE.
FORM UPLOAD_EXCEL_FILE .
DATA: L_FILENM TYPE STRING.
L_FILENM = P_FILENM.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILENM
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = T_INPUT
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.Hi SB,
pls change the data type declared for 'valid from date'
from
DATA : BEGIN OF T_INPUT occurs 0,
KURST LIKE TCURV-KURST, " Exchange rate type
<b>GDATU LIKE SY-DATUM,</b> " Date from which rate is effective
FCURR LIKE TCURC-WAERS, " From currency
TCURR LIKE TCURC-WAERS, " To currency
INUKURS LIKE TCURR-UKURS, " Indirect Quote
DUKURS LIKE TCURR-UKURS, " Direct Quote
END OF T_INPUT.
to
DATA : BEGIN OF T_INPUT occurs 0,
KURST LIKE TCURV-KURST, " Exchange rate type
GDATU(10) type c, " Date from which rate is effective
FCURR LIKE TCURC-WAERS, " From currency
TCURR LIKE TCURC-WAERS, " To currency
INUKURS LIKE TCURR-UKURS, " Indirect Quote
DUKURS LIKE TCURR-UKURS, " Direct Quote
END OF T_INPUT.
Cheers,
Vikram
Please reward for helpful replies!! -
Problem in GUI_UPLOAD function module
Hi Folks,
I am in the BI system where I have limited scope of upload function module, So I used GUI_UPLOAD as a upload function module.
I am uploading CSV file and which have amount field (with comma ',' ) as one of the column , So it is truncating the other columns while retrieving data into internal table and giving wrong data in columns.
Any other Function module, or tricks to upload file which have ',' in one of the column.
Thanks
PPHi,
Well in this case you will have to change the file format i.e. Instead of CSV make it tab delimited etc.
Else change the amount value by replacing comma(which woud be a tedious task).
There is no other alternative.
Best regards,
Prashant -
Problem using GUI_UPLOAD
Hi All,
I am using GUI_UPLOAD to upload data into app server.The flat file has multiple records with each record of lenght around 90 characters.But its reading only record with around 60 characters only.What could be wrong?
Thanks,
Rakesh.Hi,
see the below sample code there is one work area which is of charater type with 255 ..... wa_string(255) type c....use it similar way and work it out .
REPORT zuploadtab .
PARAMETERS: p_infile LIKE rlgrap-filename
OBLIGATORY DEFAULT '/usr/sap/'..
DATA: ld_file LIKE rlgrap-filename.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 like pa0002-VORNA,
name2 like pa0002-name2,
age type i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: begin of t_uploadtxt,
name1(10) type c,
name2(15) type c,
age(5) type c,
end of t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt.
*String value to data in initially.
DATA: wa_string(255) type c.
constants: con_tab TYPE x VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop.
Regards -
Problem with GUI_UPLOAD
Hey Folks,
I need to convert the excel data into inernal table
types : begin of ty_data,
matnr type matnr,
exbwr type exbwr,
text type c,
end of ty_data.
This is my excel file.
6249 10 prabhas
6249 56 Dude
6249 57 Rockstar
6249 80 Babu
6249 90 Bhaiyya
6249 250 Munna
6249 35 Rocky
6249 75 Hero
6249 789 Prankster
data : filename type string.
filename = p_file.
call function 'GUI_UPLOAD'
exporting
filename = filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = it_data
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.
when I m using this FM i m getting the error as Bad_DATA_FORMAT i have also checked the FM ALSM_EXCEL_INTERNAL_TABLE but both seems not to be working in my case. Can somebody tell me where its gong wrong.
Thanks
Rocktry to convert/save the excel file into tab delimited text file, and then try using GUI_UPLOAD
call function 'GUI_UPLOAD'
exporting
filename = filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X' "<---use this -
Hi,
I want to use GUI_UPLOAD to load an ASCII file with Czech Characters. I try to save my file in .txt format UTF-8. If i read the file with notepad then i have all my characters but when i load in SAP I lost some characters - Who have a solution - I'm in 4.6C - I put in SAPlogon page code 1404 and language CS .
DATA: BEGIN OF f1 OCCURS 0,
altkn(10) TYPE c,
bldat(10) TYPE c, "tt.mm.jj
rart(15) TYPE c,
insert michel
zuonr(18),
xblnr(20) TYPE c,
name1(40) TYPE c,
waers(5) TYPE c,
brutt(13) TYPE c,
fwbtr(13) TYPE c,
faedt(10) TYPE c,
zterm(4) TYPE c,
kunnr(10) TYPE c,
sgtxt(49) TYPE c, => i can find VANĚK
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = pcfil
FILETYPE = 'BIN'
has_field_separator = fsepa
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = 'UTF8'
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = 'X'
IMPORTING
filelength = rc
HEADER =
TABLES
data_tab = f1
EXCEPTIONS
file_open_error = 1
ThanksSame problem - To keep all the accents, i must save in UTF-8 and i have the same problem with gui_upload.I've just seen that my function GUI_UPLOAD in this system (4.6C) is not the same than in 4.7 - Only these parameters for export -
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
I don't have the possibility to choose the codepage. Perhaps it's the reason ? -
GUI_UPLOAD in Background jobs
Hi,
I have a requirement where in the a text file is received from an external application at the end of each day. This text file has to be picked up by the SAP system and SAP transaction MFBF has to be updated. The customer wants this entire process to be done without any user intervention. A background job needs to be scheduled at the end of the day. However the problem is GUI_UPLOAD cannot be used to pick up the text file, because of the Background job. Any suggestions are welcome.You cant use GUI UPLOAD or DOWNLOAD function in backgroun jıb.
U can use DATASETS
DATA:
dsn(20) VALUE '/usr/test.dat',
rec(80).
OPEN DATASET dsn.
IF sy-subrc = 0.
DO.
READ DATASET dsn INTO rec.
IF sy-subrc <> 0.
EXIT.
ELSE.
WRITE / rec.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET dsn.
ibrahim -
GUI_DOWNLOAD is giving # for other than english content
Hi Guys,
I am using GUI_DOWNLOAD FM for downloading internal table content. When my table has content other than english language, my downloaded file has only # symbols.
I getting code page number for the language using FM NLS_GET_FRONTEND_CP and passing to GUI_DOWNLOAD. Even standard ALV download also doing the same. Please sugest some solution for this.
I have to download to text file and excel file.
Thanks,
Vinod.Hi Sandra/Vijay,
Your inputs are really helpfull. Thank you so much for your response.
Problem is solved now by giving the code page as 4103 and marking the field write_BOM as X in GUI_DOWNLOAD FM.
You guys are are correct. I am in Unicode system and using SAP 4.7 version. Now it is working fine. But one more problem with GUI_UPLOAD.
I am using Office 2007. I have saved excel file in 2003 format. When i try to upload this file having Korian text/Russian text using the FM ALSM_EXCEL_TO_INTERNAL_TABLE last two rows are not coming properly. Tried with FM TEXT_CONVERT_XLS_TO_SAP also. Below is the code snippet.
REFRESH: li_xlstab[].
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = po_file
i_begin_col = lc_1
i_begin_row = lc_1
i_end_col = lc_4
i_end_row = 5 "lc_65536
TABLES
intern = li_xlstab
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
My excel has always 4 columns and unknown number of rows. For testing i gave 5 rows.
Here first 4 rows are uploaded correctly. When it comes to fifth row it is still recognising as 4th row.
Results of li_xlstab is like below.
ROW COL VALUE
0001|0001|KO |
0001|0002|I |
0001|0003|001 |
0001|0004|uACB0uACFC, uD3C9uAC00 |
0002|0001|KO |
0002|0002|I |
0002|0003|M01 |
0002|0004|uACB0uACFC, uD3C9uAC00 |
0003|0001|KO |
0003|0002|I |
0003|0003|M02 |
0003|0004|uACB0uACFC, uD3C9uAC00 |
0004|0001|KO |
0004|0002|I |
0004|0003|M03 |
0004|0004|uACB0uACFC, uD3C9uAC00##KO | "Here its going wrong
0004|0005|I |
0004|0006|M04 |
0004|0007|uACB0uACFC, uD3C9uAC00## |
After 4th row 4th column it should take 5th row 1st column. But it is taking as 4th row 5th column. Also in 4th row 4th column u can see some # symbols and KO after korian text. This value KO should be the 5rh row 1st column value.
When i run the same program in office 2003 machine with the same file it is working perfectly fine.
Hope u guys got the problem.
Thanks,
Vinod. -
Hi,
I'm facing a problem with GUI_UPLOAD in that it sometimes fails with return code 13 (ACCESS_DENIED).
. Here's the call I make:
CALL METHOD cl_gui_frontend_services=>gui_upload
Has anyone faced anything similar? Anyone know what the cause might be?Hi,
Check whether your SAP User-Id has read/write access to the path?
Check for any Firewalls that may be operational and denying access.
You can ask your BASIS Team or IT Network Admin Team to help you with access rights.
Regards, Pranav. -
GUI_UPLOAD - Problem in uploading xml file
Hi,
I have problem in uploading xml file into itab.
Here is the code
begin of GS_STRING,
STR(72) type C,
end of GS_STRING,
GT_STRING like standard table of GS_STRING,
call function 'GUI_UPLOAD'
EXPORTING
FILENAME = FILE_NAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = GT_STRING
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 I499(SY) with 'File upload failed'.
stop.
endif.
endif.
In debuggin mode, i can see the itab uploaded with xml payload. But in that same place, the hexadecimal format has double zeros 00 after each character.
XML message : <?xml
Correct Hexadecimal : 3C3F786D6C
Hexadecimal in itab : 3C003F0078006D006C00
This makes the resultant xml invalid.
can anyone help me to solve this?
Thanks,
Uma
Edited by: Uma Maheswari on May 30, 2008 4:15 PMwhat do you want to do with the uploaded XML?
i use the following
constants: line_size type i value 255.
data: begin of xml_tab occurs 0,
raw(line_size) type x,
end of xml_tab,
file type string,
size type i.
call function 'GUI_UPLOAD'
exporting
filename = filename
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
importing
filelength = size
tables
data_tab = xml_tab
exceptions
others = 1. -
GUI_UPLOAD PROBLEM Exception : bad file format
Hi All i am using GUI_UPLOAD FM to upload some data fromm excel file.
cade is as folloes :
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_v_file
filetype = 'DAT'
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 = it_data[]
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.
but data is not upladed and gives me the exception 8 : bad_data_format = 8
PLS HELP....
THANKS..I have a problem close to this .
I want to upload a file in SAP, I am using a recorded Script but I want to give the File and path directly in the script file. Is there anyone who can help me to change this line :
session.findById("wnd[0]/usr/tabsTAB_MAIN/tabpTSMAIN/ssubSCR_MAIN:SAPLCV110:0102/btnPB_FILE_BROWSER").press
Here is the complete recorded code for CV01N:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").resizeWorkingPane 92,24,false
session.findById("wnd[0]/tbar[0]/okcd").text = "cv01n"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtDRAW-DOKNR").text = "filename foe SAP-test1"
session.findById("wnd[0]/usr/ctxtDRAW-DOKAR").text = "mtx"
session.findById("wnd[0]/usr/ctxtDRAW-DOKAR").setFocus
session.findById("wnd[0]/usr/ctxtDRAW-DOKAR").caretPosition = 3
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/usr/tabsTAB_MAIN/tabpTSMAIN/ssubSCR_MAIN:SAPLCV110:0102/txtDRAT-DKTXT").text = "Description for file upload in SAP"
session.findById("wnd[0]/usr/tabsTAB_MAIN/tabpTSMAIN/ssubSCR_MAIN:SAPLCV110:0102/txtDRAT-DKTXT").caretPosition = 34
session.findById("wnd[0]/usr/tabsTAB_MAIN/tabpTSMAIN/ssubSCR_MAIN:SAPLCV110:0102/btnPB_FILE_BROWSER").press
session.findById("wnd[0]/tbar[0]/btn[11]").press
session.findById("wnd[0]/tbar[0]/btn[15]").press
Maybe you are looking for
-
I hope this is the right place to post this. If not, would someone tell me the best forum on which to post it? Some of my finished PDFs have boundary lines showing around--or sometimes even within--text boxes filled with color. The files were created
-
Not working Toshiba Virtual Store
Hi to all forum members Can someone tell me when the www.toshibavirtualstore.com will work again? Im wainting so long time. Can anyone answer to my question? BR tommy4911 Message was edited by: ADMIN
-
Good day. I have new installation of AIR-CT2504. I try to connect by console, but no response on terminal. (Use notebook+ USB -COM + console cable). When connect ethernet cable to 1st port of WLC and switch port(SF200) i see controller by CDP. At fir
-
Hi, I have 2 JOB scheduled on transaction SCOT (and SM37). This JOB are: NOTESCONNECTEXCH SAPCONNECTEXCH both are related to the program RSCONN01 I have noticed that every job is scheduled every 1 minute and every time this job run, create a log into
-
Apologies if this has been posted already (or is already possible) but for years now I've wanted to be able to rotate the Clone Stamp as lines in Photos are rarely straight. It would be so simple to just have another button press make a small rotatio