‎2008 Feb 08 2:26 PM
Hello friends,
I have data in the text file and when I use this FM it says bad format data.
DATA: BEGIN OF i_stru_tab OCCURS 0,
pernr LIKE p0001-pernr,
prozt LIKE p1001-prozt,
otype LIKE p1001-otype,
plans LIKE p1001-objid,
orgeh LIKE p1001-objid,
kostl LIKE p0001-kostl,
stell LIKE p1001-objid,
begda LIKE p1001-begda,
endda LIKE p1001-endda,
END OF i_stru_tab.
PARAMETERS: ps_file4 LIKE rlgrap-filename DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE,
PERFORM upload_local_file4.
FORM upload_local_file4 .
DATA: p_file14 TYPE string.
p_file14 = ps_file4.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file14
filetype = 'ASC'
TABLES
data_tab = i_stru_tab
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.
When I execute the code I see data only for the first field of the first row and all the fields are 0.00 and i dont see any records from second row onwards.
Below is the data in the text file.
25310000100.00S 5000001300000000 500000112001083199991231
25312951100.00S 5000001300000000 500000112003080199991231
25313427100.00S 5000001300000000 500000112003060199991231
Thanks,
Raju.
‎2008 Feb 08 2:27 PM
‎2008 Feb 08 2:27 PM
‎2008 Feb 08 2:32 PM
Can you please let me know more in detail.
This is afile that is downloaded by another program.
Can I change that program that downloads to download as what would be necessary for this file.
Thanks again,
Raju.
‎2008 Feb 08 2:36 PM
Raju, if that program uses gui_download to create the file, add the export WRITE_FIELD_SEPARATOR = 'X' this will automatically separate each field with tabulations, so you only need to add the export has_field_separator = 'X' in your call to gui_upload
‎2008 Feb 08 2:48 PM
‎2008 Feb 08 2:28 PM
use option has_field_separator = 'X'
and separate the fields with tabulations in the text file.
How did you got that file?
You made it with gui_download or are you getting it from an independent source?
Edited by: Ramiro Escamilla on Feb 8, 2008 3:30 PM