Application Development 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: 

FM to tansfer data in flat file from presentation to application server

payalseth
Participant
0 Kudos

Hi Experts,

Please tell the FM to tansfer data in flat file from presentation server to application server or vice versa in ECC 6.0.

Thanks.

5 REPLIES 5

Former Member
0 Kudos

Hi Palak Priya,

Use these Tcodes,

CG3Y - Transfer or Download any files from Application server to Presentation server.

CG3Z - Transfer or Upload any files to Application server from Presentation server.

Pls reward if useful,

Thanks,

Murugan.B

Former Member
0 Kudos

Use OPEN DATA SET commands

Former Member
0 Kudos

Hi,

The Fm is FILE_READ_AND_CONVERT_SAP_DATA

For more details check the below link

[;

Regards,

Surinder

Former Member
0 Kudos

Hi,

This is how you can achieve it:

1. You read the flat file from presentation layer and store the file content in internal table gt_inrec

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = gw_filename

filetype = 'ASC'

IMPORTING

filelength = gw_length

header = gw_header

TABLES

data_tab = gt_inrec

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.

2. Create a new file at the application server:

OPEN DATASET p_ofile FOR OUTPUT IN

TEXT MODE ENCODING DEFAULT.

3. Transfer the content from the internal table into the file at the application server:

LOOP AT gt_inrec.

TRANSFER gt_inrec-record TO p_ofile.

ENDLOOP.

Hope it helps,

Lim....

Former Member
0 Kudos

Hi Priya,

You have to use gui_upload and open dataset statements.

Regards,

Charumathi.B