SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Создание файла нулевой длины



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
z01
Специалист
Специалист



Joined: 18 Jan 2008
Posts: 59

PostPosted: Wed Feb 27, 2008 10:39 am    Post subject: Создание файла нулевой длины Reply with quote

Мне нужно создать файл нулевой длины. Почему этот код создает файл длиной 1 байт?

Code:
begin of t occurs 0,
 empty,
end of t.
move '' to t-empty.
append t.

open dataset filename for output in binary mode.
check sy-subrc eq 0.
loop at t.
 transfer t-empty to filename.
endloop.
close dataset filename.
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 170
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Wed Feb 27, 2008 12:27 pm    Post subject: Reply with quote

Понимаете, если Вы определили переменную
DATA: empty, ее размер все равно будет равен 1 байту, даже если Вы присволили ''.
Поэтому, наверно, будет достаточно написать так:

Code:
open dataset filename for output in binary mode.
check sy-subrc eq 0.
close dataset filename. 
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.