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

Transfering 0 byte file

prasad_reddy9
Explorer
0 Likes
372

I need to transfer a 0 byte file.

for that I am using the following code.

<b><i>begin of i_zero occurs 0,

dummy,

end of i_zero,

move '' to i_zero-dummy.

append i_zero.

open dataset v_file for output in binary mode.

if sy-subrc eq 0.

loop at i_zero.

transfer i_zero-dummy to v_file.

endloop.

close dataset v_file.</i></b>

but the above code is giving me a 1 byte size file. is there anyway around this to be able to transfer a 0 byte file?

I need to transfer a 0 byte file.

for that I am using the following code.

<b><i>begin of i_zero occurs 0,

dummy,

end of i_zero,

move '' to i_zero-dummy.

append i_zero.

open dataset v_file for output in binary mode.

if sy-subrc eq 0.

loop at i_zero.

transfer i_zero-dummy to v_file.

endloop.

close dataset v_file.</i></b>

but the above code is giving me a 1 byte size file. is there anyway around this to be able to transfer a 0 byte file?

1 REPLY 1
Read only

varma_narayana
Active Contributor
0 Likes
342

Hi Prasad..

If u want to Get a 0 byte file, then Don't use the Transfer At all.

Just use OPEN Dataset .. and CLOSE Dataset.

Eg:

open dataset v_file for output in binary mode.

if sy-subrc eq 0.

close dataset v_file.

Endif.

Now check the size of the File.

Reward if Helpful.