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

FLAT FILE DOUBT

Former Member
0 Likes
439

HAI

YSUSTAB1 IS MY DDIC-TABLE.

IN THIS TABLE

NAME IS A *FIELD NAME * ,CHARACTER TYPE ,LENGTH 20

ROLLNO FIELD NAME, INTEGER TYPE, LENGTH 10

ARE THE FIELDS .

I HAVE TO CREATE THE FLAT FILE. .PLZ TELL HOW TO CREATE FLAT FILE.

AND WHAT ARE THE PARAMETERS MANDATORY IN THE GUI_UPLOAD FUNCTION.

AND PLZ GIVE THE SIMPLE PROGRAM FOR MY PRESCRIPTION WITH FLAT FILE.

REGARDS

SURENDER

3 REPLIES 3
Read only

Former Member
0 Likes
415

Just search the forum you have lots of sample program for GUI_UPLOAD.

Regards,

Atish

Read only

former_member188594
Active Participant
0 Likes
415

Hi,

You can create a flat file of your own with the fields separated by tab/comma/space delimiters. You can even prepare a flat file in a excel sheet.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = FILE_NAME

FILETYPE = 'ASC'

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 = I_XK01

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.

In this function module

EXPORTING

FILENAME,

FILETYPE,

HAS_FIELD_SEPARATOR,

TABLES

DATA_TAB

these values have to be provided ie mandatory. Exceptions, depending on your requirement you can make use of the available exceptions.

Reward points if useful.

Regards,

chandrasekhar

Read only

Former Member
0 Likes
415

hi,

The flat file can be created with tab space or comma..The field name should be the first row.

example:

NAME ROLLNO

xxx 1

yyy 2

example of gui_upload:

call function 'GUI_UPLOAD'

exporting

filename = 'C:\Documents and Settings\aru15379\Desktop\arunsri.txt'

filetype = 'ASC'

tables

data_tab = wi_upp.

wi_upp is the internal table similar to ur database table.

for file name u need to give the path of the flatfile which is in ur PC.

Hope this helps u,

Regards,

Arunsri