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: 

Retrieving pdf file from spool list

Former Member
0 Kudos

Is there a function or a method that will retrieve a spool request that is already of type PDF (tsp01-rqdoctype=ADSP) into an internal table for further manipulation?

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Try with function module FPCOMP_CREATE_PDF_FROM_SPOOL

14 REPLIES 14

former_member194669
Active Contributor
0 Kudos

Try with function module FPCOMP_CREATE_PDF_FROM_SPOOL

0 Kudos

That does look promising. But when I get down in the function FPCOMP_CREATE_PDF_FROM_SPOOL which calls function ADS_SR_READ_CONTENT, down to the statement "open dataset pathname for input in binary mode", it does not find a cfg file to open. I thought maybe I had the wrong part number, but I don't think that's the case. Any ideas?

0 Kudos

The fm FPCOMP_CREATE_PDF_FROM_SPOOL working okay for me , its get the spool pdf and write to url server

Pl. check whether you are giving proper part number

If you want only to read PDF spool then use fm ADS_SR_READ_CONTENT

0 Kudos

Do you know what I would use for the input parameter PARTFILENAME for function ADS_SR_READ_CONTENT?

0 Kudos

I can see the file on our server. IT is a permission thing -- I don't have permission to open it. But this looks like a good direction. Thank you very much.

I am a little confused as the part number for my spool in TSP01 says 0000, but on the file itself, it is 0001. Do you have any insight there?

0 Kudos

I can use function FPCOMP_CREATE_PDF_FROM_SPOOL to retrieve a pdf file from a spool list. But if I enter i_partnum = 1, I get the first page. I_partnum = 2 gives me the second page. How do I get all pages? I am getting my file returned using the e_pdf parameter type XSTRING, and I cannot do a CONCATENATE succesfully with it.

0 Kudos

I can use function FPCOMP_CREATE_PDF_FROM_SPOOL to retrieve a pdf file from a spool list. But if I enter i_partnum = 1, I get the first page. I_partnum = 2 gives me the second page. How do I get all pages? I am getting my file returned using the e_pdf parameter type XSTRING, and I cannot do a CONCATENATE succesfully with it.

Former Member
0 Kudos

hii janice,

go throgh the following link.

regards,

Shweta

0 Kudos

Shweta

I have quickly gone through the links you suggested and will go through them more carefully later. At first glance I'm thinking the first one won't work, writing to memory, because the spool is created by an SAP-delivered program and I won't want to modify it. And at first glance I'm thinking the second link may not apply because the spool is already of type pdf. But I am going to spend some time reading them more carefully. I could be wrong.

Former Member
0 Kudos

This message was moderated.

0 Kudos

Shobhika

I asked this question 4 years ago!  Not sure how much I remember, but we are successfully using this method.  I call function FPCOMP_CREATE_PDF_FROM_SPOOL with i_partnum = '1'.  It returns e_pdf of type xstring.  I create a file and folder name in string lv_file1.  Then I just do:

    OPEN DATASET lv_file1 FOR OUTPUT IN BINARY MODE.

    TRANSFER e_pdf TO lv_file1.

    CLOSE DATASET lv_file1.

Then I am able to open and view the file from another application.  Hope this helps.

Regards

Janice

0 Kudos

thank you janice.

My issue was that the file was not opening for input inside standard FM. The issue is resolved. it was basis issue

Former Member
0 Kudos

Hi Janice,

can you tell me the significance of partnum in FM FPCOMP_CREATE_PDF_FROM_SPOOL . i'm using 1 then only first page is being displayed on  the url.while the spool has 4 pages.

really appreciate your help.

Thanks,

Shobhika

0 Kudos

Shobhika

I am sorry, but no, I really can't.  Three years ago we wrote our own application for online W-2s.  Most of our W-2s have only one page, so we send partnum = 1.  In case they have a second page, we send partnum = 2.  And that works.  But at the time we wrote it, nothing beyond that appeared to work correctly.  Partnum = 3 did not bring back a third page.  Since we had no one with more than 2 pages for a W-2 except in testing, we did not pursue this further. 

If someone else has a solution, I would love to learn about it.

Janice