cancel
Showing results for 
Search instead for 
Did you mean: 

Save pdf file in background without gui_download

TimoRenz
Participant
0 Kudos

Hi,

we are generating a adobe interactive pdf document in background.

Now we want to save the pdf document in backgroud task.

I have read that i cannot use cl_gui_frontend_services=>gui_download because there is no presentation server available but although the report RSTXPDFT2 does not working correctly caused by missing a sapscript document.

Is there no possibility to save the document on the local pc?

Thanks!

Timo

Accepted Solutions (0)

Answers (2)

Answers (2)

OttoGold
Active Contributor
0 Kudos

Glad it works. Otto

TimoRenz
Participant
0 Kudos

Now i can save the pdf file on the server with OPEN DATASET ...

If i transfer the document and open this codument in adobe reader i get the error code 110.

The coding to transfer:

OPEN DATASET '/usr/temp.pdf' FOR OUTPUT IN BINARY MODE.

LOOP AT l_tab INTO wa_tab.

TRANSFER wa_tab TO '/usr/temp.pdf' LENGTH l_len.

ENDLOOP.

CLOSE DATASET '/usr/temp.pdf'.

Does anybody have any suggestions? I tried it without the length but this doesn`t work.

Thanks.

OttoGold
Active Contributor
0 Kudos

Check the size of the form if you save it on a local PC and compare it with the size of the file saved to the server. This should give you a clue. Otto

TimoRenz
Participant
0 Kudos

Yes the size on te server and on the pc is different.

On the server: 19387068

On my pc: 19388103

Why is the file on my pc bigger than on the server???

I use the following method to get the table and the length.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

EXPORTING

buffer = FORMOUTPUT-pdf

IMPORTING

output_length = l_len

TABLES

binary_tab = l_tab.

TimoRenz
Participant
0 Kudos

Now it works.

I only have to delete the length in the line of transfer and transfer the file from the server in binary mode.

So i can save the pdf-document in background and transfer it later to the local pc.

Thanks four your advice.

Timo