‎2009 Apr 16 5:19 PM
I'm trying to move a file from the PC to the app server. It is a binary file.
This code and file look ok, but the file is not correct.
Is there any function or other technique to move the file? I'm afraid gui_upload may be doing some kind of conversion.
DATA: BEGIN OF itab OCCURS 0,
raw(255) TYPE x,
END OF itab.
DATA: lin TYPE i.
DATA: l_filename TYPE string.
DATA: l_filelen TYPE i.
l_filename = 'c:\temp\file.bin'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_filelen
TABLES
data_tab = itab.
l_target = '/dir/outputfile.bin'.
OPEN DATASET l_target FOR OUTPUT IN BINARY MODE.
DATA: l_pos TYPE i.
LOOP AT itab.
CLEAR lin.
lin = XSTRLEN( itab-raw ).
l_pos = l_pos + lin.
IF l_pos > l_filelen.
lin = lin - ( l_pos - l_filelen ).
ENDIF.
TRANSFER itab-raw TO l_target LENGTH lin.
ENDLOOP.
CLOSE DATASET l_target.
‎2009 Apr 16 5:22 PM
Try to use transaction CG3Z
Want to use same in your program then use fm C13Z_FRONT_END_TO_APPL
a®
‎2009 Apr 16 5:22 PM
Try to use transaction CG3Z
Want to use same in your program then use fm C13Z_FRONT_END_TO_APPL
a®
‎2009 Apr 16 5:23 PM
‎2009 Apr 16 5:46 PM
Hi ,
Did u tried giving the filetype as 'ASC'.
Give a try with this.
If that doesn't work then u have the option of CG3Z tcode.
‎2009 Apr 16 7:50 PM
It's a binary file. ASC won't work.
Thanks for the feedback the transaction and function module.
Actually I used function C13Z_FILE_UPLOAD_BINARY.
I think my code was good. This function has the same result.
For some reason the follow on processing was acting differently on this "copied" file. It looks the same and has the exact same byte count as the original.
I was able to work around my other issues.
Thanks again.