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

How to create a flat file.

Former Member
0 Likes
1,367

hi,

How to create a file file in which i wanted it to upload through BDC?

Provided with an example is appreciated.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
770

dear Raj,

it depends on which FM you are Using,

if you are using GUI_UPLOAD ,

with has_field_separator = 'X'.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = wf_file

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

  • 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

in this case flat file will be text file with tab delimited space..

record1<tab>record1

record2<tab>record2

otherwise you can use FM which directly uploads a Excel file,

Regards,

Talwinder

hi,

How to create a file file in which i wanted it to upload through BDC?

Provided with an example is appreciated.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
770

HI ,

in BDC as per my knowledge two types of flat files u can use

1. Notepad

2. Excel file ..

so there u can use tab delimiter or spaces as per u r requirement .

if u want how to create this files to give reply

THX

Read only

0 Likes
770

i am not aware of how to create a flat file (note pad) exatly,could u provide me an example .

Read only

0 Likes
770

HI Rajkamal,

it's not a big issue,

for Notepad,

Goto Start Menu in that

Goto Accessories there u can find Notepad

Then Give u r data and save from file options where ever u want.

for Excel ,

FOr excel file u r system has to be installed Office.

so for Excel

Go to Start Menu

Goto Microsoft Office

There u can Find Microsoft Excel ...

kkk

THx

Read only

Former Member
0 Likes
771

dear Raj,

it depends on which FM you are Using,

if you are using GUI_UPLOAD ,

with has_field_separator = 'X'.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = wf_file

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

  • 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

in this case flat file will be text file with tab delimited space..

record1<tab>record1

record2<tab>record2

otherwise you can use FM which directly uploads a Excel file,

Regards,

Talwinder