Application Development and Automation 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: 
Read only

File upload

rohit_kaikala
Participant
0 Likes
588

Hi All,

I want to upload a file which have some special character as separator like | (pipe symbol).

where can i mention that it is some symbol not tab separator.

Do we have any funtion module for that.

Regards,

Rohith.

5 REPLIES 5
Read only

Former Member
0 Likes
571

Hi Rohit,

Give some more details like

1. what type of file, text, excel or binary etc.

2. Also if the file needs a separator which character you are supposed to use. (eg excel files use tab as separator).

Regards

Barada

Read only

Former Member
0 Likes
571

hi,

In FM GUI_UPLOAD you have the parameter HAS_FIELD_SEPARATOR for separator.

Read only

Former Member
0 Likes
571

Hi

You can use GUI_UPLOAD, in that keep the Field Seperator commented:

CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = V_FNAME
         FILETYPE                      = 'ASC'
*       HAS_FIELD_SEPARATOR           = 'X'
*     HEADER_LENGTH                 = 0
         READ_BY_LINE                  = 'X'
*     DAT_MODE                      = ' '
*    IMPORTING
*     FILELENGTH                    =
*     HEADER                        =
        TABLES
          DATA_TAB                      = I_DATA_RED
*   EXCEPTIONS
*     FILE_OPEN_ERROR               = 1
*     FILE_READ_ERROR               = 2
*     NO_BATCH                      = 3
*     GUI_REFUSE_FILETRANSFER       = 4
*     INVALID_TYPE                  = 5
*     NO_AUTHORITY                  = 6
*     UNKNOWN_ERROR                 = 
*     BAD_

SPLIT I_DATA_RED-LINE AT P_FSEPA INTO "here in P_fsepa give the symbol u have in flat file.
                                I_VEND-LIFNR
                                I_VEND-BUKRS
                                I_VEND-EKORG
                                I_VEND-KTOKK
                                I_VEND-ANRED
                                I_VEND-NAME1
                                I_VEND-LAND1
                                I_VEND-AKONT
                                I_VEND-WAERS.

Vishwa.

Read only

former_member632458
Participant
0 Likes
571

Hi ,

in this case u must specify the has_field _separator as 'X'.. then split.

Read only

rohit_kaikala
Participant
0 Likes
571

Problem got solved