Usecase: Admin wants to send BO pdf Summary as a part of workflow. He needs to ensure that he has the possibility to select the right template and language for the pdf summary while defining workflow rules to ensure that template and language are suited for end user.
It also provides a posisblilty for customer to write custom code for template & language determination if customer does not want to use standard feature.
Create a Workflow Rule for a BO, say Sales Quote, for which "Form Group Code" is defined.
While defining the workflow rule select the BO object ( say "Sales Quote") defined in previous step. Select ‘Timing’ as ‘on Create Only’
Under ‘Define Actions’ , Select rule type as ‘email’
Check the checkboxes ‘Always Send E-mail’ and ‘Create Email Activity’.
Enter ‘Sender’ as ‘email@example.com’, Enter any ‘Subject’
Select a template file ( an HTML email template
Select the PDF template from the drop down
PDF Template language: From the drop down list, select the language for selected template
PDF Template Country: From the drop down list, select the Country for the selected language
Add the ‘Employee’, recipient to whom the mail should be sent.
Click on ‘Next’, Click on ‘Activate’, Click on ‘Finish’.
Goto Workcenter View for ‘Sales Quote’, Create a New Sales Quote and click Save.
The ‘Employee’ configured will receive a mail with the PDF document (pdf Summary of Sales Quote, in the language selected by the Admin User) attached.
Go to Workcenter View ‘Activities->Email
Open the activity created for your email, Goto Tab ‘Attachments’, you should see the generated PDF.
Case 2: Form Template Code maintained by Key user, the variant to be picked from PDI BADI.
There is another possibility where Customer can implement a BADI to specify the Form Variant Language and Form Variant Country (Based on BO Attributes). The input to this BADI are:
UUID of the BO Instance.
List of valid variant for selected for template, with an ‘index’ generated for each variant.
The BADI specifies the Variant by specifying the ‘Index’. This BADI is called if the Key user , while defining the workflow rule , has defined only the Form Template Code.
For testing this functionality, choose a system which is PDI enabled. Login to the Cloud Studio and create an Enhancement spot. The Details of the BADI are as follows: