6
7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 1/6 07.07.2012 Page 1 of 6 SAP Note 508569 - Biller Direct - PDF display of SD invoices  Note Language: English Version: 8 Validity: Valid Since 13.09.2007 Summary Symptom This consulting note informs you about all the technical details for printing billing documents in PDF format in a Java front end. Other terms FSCM, Biller Direct, PDF Reason and Prerequisites Enhancement of the standard system Solution Some specific FSCM transactions provide you with the option of displaying a "document" locally using the Internet browser. You can use the ADOBE Acrobat Viewer to display and print the current document as a PDF file. As an important precondition for the functions, the print layout must be causally generated in the underlying component system by executing the message determination and calling the print programs (SAPscript, Smart Form or, as of ERP 6.02, Adobe forms). This involves the use of all information from the "normal" settings of the message determination and print environment that you would also use for normal printing directly from within the SAP system. Archived documents or available message records are used. If neither exists, the system temporarily generates new message records but does not save them. The system does not send the print result to a printer (or the printer spool), but processes it as a simulation and converts it to PDF format. This PDF data stream is then returned to the calling Web transaction and the Internet browser, which then starts the Acrobat Viewer on your PC to display the document as a PDF file. You can now print locally. Therefore it is imperative that a PDF viewer is available to you. Usually, you can set browsers in such a way that they use the file extension to call a relevant application directly or after user confirmation. Therefore, we recommend that you define the Acrobat Viewer as the relevant application for the file extension *.pdf in the Windows environment of the desktop PC and "allow" the browser to start the viewer immediately. For more specifications on settings in the Acrobat Viewer, see below. Since print routines of the R/3 System originally generate the print document as a PDF file (as has just been described), you have to implement relevant settings in the routines in the SAP R/3 System. Since these settings also require adjustments in the source code of the print programs, the main objective of this (consultative) note is to provide all the technical background information you require to make these settings - in particular for your own print programs as well. The logical installation points and the additional source code that must be inserted is always the same for print programs with SAPscript or Smart Form forms. These sections of code are explained in detail in the following section. As of ERP 6.02, if Adobe forms are used as forms, no manual adjustments are

Note 508569 - Biller Direct - PDF display of SD invoices.pdf

Embed Size (px)

Citation preview

Page 1: Note 508569 - Biller Direct - PDF display of SD invoices.pdf

7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf

http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 1/6

07.07.2012 Page 1 of 6

SAP Note 508569 - Biller Direct - PDF display of SDinvoices

 Note Language: English Version: 8 Validity: Valid Since 13.09.2007

Summary

Symptom 

This consulting note informs you about all the technical details for

printing billing documents in PDF format in a Java front end.

Other terms

FSCM, Biller Direct, PDF

Reason and Prerequisites

Enhancement of the standard system

Solution

Some specific FSCM transactions provide you with the option of displaying a"document" locally using the Internet browser. You can use the ADOBE

Acrobat Viewer to display and print the current document as a PDF file.

As an important precondition for the functions, the print layout must be

causally generated in the underlying component system by executing the

message determination and calling the print programs (SAPscript, Smart Form

or, as of ERP 6.02, Adobe forms). This involves the use of all information

from the "normal" settings of the message determination and print

environment that you would also use for normal printing directly from

within the SAP system.

Archived documents or available message records are used. If neitherexists, the system temporarily generates new message records but does not

save them. The system does not send the print result to a printer (or the

printer spool), but processes it as a simulation and converts it to PDF

format. This PDF data stream is then returned to the calling Web

transaction and the Internet browser, which then starts the Acrobat Viewer

on your PC to display the document as a PDF file. You can now print

locally. Therefore it is imperative that a PDF viewer is available to you.

Usually, you can set browsers in such a way that they use the file

extension to call a relevant application directly or after user

confirmation. Therefore, we recommend that you define the Acrobat Viewer as

the relevant application for the file extension *.pdf in the Windows

environment of the desktop PC and "allow" the browser to start the viewer

immediately. For more specifications on settings in the Acrobat Viewer, see

below.

Since print routines of the R/3 System originally generate the print

document as a PDF file (as has just been described), you have to implement

relevant settings in the routines in the SAP R/3 System. Since these

settings also require adjustments in the source code of the print programs,

the main objective of this (consultative) note is to provide all the

technical background information you require to make these settings - in

particular for your own print programs as well. The logical installation

points and the additional source code that must be inserted is always the

same for print programs with SAPscript or Smart Form forms. These sections

of code are explained in detail in the following section.

As of ERP 6.02, if Adobe forms are used as forms, no manual adjustments are

Page 2: Note 508569 - Biller Direct - PDF display of SD invoices.pdf

7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf

http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 2/6

07.07.2012 Page 2 of 6

SAP Note 508569 - Biller Direct - PDF display of SDinvoices

made in the print routines. The following text is relevant only when using

Smart Forms and SAPscript.

Source code adjustments for the relevant print programs when using

SAPscript or Smart Forms as forms

-----------------------------------------------------

In the print routines that are used for generating the PDF data stream, you

must always insert the source code extensions at the same source code

positions, to enable the system to retrieve the print data stream from the

runtime environment, to convert the data into PDF format and to send it to

the calling Web transaction.

To enable better understanding, the basic principle is explained in more

detail:

o If you want to locally print a document of a particular process

displayed in an FSCM transaction, the system first determines

whether there is an archived print document and takes the FIRSTexisting one. If there is no archived document, the system

determines whether a message record (NAST) for printing exists and

takes the FIRST existing one. If no message record exists, the

system generates a temporary message condition record (which it

does not save) and fills all the required data structures that

would also be filled in the case of "normal" printing. The system

then generates the PDF file.

o In order to inform the runtime environment that this is browser

printing from FSCM, the field NAST-SORT1 is always filled with the

value "EBPP" in the temporarily generated condition record.

o In further processing, the system uses the fact that NAST-SORT1 is

filled with "EBPP" to control the required subsequent steps such as

the "diversion" into the PDF conversion and the transfer to the

browser.

o Since the same print programs are used for browser printing as are

usually used for normal printing, you must adjust these programs so

that they can differentiate between whether a "normal print" or a

"browser print" needs to be executed at that time.

A) Adjustments in the print program if you use a SAPscript form:

------------------------------------------------------------------------

o *** 1. Adjustment before the call of the function module OPEN FORM

***

Before the function module OPEN_FORM is called in a print program

(with SAPscript form), the additional source code described below

prevents the print data from being sent to a printer and diverts it

into the "main memory".

The standard report is RVADOPFO.

...

Page 3: Note 508569 - Biller Direct - PDF display of SD invoices.pdf

7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf

http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 3/6

07.07.2012 Page 3 of 6

SAP Note 508569 - Biller Direct - PDF display of SDinvoices

* ==> before you call the function module OPEN_FORM <==

*{insert note 386221/508569

* OTF output if a browser print

if nast-sort1 = 'EBPP'.

lvs_itcpo-tdgetotf = 'X'.

endif.

*}insert 386221/508569

call fucntion 'OPEN_FORM'

...

Explanation of the adjustments:

============================

Setting the parameter "tdgetotf" ensures that the system does not

direct the print output to printing but keeps it as a (temporary)

OTF data stream.

In all standard print programs, immediately before the call of themodule OPEN_FORM, you should be able to find source code where the

itcpo structure is filled. There you can insert the above source

code at an appropriate position.

o *** 2. Adjustment before/after the call of the function module

CLOSE_FORM ***

After the function module CLOSE_FORM is called in a print program

(using the SAPscript form), you must use the additional source code

described below to ensure that the system writes the OTF data to a

global memory area, where the calling transaction FSCM can retrieve

the data.

The standard report is RVADIN01.

...

* ==> before calling CLOSE_FORM

*{insert 386221/508569

* Define Internal table for OTF-Data

data: otf_data like itcoo occurs 0 with header line.

*}insert 386221/508569

...* ==> Call of CLOSE_FORM <==

call function 'CLOSE_FORM'

importing

...

*{insert 386221/508569

tables

otfdata = otf_data

*}insert 386221/508569

...

* ==> after the call of CLOSE_FORM has ended

*{insert 386221/508569

if nast-sort1 = 'EBPP'.CALL FUNCTION 'SAVE_OTF_TO_MEMORY'

EXPORTING

Page 4: Note 508569 - Biller Direct - PDF display of SD invoices.pdf

7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf

http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 4/6

07.07.2012 Page 4 of 6

SAP Note 508569 - Biller Direct - PDF display of SDinvoices

MEMORY_KEY = nast-objky

TABLES

otf = otf_data.

endif.

*}insert 386221/508569

...

Explanation of the adjustments:

============================

1. Source code adjustment

Declare otf_data using the "data" statement.

2. Source code adjustment

The tables parameter in the interface of the function module

CLOSE_FORM is generally not used (it is therefore turned into a

comment). For browser printing, you must make the setting as

described above.

3. Source code adjustment

At the end of the call of the function module CLOSE_FORM, the

system must use the function module SAVE_OTF_TO_MEMORY (available

in the standard system) to write the table that contains the OTF

data stream to a central main memory area. The current NAST key

(nast-objky) is used as an identifying term. The print program

communicates this using the calling transaction FSCM.

B) Adjustments in the print program if you use a Smart Form form:

------------------------------------------------------------------------

When you use a Smart Form as a print form, the parameter for generating the

additional OTF expenditure must be set in the function module that creates

the actual form. The name of the function module is usually determined

dynamically using "SSF_FUNCTION_MODULE_NAME" (see the standard report

RLB_INVOICE, for example).

When you call the lf_fm_name function module, you must now set the

parameter ls_control_param-getotf. This is dependent on the indicator

"Sort1" in the NAST record.

Then the set parameter ls_control_param-getotf is transferred to the

function module in the input parameter "control_parameters" to generate the

Smart Form.

In the return values of the function module, the created OTF is containedin the parameter job_output_info and is saved in the newly defined

structure ls_jobinfo.

Depending on the parameter"sort1", the created OTF is written to the main

memory and processed later.

Overall, the adjustment is as follows:

The standard report would be RLB_INVOICE

...

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

...

IMPORTING fm_name = lf_fm_name...

*{begin insert 386221/508569

Page 5: Note 508569 - Biller Direct - PDF display of SD invoices.pdf

7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf

http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 5/6

07.07.2012 Page 5 of 6

SAP Note 508569 - Biller Direct - PDF display of SDinvoices

IF nast-sort1 = 'EBPP'. " used for PDF in FSCM

context

ls_control_param-getotf = 'X'.

ENDIF.

DATA: ls_jobinfo type ssfcrescl.

*}end insert 386221/508569

...

CALL FUNCTION lf_fm_name

EXPORTING

...

control_parameters = ls_control_param

...

*{begin insert 386221/508569

IMPORTING

job_output_info = ls_jobinfo

*}end insert 386221/508569

...

IF sy-subrc <> 0....

ENDIF.

*{begin insert 386221/508569

IF nast-sort1 = 'EBPP'. " used for PDF in FSCM

context

CALL FUNCTION 'SAVE_OTF_TO_MEMORY'

EXPORTING

memory_key = nast-objky

TABLES

otf = ls_jobinfo-otfdata.

ENDIF.

*}end insert 386221/508569

Header Data

Release Status: Released for Customer

Released on: 13.09.2007 14:47:39

Master Language: German

Priority: Recommendations/additional info

Category: Installation information

Primary Component: FIN-FSCM-BD-AR Process integration accounts

receivables

 Valid Releases

Software Component Release From  

Release

To

Release

and 

Subsequent

SAP_APPL 46C 46C 46C

SAP_APPL 470 470 470

SAP_APPL 500 500 500

SAP_APPL 600 600 600

SAP_APPL 602 602 602

SAP_APPL 603 603 603

Page 6: Note 508569 - Biller Direct - PDF display of SD invoices.pdf

7/27/2019 Note 508569 - Biller Direct - PDF display of SD invoices.pdf

http://slidepdf.com/reader/full/note-508569-biller-direct-pdf-display-of-sd-invoicespdf 6/6