11-09-2008 11:09 AM
I am trying to use the function "GUI_UPLOAD" to uplad atext file with delimiter as semicolon.But i do not see exporting parameter in this function "has_delimiter" where i can mention semicolon for my file uplaod purpose .What could be the reason ,the FM defintiona which i get is like
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = ' '
FILETYPE = 'ASC'
IMPORTING
FILELENGTH =
TABLES
data_tab =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please suggest if there is any other FM to uplaod the text file with delimiter .
Thanks ,
Swati
11-09-2008 7:56 PM
in basis 6.20, there is parameter HAS_FIELD_SEPARATOR. You are probably using an older sap release. Thus you probably have to program it yourself (you will then use SPLIT ... AT ',' INTO TABLE internal_table abap statement for each line)
11-10-2008 1:48 AM
Hi,
I have tried the FM: GUI_UPLOAD, it has the separator.
The following is for your reference.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '*
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 =
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.
I think you can put semicolon at HAS_FIELD_SEPARATOR = ' ; '.
Please try.
Regards,
Chris Gu
Edited by: Gu Chris on Nov 10, 2008 2:50 AM
11-10-2008 4:18 AM
11-10-2008 4:58 AM
11-10-2008 5:09 AM
Hi ,
Try this FM.
CALL METHOD cl_gui_frontend_services=>gui_upload
Regards
Abhi.
Please clsoe this thread as soon as your problem is solved.
11-10-2008 10:24 AM
Hi Swati,
using HAS_FIELD_SEPARATOR with a semicolon ';' is not working.
Either you have to mention the records according to the space delimited i.e., if you have
a variable with 10 char and you have a value say 'ABC', then you should type
'ABC ' (value followed by remaining spaces to fill the total length)
or probably you can use 'lsmw' tool to sove your problem.
Thanks & Regards.
Tarun Gambhir.