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

external files

Former Member
0 Likes
432

hai,

in gui_upload function module ,field separator has '#' used for tab space between records in flatfile. i need to know where they declared tab= '#' and what are the other way to give field separator.

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
408

Hi Muthu Raman,

Try this alternative.

First make entries into an excel file(without header line) and then save it as TEXT DELIMITED file type.

This will result in a text file with fields separated by tabs and records in different lines.

Make sure that you have the same order of field entries in flat file as in the internal table.

You can now use this code for uploading data from a flat file into the internal table and use as per your requirements.


TYPES : BEGIN OF VENDOR,
        LIFNR LIKE RF02K-LIFNR,
        BUKRS LIKE RF02K-BUKRS,
        EKORG LIKE RF02K-EKORG,
        KTOKK LIKE RF02K-KTOKK,
        ANRED LIKE LFA1-ANRED,
        NAME1 LIKE LFA1-NAME1,
        SORTL LIKE LFA1-SORTL,
        LAND1 LIKE LFA1-LAND1,
        SPRAS LIKE LFA1-SPRAS,
        WAERS LIKE LFM1-WAERS,
        END OF VENDOR.
 
DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 10 WITH HEADER LINE.
 
START-OF-SELECTION.
  CALL FUNCTION 'GUI_UPLOAD' "uploads the internal table from flat file
    EXPORTING
      FILENAME                     = 'c:\vendors.txt'
      FILETYPE                      = 'DAT'
    TABLES
      DATA_TAB                      = VENDOR_TAB "internal table
 

This will populate the flat file records into the internal table.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

2 REPLIES 2
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
409

Hi Muthu Raman,

Try this alternative.

First make entries into an excel file(without header line) and then save it as TEXT DELIMITED file type.

This will result in a text file with fields separated by tabs and records in different lines.

Make sure that you have the same order of field entries in flat file as in the internal table.

You can now use this code for uploading data from a flat file into the internal table and use as per your requirements.


TYPES : BEGIN OF VENDOR,
        LIFNR LIKE RF02K-LIFNR,
        BUKRS LIKE RF02K-BUKRS,
        EKORG LIKE RF02K-EKORG,
        KTOKK LIKE RF02K-KTOKK,
        ANRED LIKE LFA1-ANRED,
        NAME1 LIKE LFA1-NAME1,
        SORTL LIKE LFA1-SORTL,
        LAND1 LIKE LFA1-LAND1,
        SPRAS LIKE LFA1-SPRAS,
        WAERS LIKE LFM1-WAERS,
        END OF VENDOR.
 
DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 10 WITH HEADER LINE.
 
START-OF-SELECTION.
  CALL FUNCTION 'GUI_UPLOAD' "uploads the internal table from flat file
    EXPORTING
      FILENAME                     = 'c:\vendors.txt'
      FILETYPE                      = 'DAT'
    TABLES
      DATA_TAB                      = VENDOR_TAB "internal table
 

This will populate the flat file records into the internal table.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
408

hi,

can i know your problem clearly.