2010 Aug 20 11:12 AM
Hi,
I need to read a file and sent it with a proxy. The file is on hte server
I therefore need to get the file content as an XString. I'm unable to make any code work for tatk.
Daniel
Edited by: Daniel Graversen on Aug 20, 2010 12:12 PM
2010 Aug 20 1:54 PM
Hi Daniel,
I'm not sure what requirement you exactly have, but would CL_FILE_SYSTEM_MANAGER->LOAD_FILE, followed by some string-to-xstring conversion (e.g. by function module SCMS_STRING_TO_XSTRING) help?
Cheers, Fred
2010 Aug 20 1:54 PM
Hi Daniel,
I'm not sure what requirement you exactly have, but would CL_FILE_SYSTEM_MANAGER->LOAD_FILE, followed by some string-to-xstring conversion (e.g. by function module SCMS_STRING_TO_XSTRING) help?
Cheers, Fred
2010 Aug 20 1:56 PM
I did solve it by
DATA: begin of itab occurs 0,
text(100) type c,
end of itab.
" read the files
OPEN DATASET HEADERFILENAME FOR input in text MODE ENCODING default.
DO.
READ DATASET HEADERFILENAME INTO itab.
IF SY-SUBRC <> 0.
EXIT.
else.
append itab.
clear itab.
ENDIF.
ENDDO.
CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
IMPORTING
BUFFER = attach_xstring
TABLES
TEXT_TAB = itab
.
2010 Aug 20 2:10 PM
Alternatively you can read the file as byte stream
OPEN DATASET HEADERFILENAME FOR input in BINARY MODE.
"then use FM
SCMS_BINARY_TO_XSTRING
This way you avoid conversion to text while reading the file.
Regards
Marcin
2010 Aug 20 2:37 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |