cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulation of Print form after generation

Former Member
0 Kudos

I am using Adobe Forms as print forms within the SAP ERP 5.0 without WebDynpro.

I have requirement that I need to manipulate the generated PDF file by adding additional attachment files to the PDF generated by the function module. Technically this seems to be possible by combining the different APIs as follows:

1. Setting the output parameter GETPDF to 'X' while calling FP_JOB_OPEN and

2. Getting the binary file from the /1BCDWB/FORMOUTPUT object

3. Then setting the binary to the IF_FP_PDF_OBJECT object via the SET_DOCUMENT method

4. Adding the additional attachments via SET_ATTACHMENTS method.

Is there smarter way to do this so that the attachment could be already added via the function modules?

Is there any linkage between the function modules FP_* used for print forms and the classes IF_FP_PDF_OBJECT that provide the ADS services?

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

If you ask me what to do, you have only one option - upgrade. Maybe you can try to use some other PDF tool (check the internet) - write some service that would call some external PDF tool to merge/ attach files and then load that back into SAP. Similar approach needs to be used if you would like to "merge" multiple PDF files into one. Please check this thread: for inspiration. Hope this helps you a step further, Otto

Answers (4)

Answers (4)

OttoGold
Active Contributor
0 Kudos

hello again, if you´re content with the result, please close the thread, regards Otto

OttoGold
Active Contributor
0 Kudos

Have you found any solution? Sharing with the others would be great. Otto

Former Member
0 Kudos

I found a workaround.

We also have some ERP 6.0 systems in the landscape which are running Basis 7.0. We can handle the PDF manipulation and the attachments in this newer system and then return the resulting PDF document with attachments to the original system via remote-enabled function module.

Not beautiful, but works.

OttoGold
Active Contributor
0 Kudos

Hello,

maybe it is because there is some special feature hidden in your approach, but I am not aware of any other way but the FP_TEST report as mentioned above. Maybe you can get access to the report source text in some other system or we can send you the source in a word file or something.

In case I am wrong and there is some other (at least a bit elegant) way, it would definitely be useful to get the detailed description of the solution.

BTW: why do you need to do that? Maybe there is some other process and not technical way how to achieve the wanted result. Regards, Otto

Former Member
0 Kudos

It seems that SAP has not even implemented the method IF_FP_PDF_OBJECT~SET_ATTACHMENTS in WebAS 6.40. It simply throws exception without doing anything.

So it seems that the whole scenario is not even possible in NetWeaver 2004/Basis 6.40.

On the question on why:

In our scenario we need to attach additional PDF files (generated in external systems or scanned paper documents) to the print form produced by SAP. It seemed that the PDF attachments would provide solution for combining these external files with the form.

The other alternative solution, that I have considered, is to "embed" the external documents to the form using the Image Field element in the layout. This is not really an option, because Image Field supports only BMP, JPEG, GIF, PNG and TIFF - NOT PDF. Secondly, it's really designed for embedding fixed-size images to the form. In our case the scanned document can be 10 pages long.

Former Member
0 Kudos

Hi,

The only way that can be done for adding attachments is the way you have specified or Have a look at the SAP Standard Report FP_PDF_TEST_16. This also follows the same way of modifying the PDF data after reading the GETPDF and calling classes to add attachments.

Regards

Pradeep Goli

Former Member
0 Kudos

That standard report doesn't seem to be available in ERP 5.0 / WebAS 6.40.

Anyway, if there isn't smarter way to do this, then I need to go forward with my initial plan.