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

placing file in the given path.

Former Member
0 Likes
871

hi,

I have one doubt on data transferring.

I have got the path where i have to place the text file.

I have written the coding OPEN dataset and transfer data set.

But the file is not not replacing in the path.

But i have tried to retrieve data from that path again by using open dataset and read dataset.

I am getting exact data what ever i am sending data as text file.But only the thing is that file is not replacing in that path.

Why it is not placing the file when i am sending?

if any one knows the solution pls guide me.

This is urgent requirement.I need help.

Regards,

lokesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
850

Hi,

Try tocdes CG3Z or CG3y for ur requiremetns there is one option to overwrite u can use call transaction with SET parameter id.

Jogdand M B

7 REPLIES 7
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
850

Hi

<b>Using CG3Y/CG3Z Tcodes.</b>

Regards,

Sreeram

Read only

dev_parbutteea
Active Contributor
0 Likes
850

Hi,

did you close dataset?

Read only

0 Likes
850

Hi,

yes i have written the close dataset also.

when ever i am transferring it is going i think so.

why i am saying like this means again i am reading that file means from that file data is reading.

But only the thing is that file is not placing in that path.

Regards,

lokesh.

Read only

0 Likes
850

Look at this sample and compare

*Open file

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT gt_file INTO gs_file.

TRANSFER gs_file TO p_file.

ENDLOOP.

CLOSE DATASET p_file.

Read only

Former Member
0 Likes
850

Are you using OPEN DATA dsn FOR OUTPUT?

Read only

Former Member
0 Likes
851

Hi,

Try tocdes CG3Z or CG3y for ur requiremetns there is one option to overwrite u can use call transaction with SET parameter id.

Jogdand M B

Read only

dev_parbutteea
Active Contributor
0 Likes
850

Else try this fm

p_file_tmp TYPE string.

p_file_tmp = p_file. " generates type error if p_file used

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = p_file_tmp

  • FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = gt_file

  • FIELDNAMES =

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.