Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Download PDF Version of Sales Document.

Former Member
0 Kudos
614

Hi Guru's

I want to open up an discussion regarding ability to Downlaod PDF version of Documents in Sap.

we are using RFC interface to create Sales Document and that user is defined as "Communication " User in Sap.

So as per Sap in order to Download we need a connection to presentation server and since these are the background users so download will not work with this type of user and also scheduling a Job will also not work (Sap Note 7925)

Now my question is

Is it possible to submit Program to Sap Dialog work process(please note NOT BACKGROUND) to use some other user to run it.

LIke SUBMIT ZPREP1

USER ABC

but the user who is submitting is XYZ

I had tried but it is using the current user who is submitting the Job. Am i missing something?

Please give your valuable suggestions

Regards

Lakhbir

6 REPLIES 6

vyende
Active Participant
0 Kudos
231

how do you download? I am using the TRANSFER statement to "download" my PDF documents to a server. This works well even if the program id called via an RFC.

Former Member
0 Kudos
231

Hi I am using

WS_DOWNLOAD FM to dowmload to File System. But TRANSFER is ueful only incase of READ DATASET .. used for Table

I am creating Spool request and then converting Spool to PDF and using Download FM to downlaod to file system.

Thanks

Lakhbir

Message was edited by: Lakhbir Singh

0 Kudos
231

I am doing a similar thing. Convert to PDF using CONVERT_OTFSPOOLJOB_2_PDF and the do the loop and TRANSFER.

The problem with WS_DOWNLOAD is that is call FM WS_QUERY (Execute query function on presentation server) and there is NO presentation server available for a non-dialogue user.

NO, you do NOT need READ DATASET to use the TRANSFER statement.

after converting to PDF 1) open dataset <your filename> for output. 2). Loop at <your pdf table>. transfer <your pdf file> to <your filename>.

0 Kudos
231

Hi Yende,

you were right, we can download using Read dataset for Output and then transfer pdf table to the file.

it works perfectly in Background mode also.

Thanks alot for your help . will give you the point.

Former Member
0 Kudos
231

Bottom line is background processes are not run in the presentation server. They are always executed in the application server and so you can access directories only there. Having said that, a round about way to achieve it could be to initially download it to the application server and then ftp it to the desktop of the user. I am assuming that since you are doing an rfc, you are doing it from a remote application which happens to know the desktop. So that remote application has to make a call to the rfc which creates the file in the application server. Depending on the success of this call, the remote application will then logon to the application server and ftp the file to the desktop. This ftp step is outside of the SAP world.

Another solution is to have you network gurus mount the windows network onto the unix network. I have seen this done in a couple of places. What they do(I don't know how) is they will have the same directory be visible as a directory in the application server as well as the desktop's network location. This they call mounting. This way your SAP world will treat it as an application server directory so you can run it in the background and then your users access the same file as if it is in the windows network.

Regards,

Srinivas

0 Kudos
231

The concept is fairly simple.

<b>Background jobs cannot download data in presentation server.</b>

To download your data whether its script, smartform or anything, first download in application server through a batch job.

Afterwards, ask your BASIS team to write a script which will pick the data from application server and download to presentation server.

Hope this helps you.

Regards,

Tarun