I am trying to download a file from the application server to my presentation server. I have a small program and to do this it uses the read dataset and then calls the function module GUI_DOWNLOAD. The problem is the trailing blanks on a line are truncated and I want to keep the file exactly intact as it was on the application server. Is there a good way to prevent this?
You could download it as a BIN file, but this means putting in the hexadecimal characters for LF and CR at the end of each record, which isn't ideal. A second possibility is as follows: If you have: DATA ITAB(80) OCCURS 0 WITH HEADER LINE. APPEND 'ABCDE' TO ITAB. Do a GUI_DOWNLOAD with ITAB, and you get the truncation of spaces problem. If you define it like this: DATA: BEGIN OF ITAB OCCURS 0, DATA(80), JUNK(1), END OF ITAB. ITAB-DATA = 'ABCDE'. APPEND ITAB. Do a GUI_DOWNLOAD with this ITAB, with the DATA field populated and the JUNK field always empty, and you'll get a file of record width 80.
Dig Deeper on SAP security
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header. Continue Reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order. Continue Reading
A SearchSAP.com reader wants to know if it's possible to write an SAP ABAP program that will read source code and then create an SAP ABAP function ... Continue Reading