Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3255

Build a Custom PDF Form for a Standard BO

$
0
0

Foreword

SAP Cloud for Customer supports generation of PDF (adobe) forms from Cloud Application Studio and Administrator UI (Silverlight) for Standard BOs and Custom BOs.

Some of the predelivered forms for Standard BOs-Account, Opportunity, Appointment, Phone Call, Visits, Sales order, Sales Quote which can be edited using Easy Form Editor or Adobe Livecycle Designer. However there are few limitations to this as well :-

.

• Limited updates are possible on the standard pre-delivered PDF form (summary/factsheet) on Standard BOs, which are – rearrangement of layout (using Adobe LiveCycle Designer), Displaying/Hiding of the existing Form Parameters

• Using PDI Studio or KUT, it is possible to add Extension Fields onto Standard forms, However fields from Node-Extensions cannot be added onto Standard Forms

• Display of data from different BOs, Associations, etc. on the standard form is not supported

• Sorting/Filtering of data displayed on the standard form is not supported

• Applying specific formats for Date, Amount on the standard form is not supported Often is the case, where customers have specific requirements to display data from additional sources and in specific formats.

 

It is possible to overcome these limitations, by reimplementing a complete new development which can be achieved by following the steps below-

 

Process

Build a Custom BO:

1. Each Standard BO by default is associated with the predelivered PDF form using the unique Form Template Group ID Code. Due to this, it is not supported in PDI to create a new form and associate that with the Standard BO to be launched on PREVIEW request.

 

2. Inorder to accomplish this, we will create a CUSTOM BO with the exact list of fields as required in the new form. This BO will be marked as a TRANSIENT BO, so that data is not persisted The BO can be marked as transient by annotating all the fields in BO as [TRANSIENT] and not marking any field as a KEY field

Img1.PNG

 

3.Create an ‘AFTER MODIFY’ event on the Custom BO

Img2.PNG

 

.4.In the ‘AFTER MODIFY’ event, use RETRIEVE & QUERY statements to prepare the data for Form at runtime.Img3.PNG

 

- The data from ‘Activities’ can be further filtered to display only ‘OPEN’ Activities or ‘Completed’ Opportunities, etc. -  Img4.PNG

The Amount fields can also be formatted in a custom way (display/not display Decimals)

 

-- Dynamic Labels can be set per section

--Format the date display

Img5.PNG

 

Generate Print Form on BO

 

5.Right click on the BO and click on Create Print Form

‘’ Img6.PNG

 

6.The Form Template Group Header is generated (with a Unique ID) along with the XDP file.

Img7.PNG

 

7.The Form Interface structure includes all the fields from the BO including the Sub-Nodes. You can selectively select/unselect these from the Form Interface for Form Template Creation

Img8.PNG

 

8.You can access the form by clicking on XDP file (which will launch the form in adobe livecycle designer)

Img9.PNG

 

On the right-hand column you will be able to see a tab- “Data View” which corresponds to the Form Template Interface fields (corresponds to the interface selected .FTHD) On the left-hand column the properties of each field on Designer Pane can be viewed and adjusted. The fields can be additionally bound by selecting ‘DATA BINDING’ and the field from Data Connection.

Img10.PNG

 

Under the tab – “Hierarchy” you will be able to see all the form blocks

- Create a single MASTER Page Layout which would appear on all the pages, e.g. Logo, Date, Page Numbers

- Create one Body-Sub Form Layout which contains all the sections required in form.

Img11.png

9.Once form is designed, save and activate the form. Click on CHECK-IN against the .XDP file in PDI to merge the changes back into Studio.

Img12.png

 

Create an Event to Fill Data at Runtime for Form

10.Create an Embedded Component with an INPORT in the Embedded Component tightly bound to the Parent TI’s Navigation ID (Account ID) and configure an event to be fired immediately

Img13.PNG

 

The event handler ‘AUTOFIRE’ is configured to fill in details of Account (at runtime) into the Custom BO which would then push the data onto the PDF Form.

- The 1st operation is the ‘BO READ’ Operation, which initially checks if the data has already been buffered in Custom BO? If yes, then it avoids re-reading the data back into BO.

Img14.PNG

- The 2nd operation, is an ‘IF Condition’ which checks if the attribute ‘ROOT/ACCTID’ gets a result from READ Operation, if NO (blank) then it starts the INSTANCE Creation operation.

Img15.PNG

If the Condition is met, i.e. /ROOT/ACCTID = “ “, then :- Create an Instance of BO

Img16.PNG

Assign the ACCOUNT ID to the CUSTOM BO

Img17.png

 

Create an Event to preview Form

11.Create BUTTON in the same Embedded Component to launch the custom preview form.

Img18.png

 

12.Create an Outport under CONTROLLER tab of EC- to pass the FORM Group Code and the parameter to force front-end preview as-is below

Img19.png

13.Create the Event Handler to trigger outport and assign this Event Handler to “ON CLICK” properties of the Button-

Img20.PNG

14.Next, add the PREVIEW Modal Dialog (from the reuse SAP BYD Application UI folder)

Img21.png

Also do a NodeReferenceBinding on ROOT

Img22.PNG

 

Link Custom EC to Standard TI

15.Next add the Embedded Component using a Stable Anchor in the Standard TI (Account TI used here in example) And, do the Outport-Inport Binding passing the Account ID (used in example here)

- Select the operation from a stable anchor under Extensibility Explorer

Img23.PNG

 

 

 

Author-Dedeepya Reddy

Viewing all articles
Browse latest Browse all 3255

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>