Problem solve Get help with specific problems with your technologies, process and projects.

Downloading a file from the application server to the presentation server

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