Vous êtes sur la page 1sur 15

New Process| ng Type "Externa|

6ommun| cat| on"




Rel ease 6. 20/ 6. 40


17.12.2004
Post Processing Framework (PPF) 620/6.40 2
Copyright

Copyright 2004 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP AG. The information contained herein may be
changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary
software components of other software vendors.

Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft
Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400,
OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner,
WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM
Corporation in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are
trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World
Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and
services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP AG in Germany and in several other countries all over the world. All other
product and service names mentioned are the trademarks of their respective companies.
Data contained in this document serves informational purposes only. National product
specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP
AG and its affiliated companies ("SAP Group") for informational purposes only, without
representation or warranty of any kind, and SAP Group shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP Group products and
services are those that are set forth in the express warranty statements accompanying such
products and services, if any. Nothing herein should be construed as constituting an
additional warranty.
17.12.2004
Post Processing Framework (PPF) 620/6.40 3

New Processing Type 'External Communication' ...................................................................... 4
Customizing of the Processing Type 'External Communication' ........................................... 4
The Business Add-In for the Form Processing...................................................................... 6
Possibilities within the Configuration of Transportable Conditions........................................ 7
Code Example: Form Processing and E-mailing................................................................. 10
Changes and Additions at Runtime: Attachment ................................................................. 13



17.12.2004
Post Processing Framework (PPF) 620/6.40 4
New Processing Type External Communication
Starting with Web Application Server Release 6.20, the PPF provides a new processing type
External Communication. The new processing type replaces and enhances the possibilities
given by the processing types Smart Forms Fax, Smart Forms Mail, and Smart Forms
Print.

The new processing type supports various types of communication methods, simultaneously.
Hence internet mail, Fax, print can be handled by one processing type and communication
strategies for partner become easier to implement.

External Communication is based on the communication interface of the SAP Web
Application Server (WebAS) called Business Communication Services (BCS). Therefore, it
is sometimes also called BCS-processing. Whereas sending a document was previously
handled by Smart Forms, the new processing type is communicating directly with the BCS.
This implies a strict decoupling of form processing and the send request processing. The
benefits of this design enfold:
Enhanced usages of all features of the communication interface BCS
Transparent responsibilities of different coding parts
Easier reuse of coding, i.e. the form processing for various output channels can be
identical.
Starting with Net Weaver 04, the new processing type supports the sending of PDF-based
forms.
Customizing of the Processing Type External
Communication
Processing types of action definitions are maintained within transaction SPPFC or an
equivalent link in the IMG sub-tree of your application. Select your action definition and
navigate to the customizing of the corresponding processing type.

In the list Permitted Processing Types of Action, select External Communication.
Press the button Set Processing which provides you with a tab strip for customizing
your processing.
17.12.2004
Post Processing Framework (PPF) 620/6.40 5

Start with the first tab Document. Please customize all fields.
o Form Name corresponds to the technical name of the form that you want to
print or send. (This is the name of your PDF-based form or Smart Form.)
o The Form Type of the above mentioned form. Accordingly, you choose either
Smart Forms or PDF-based Forms using the drop down list.
o The field Format should be filled with the filter value of the BAdI
DOC_PERSONALIZE_BCS. The BAdI-implementation corresponding to the
given filter value will be called at runtime to handle the application specific
part of the form processing. For further details, we refer to chapter XYZ.
o Personalization Type specifies the type of variable replacement at runtime.
The following options exist:
Recipient-Specific Variable Replacement
Object-Specific Variable Replacement
No Variable Replacement
The tab FaxCoverSht allows you to customize the used cover page for
communication via FAX. The following possibilities are available via a drop down list.
o No Fax Cover Sheet suppresses the addition of a fax cover page.
o SAP Script Standard Cover Sheet will add the standard fax cover page,
which is also used by SAP Office.
17.12.2004
Post Processing Framework (PPF) 620/6.40 6
o Form-Based Fax Cover Sheet allows you to replace the standard fax cover
page by your own form. The form is identified by its Form Name and its
Form Type. For more details we refer to chapter XYZ.

The tab Archiving offers the possibility for optical archiving. Provided the application
supports optical archiving using Archive Link, the archive parameters archive object
type and document type must be entered. These must first be created in Archive Link
Customizing. You can reach Archive Link Customizing using the transactions (oac2,
oac3, oaco). The option archive copies optically archives all multiple outputs, that is, it
also archives identical multiple
archives.


The Business Add-In for the Form Processing
The form processing of the document is encapsulated in the filter dependent BAdI
DOC_PERSONALIZE_BCS. As illustrated in the customizing section, you assign a filter value
to your processing type in the field Format. This filter value corresponds to an implementation
of the BAdI. You can see this in the BAdI builder transaction SE18.
17.12.2004
Post Processing Framework (PPF) 620/6.40 7


The corresponding interface IF_EX_DOC_PERSONALIZATION_BCS provides the following
methods:
PERSONALIZE_DOCUMENT: Variable replacement and personalization of a Smart
Form-based document.
Since Net Weaver 04, there exist two additional methods for the processing of PDF-
based forms.
PERSONALIZE_PDF_DOC_PDFIF: Variable replacement and personalization of a
PDF-based document with PDF-based interface. These are the new PDF documents.
PERSONALIZE_PDF_DOC_SFIF: Variable replacement and personalization of a
PDF-form with Smart Forms interface. These are PDF documents migrated from
Smart Forms.

Possibilities within the Configuration of Transportable
Conditions
In the configuration of transportable conditions that you can view by opening transaction
SPPFCADM and choosing Condition configuration (transportable conditions), you can replace
the default settings from the action definition. Moreover, there are some additional features
available, which will be discussed in this section.
17.12.2004
Post Processing Framework (PPF) 620/6.40 8
On the tab ActionDetails, you find the following sub-tabs:
The tab Document mostly deals with the same input as the corresponding tab in the
customizing environment. In case of a partner dependent action definition, there is
an additional field Communication Method. This information determines in which
way the document is send to the partner. The possible ways are the following.
o Standard Communication Method refers to the default communication
method set up in the Central Address Management (CAM), transaction
SU01.
o Fax, Internet Mail, Print replacing the functionality of the Smart Forms
processing methods.
The tab Copy Recipient provides new functionality. Here you can add fixed
recipients of a copy of the document. This part of the configuration must be set up in
the productive system, since these additional fixed recipients are not transportable
due to restrictions of the BCS itself.

The tab Printer offers various settings for a fixed printer and its spool behavior.
Alternatively, you can configure the use of a dynamic Printer Determination. This
printer determination is identical to the one used for the Smart Form processing
methods, i.e. it consists of an implementation of the BAdI definition
17.12.2004
Post Processing Framework (PPF) 620/6.40 9
PRINTER_DETERM_PPF.

The tab Mail/Fax Attachmt provides a place to add some additional documents for
the communication methods email, fax. Being a specific property of the BCS, these
fixed attachments are not transportable objects. Therefore, they have to be added in
the productive
system.

The tab Mail Settings deals with status of an outgoing email. These statuses
information are then added to the processing protocol. Moreover, the error analysis is
enhanced by receiving detailed information from the communication
interface.

The tab FaxCoverSht is identical to the one discussed in the customizing
environment of the processing
17.12.2004
Post Processing Framework (PPF) 620/6.40 10
method.



Code Example: Form processing and emailing
The report BCS_EXAMPLE_6 provides an example how to call the PDF form to processing to
receive the PDF content and how to send this PDF content using the BCS interface.

Additionally, here is a sample implementation of the method
PERSONALIZE_PDF_DOC_PDFIF of the BAdi DOC_PERSONALIZE_BCS from the PPF
demo application SPPFDEMO.

hETh00 1_ex_doc_persohaT1ze_bcs~persohaT1ze_pd_doc_pd1.

* uhcf1oh hame
0ATA. dummy{254} TYPE c,
Ts_arch1ve TYPE foa_dara.

0ATA. To_book TYPE REF T0 cT_book_pp,
Ts_book TYPE ppfbook,
T_gu1d TYPE os_gu1d.

* casf 1mporfed objecf so fhaf We cah reer fo 1fs affr1bufes
To_book ?= 1o_appT_objecf.

*----------- gef appT1caf1oh spec11c dafa -----------------------------
* --------->
* --------->
* --------->
* --------->
*-----------------------------------------------------------------------
Ts_book-1d = To_book->gef_1d{ }.
Ts_book-aufhor = To_book->gef_aufhor{ }.
17.12.2004
Post Processing Framework (PPF) 620/6.40 11
Ts_book-f1fTe = To_book->gef_f1fTe{ }.
Ts_book-pagecouhf = To_book->gef_pagecouhf{ }.
Ts_book-creafor = To_book->gef_creafor{ }.
Ts_book-dafecreafe = To_book->gef_dafecreafe{ }.
Ts_book-dafechahge = To_book->gef_dafechahge{ }.
Ts_book-sfafus = To_book->gef_sfafus{ }.
Ts_book-1sbh = To_book->gef_1sbh{ }.

*-----------Tahguage o smarf orm--------------------------------------
* deferm1h here fhe Tahguage o fhe smarf orm
* 1s_cohfroT_paramefers-Tahgu = Tahguage_o_my_smarf_orm.
*-----------------------------------------------------------------------

*-----------1TT arch1ve paramefers or arch1ve T1hk -------------------
1 1s_oufpufparams-arcmode = `2` or
1s_oufpufparams-arcmode = `3`.
* arch1ve_1hdex_fab
read fabTe cs_docparams-darafab 1hfo Ts_arch1ve 1hdex 1.
* jusf 1TT fhe 1d o your acfuaT 0R objecf
* fhe 1d 1s fhe same as fhe 1hsfahce gu1d
* gef my gu1d
caTT mefhod cT_acfory_pp=>gef_gu1d_by_re
exporf1hg
1p_cTasshame = `CL_00K_PPF`
1o_re = To_book
rece1v1hg
rp_gu1d = T_gu1d.

* ------>
Ts_arch1ve-objecf_1d = T_gu1d.
* ------>
mod1y cs_docparams-darafab rom Ts_arch1ve 1hdex 1.
ehd1.
*-----------------------------------------------------------------------


* Sef oufpuf paramefers ahd opeh spooT job
CALL FUhCTT0h `FP_J0_0PEh`
ChAh0Th0
1e_oufpufparams = 1s_oufpufparams
EXCEPTT0hS
cahceT = 1
usage_error = 2
17.12.2004
Post Processing Framework (PPF) 620/6.40 12
sysfem_error = 3
1hferhaT_error = 4
0ThERS = 5.
TF sy-subrc <> 0.
hESSA0E e011{bcs_med1um}
WTTh `FP_J0_0PEh` sy-subrc
ThT0 dummy.
CALL hETh00 cT_Tog_pp=>add_message
EXP0RTTh0
1p_probTemcTass = `1`
1p_hahdTe = 1p_appT1caf1oh_Tog.
EXTT.
Eh0TF.


CALL FUhCTT0h 1p_uhcf1oh_hame
EXP0RTTh0
11bcdWb1docparams = cs_docparams
1s_book = Ts_book
ThP0RTTh0
11bcdWb1ormoufpuf = es_ormoufpuf
EXCEPTT0hS
usage_error = 1
sysfem_error = 2
1hferhaT_error = 3
0ThERS = 4.
TF sy-subrc <> 0.
* add ah error message fo process1hg profocoT
CASE sy-subrc.
WhEh 1.
hESSA0E e012{bcs_med1um}
WTTh 1p_uhcf1oh_hame ThT0 dummy.
WhEh 2.
hESSA0E e013{bcs_med1um}
WTTh 1p_uhcf1oh_hame ThT0 dummy.
WhEh 0ThERS.
hESSA0E e014{bcs_med1um}
WTTh 1p_uhcf1oh_hame ThT0 dummy.
Eh0CASE.
CALL hETh00 cT_Tog_pp=>add_message
EXP0RTTh0
1p_probTemcTass = `1`
1p_hahdTe = 1p_appT1caf1oh_Tog.
17.12.2004
Post Processing Framework (PPF) 620/6.40 13
EXTT.
Eh0TF.

cp_documehf_f1fTe = 1p_orm_hame.

* CTose spooT job
CALL FUhCTT0h `FP_J0_CL0SE`
ThP0RTTh0
e_resuTf = es_joboufpuf
EXCEPTT0hS
usage_error = 1
sysfem_error = 2
1hferhaT_error = 3
0ThERS = 4.
TF sy-subrc <> 0.
CASE sy-subrc.
WhEh 1.
hESSA0E e012{bcs_med1um}
WTTh 1p_uhcf1oh_hame ThT0 dummy.
WhEh 2.
hESSA0E e013{bcs_med1um}
WTTh 1p_uhcf1oh_hame ThT0 dummy.
WhEh 0ThERS.
hESSA0E e014{bcs_med1um}
WTTh 1p_uhcf1oh_hame ThT0 dummy.
Eh0CASE.
CALL hETh00 cT_Tog_pp=>add_message
EXP0RTTh0
1p_probTemcTass = `1`
1p_hahdTe = 1p_appT1caf1oh_Tog.
EXTT.
Eh0TF.

Eh0hETh00.


Changes and Additions at Runtime: Attachments
You can add further attachments in the BAdI COMPLETE_PROC_PPF. Just implement the
method complete_send. The import parameter IO_SEND of this method provides you a
handle to the send data. Here is a code sample how to attach new documents:

hETh00 TF_EX_C0hPLETE_PR0C_PPF~C0hPLETE_SEh0.
17.12.2004
Post Processing Framework (PPF) 620/6.40 14

dafa To_documehf fype re fo cT_documehf_bcs.
dafa Tf_cohfehf fype soT1x_fab.
dafa Tx_bcs fype re fo cx_bcs.
dafa Tx_roof fype re fo cx_roof.

fry.
* -------- gef documehf o sehd requesf --------------------------
To_documehf ?= 1o_sehd->documehf{ }.

* -------- gef affachmehf cohfehf rom appT1caf1oh ---------------
"Tf_cohfehf = ... <add your code here> ...

* -------- add affachmehf fo documehf ----------------------------
CALL hETh00 To_documehf->add_affachmehf
EXP0RTTh0 1_affachmehf_fype = <add fhe documehf`s exfehs1oh>
1_affachmehf_subjecf = <add a subjecf here>
1_aff_cohfehf_hex = Tf_cohfehf.


* -------- error hahdT1hg ----------------------------------------
cafch cx_bcs cx_sy_move_casf_error.
* * add error fo appT1caf1oh Tog
* * sef message 1eTds
"sy-msg1d = ...
"sy-msgho = ...
CALL hETh00 cT_Tog_pp=>add_message
EXP0RTTh0
1p_probTemcTass = <add a probTem cTass>
1p_hahdTe = 1p_profocoT.
ex1f.

ehdfry.

* -------- add success message fo appT1caf1oh Tog ----------------
* * sef message 1eTds
"sy-msg1d = ...
"sy-msgho = ...
CALL hETh00 cT_Tog_pp=>add_message
EXP0RTTh0
1p_probTemcTass = <add a probTem cTass>
1p_hahdTe = 1p_profocoT.

17.12.2004
Post Processing Framework (PPF) 620/6.40 15

Eh0hETh00.

Vous aimerez peut-être aussi