Ads

SAP ABAP Adobe Forms

SAP ABAP Adobe Forms

Adobe Forms are advanced to smart forms and scripts in SAP ABAP and they are interactive and they can used on online mode and offline mode that is user friendly forms.User can edit data in the adobe forms .These are having advanced features but smart forms and scripts are not interactive and we can not edit them .So adobe forms are more useful forms today's clients .As a ABAP developer ,it will be advantage ,if you learn adobe iterative forms that are available in portable document format(PDF) .

It is a Universal file format developed by Adobe that preserves all the fonts, formatting, graphics, and color of any source document,

As we discussed ,which are user friendly  and can be shared, viewed, navigated, and printed exactly as intended by anyone with Adobe Reader software.
Why should we use PDF Forms?
SAP ABAP Adobe Forms
SAP ABAP Adobe Forms

 It provides  options 

 Digital signature validation
 Disable save option
 Disable select option
 Disable print option.


Advantages of  Adobe Forms in SAP -

 1.Appearance of the form remains same, irrespective of the environment it is being used in.
 2. Which automate the creation of data for SAP systems. Thus saving time and costs 
 3.Integrate business processes with many users.


When we use  PDF Forms


 2.Order confirmations
 3.Invoices
 4.Account statements
 5.Checks
 6.Salary statements
 7.Delivery notes
 8.Customs forms

How to Create Adobe forms:


First of all ,we will create interface after that we will be creating form 
Using transaction 'SFP' to go to Form Builder or through SE80 .
Before creating a PDF, you need to have an interface which contains all the fields which you will be using in the form.
Hence before creating a form you need to create an Interface and assign this interface in the pop-up, 


What is the structure of Adobe Form: 


Interface - parameter defining.
 A form interface that sends the application data to the form. 
 Interface can be reached through SE80 or SFP transaction. Interface in  smart forms and PDF are not compatible.
Context - mapping parameters from interface.
 A form context that contains the form logic. This logic controls the dynamic formatting of the form. 

Layout - form designing.
 A layout in which you define how the output data is positioned, its appearance in graphics, and the design of the pages.

Creating a Form Object

Creating a Form Object in the Repository Browser(SE80)
You are in the Repository Browser of the ABAP Workbench.
Select a package.

Page concept and elements of Adobe Form

The following different page types can be used to structure a form:
 1.Master pages
 2.Body pages
You can position various elements on these pages:
  1.Standard objects
    a.)Static objects such as texts, graphics, squares  and rectangles, circles, lines.
    b.)Dynamic objects  such as buttons, checkboxes, date/time fields, drop-down etc.
  2.User-defined objects
  3.Barcodes.


Creating Adobe Form in Form Builder (SFP)


Go to the SFP Transaction code
For every form, an interface is mandatory. Enter the name of the interface and click on Create.

Click on Save. Enter the package and the workbench request no as per the requirements.

Enter the parameter values as shown above. 

Save and activate the interface. 

Now go back to the main screen of the transaction SFP. 

select the radio-button Form and enter the name of the form. Click on ‘Create’. 

Enter the description for the Form and also link the name of the interface created earlier.   

Click on Save. 

Now click on the tab ”Layout” and design the Adobe form.After designing go to ABAP Editor(SE38)to execute the created adobe form.

Executing from in ABAP Editore and ABAP Program.


 1.Data retrieval in the report programme.
 2.Call Function 'FP_FUNCTION _MODULE_NAME( to get the  generated
    function module name).
 3.Call Function 'FP_JOB_OPEN '.
 4.Call Function <generated function module name>.
 5.Call Function 'FP_JOB_CLOSE'.
 If you need to have copies of the same form to be generated, you may call
 the function module by using (do ('n' times) - enddo) loops.
Report Zadobe_forms.

DATA: CUSTOMER_NAMES          TYPE SCUSTOM,
      CUSTOMER_BOOKINGS          TYPE TY_BOOKINGS,
      CUSTOMER_CONNECTIONS       TYPE TY_CONNECTIONS,
      FM_NAME           TYPE RS38L_FNAM,
      FP_DOCPARAMS      TYPE SFPDOCPARAMS,
      FP_OUTPUTPARAMS   TYPE SFPOUTPUTPARAMS.
* Selecting THE DATA
  <data selection>
  
* Printing form:
* Sets the output parameters and opens the spool job
    
CALL FUNCTION 'FP_JOB_OPEN'
     CHANGING
     IE_OUTPUTPARAMS       = FP_OUTPUTPARAMS
     EXCEPTIONS
     CANCEL                = 1
     USAGE_ERROR           = 2
     SYSTEM_ERROR          = 3
     INTERNAL_ERROR        = 4
     OTHERS                = 5.
    IF SY-SUBRC <> 0.
  <error handling>
    ENDIF.
* Get the name of the generated function module
   
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
    I_NAME                     = '<form name>'
    IMPORTING
    E_FUNCNAME                 = FM_NAME.
   IF SY-SUBRC <> 0.
  <error handling>
   ENDIF.
* Call the generated function module
   
CALL FUNCTION FM_NAME
     EXPORTING
     /1BCDWB/DOCPARAMS        = FP_DOCPARAMS
     CUSTOMER                 = CUSTOMER_NAMES
     BOOKINGS                 = CUSTOMER_BOOKINGS
     CONNECTIONS              = CUSTOMER_CONNECTIONS
*   IMPORTING
*     /1BCDWB/FORMOUTPUT       =
    EXCEPTIONS
      USAGE_ERROR           = 1
      SYSTEM_ERROR          = 2
      INTERNAL_ERROR           = 3.
   IF SY-SUBRC <> 0.
  <error handling>
   ENDIF.
* Close the spool job
  CALL FUNCTION 'FP_JOB_CLOSE'
*   IMPORTING
*    E_RESULT             =
    EXCEPTIONS
      USAGE_ERROR           = 1
      SYSTEM_ERROR          = 2
      INTERNAL_ERROR        = 3
      OTHERS                = 4.
  IF SY-SUBRC <> 0.
  <error handling>
  ENDIF.

Error Hnadling:

For error handing the adobe form ,we are using below function modules.
  Texts about the cause of the error (with the FP_GET_LAST_ADS_ERRSTR FM)
  A trace of the Adobe document services (with the FP_GET_LAST_ADS_TRACE FM)

More about Adobe Form features :

Definitions:

  Global definitions belong to the interface in the Form Builder. Here, you have the option of defining your own fields to be used anywhere in the form. 
  
Global Data:
   Here, you define any data needed by the form, but which has not been provided by the form interface (for example, to display totals).
  
Types
   Here, you create data types as free ABAP code, if the ABAP Dictionary does not provide a type.
  
Field Symbols
   You can use field symbols as pointers when you extract data from internal tables.

Initialization:
  You can initialize global data before you start to process the form, 
 Features
  You use the ABAP Editor to write the program code (Code Initialization) that is executed before the form is processed. You can include subroutines (Form Routines)

Specifying a Currency or Quantity Reference:

  In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of these fields, the system can then insert the relevant currency or
  unit.

 Creating the Form:

Now ,we will start creating the form.

 Assigning Interface

  In the dialog box that pop up, assign the interface, which you need to use


Once you have created the form (save it as a local object), you get the screen above, which will have the assigned interface at the left and the context at the right.
Including the fields..
Now for the form to access the field, we need to include the required field in the context of the form. This is done by dragging the required fields and
 putting it in the context level. 

Properties in Context

  Properties describe the content or meaning of a node.
  

Conditions

 1.You can define conditions for individual nodes, or for whole sub hierarchies of the context. 
Once the required parameters are included in the context, you can now go to the layout to design the form. Click in the tab 'Layout' and you get the screen below,
 which is basically the Adobe designer. 

Layout Editor


1.You create the body and master pages for the form design in the Layout Editor.
2.You can also view and edit the form design and preview the form (the form that the user will work with) in PDF.
3.The Layout Editor contains four tabs: Body Pages, Master Pages, XML Source, and  PDF Preview. 

Types of Form layout

 Static layout :
  These forms have fixed layouts.
 Dynamic layout :
  A form with a dynamic layout is designed to expand or shrink according to the amount of data available to fill it.

What elements we are using for form design?

 1.Master pages
 2.Body pages
 3.Content areas
 4.Subforms
 5.Fields
 6.Boilerplate objects

Master Pages

Every form design contains at least one master page that Live Cycle Designer creates automatically.
 Master pages define the orientation and dimensions of body pages.
 Master pages are responsible for formatting body pages.
 Provide a background and layout format for more than one of the body pages in a form design.
 Each master page is created with a default content area that covers the whole page.

Body pages

Body pages represent the pages of a form.
 Each body page derives its page size and orientation from a master page.
 Each body page is associated with the default master page that LiveCycle Designer creates.
 You can choose which master page to assign to a body page.


Content areas

Content areas define where objects can be placed or laid down on body pages.

Sub Forms

Subforms are container objects that you can use to group form design objects including: fields,address,images etc.

 Field objects

 1.Button 
 2.Check box
 3.Date/time field
 4.Drop-down list
 5.Image field 
 6.Text field 
 7.List box
 8.Numeric field

Boilerplate objects

 1.Circle
 2.Image
 3.Line
 4.Rectangle
 5.Text



 Palettes provide easy access to the tools without cluttering your workspace.

'Accessibility'.

Designing of the form can be made, at your comfort level, by setting the scales and measurements in the palette 'Drawing Aids'.

Hierarchy Palette


 The Hierarchy palette is a graphical representation of the contents in the  Body Pages and Master Pages tabs. The palette also displays referenced objects
 under the Referenced Objects node. 

Data View Palette


You can create the content of a form design to correspond to a data source. 

Library Palette


The Library palette contains all the objects that you can add to a form design.
 Objects are organized into groups.

 Object Palette

 Use the Object palette to modify properties that are specific to the selected object. 

Border Palette

Use the Border palette to edit the border properties for objects in the form design. 


Accessibility

 Use the Accessibility palette to specify custom text for an object .

Layout Palette

When you select an object on a body or master page, the Layout palette automatically displays the selected object's settings. 

Finally ,we have learnt main concept of the SAP ABAP Adobe Froms and its definition and uses and how to create it and all components of adobe form.
<
How to Start SAP ABAP Course
Smartforms Step by Step Tutorial

Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced