Posted: Wed Dec 12, 2007 4:48 pm Post subject: запись переменной в файл
Подскажите плиз, как записать переменную в файл? Именно просто одну переменную, а не таблицу? Файл при этом нада создать.
Заранее благодарен. _________________ Приятно когда программа из стадии "Блин, она не компилится!" переходит в стадию "Блин, она не работает!"
IF I_GUI IS INITIAL.
IF I_MODE IS INITIAL.
OPEN DATASET I_FILENAME FOR OUTPUT IN TEXT MODE.
ELSE.
OPEN DATASET I_FILENAME FOR APPENDING IN TEXT MODE.
ENDIF.
IF NOT sy-subrc IS INITIAL.
RAISE sy-subrc.
ENDIF.
LOOP AT T_DEBUG.
TRANSFER T_debug TO I_FILENAME.
ENDLOOP.
CLOSE DATASET I_FILENAME.
ELSE.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = I_FILENAME
FILETYPE = 'DAT'
MODE = I_MODE
TABLES
DATA_TAB = T_DEBUG
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
.
IF NOT sy-subrc IS INITIAL.
RAISE sy-subrc.
ENDIF.
ENDIF.
ENDFUNCTION.
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.