0% found this document useful (0 votes)
506 views

SAP Adobe Interactive Form Tutorial - Part 1

This document provides an introduction and first part of a tutorial on SAP Adobe Interactive Forms. It discusses creating a basic form interface and form using transaction code SFP. It demonstrates adding an import parameter to the interface, linking it to the form context, and displaying it in the form layout. It also includes an example driver program to call the generated function module and pass data to the form.

Uploaded by

Elkin Ocampo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
506 views

SAP Adobe Interactive Form Tutorial - Part 1

This document provides an introduction and first part of a tutorial on SAP Adobe Interactive Forms. It discusses creating a basic form interface and form using transaction code SFP. It demonstrates adding an import parameter to the interface, linking it to the form context, and displaying it in the form layout. It also includes an example driver program to call the generated function module and pass data to the form.

Uploaded by

Elkin Ocampo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

SAP Adobe Interactive Form Tutorial.

Part I. First Adobe Form


By
Ram Daruru
-
December 5, 2016
17

Share on Facebook

Tweet on Twitter

We at SAPYard, always try to present the tutorials in a very unconventional


and interesting way. After our popular series in SAP Web Dynpro ABAP,
SAP ABAP on HANA, GOS Programming, OOPs ABAP etc, there was
numerous queries and request from our readers to provide a step by step
tutorial on Adobe Forms. There are many such tutorials on the web on
Adobe Form and we have started yet another tutorial on Adobe Form.
Why? The reason being very simple. Our Team member Ram has taken
the ownership to make this series as lucid as possible and put some spice
is every part of this series.

Spice of this part by Ram: Many of us ABAPer do not know that Adobe
Form can be tested stand alone in t-code SE37 (just like smartform). You

will not find this trick in every other Adobe Form tutorial. .

So buckle your seat belts and get ready for this beautiful journey on SAP
Adobe Form with our experience Pilot, Ram Daruru.

Tutorial 1: Our First Adobe Form

Pre-requisites: Adobe life cycle designer in your system and it should be


configured in the Sever as well.

Transaction code: SFP. In the previous article, we told a trick to

remember this. Smart Form PDF.

Enter the Interface and Create (Interface is mandatory for Adobe form).
What are the uses of Form Interface?

1. In the form interface, you specify the data that is exchanged with the
application program (such as tables, structures, work areas).
2. Under Global Definitions, you define your own fields, variables etc.
3. The system fields contain data with a predefined meaning (such as
the date).

Provide the Description and Press on Save.

Give the Package name and Save.


Check the Interface properties. Scan the left side and the right side of the
panel. Check the Parameter Name which was generated automatically.

Let us add our own custom Parameter Name. Select the Import option
under Form Interface (left side) and press the Create button (right side) to
add an Importing Parameter IV_TEXT.

For this tutorial, IV_TEXT is of type CHAR30 and check the optional Flag.

Check, Save and Activate the Form Interface.


Do you know: How to upload the PDF format directly into Adobe
form layout?

Go Back or go to t-code SFP again. This time we need to create the Form.

Hopefully, we do not need to instruct you again to Press on Create button.

Provide the Description of the Form and the Interface name which we
created earlier.
Enter the Package name and Save.

This is the first look of our Form. Left side we have the Interface and right
side the Context.

Expand the Import Parameter and Drag and drop the required variable to
Context
 

What is the significance of the Context in Form Builder?

In the context (also known as the form context), you specify which data is
copied from the interface to the form. You can also include this data as a
node in a hierarchy structure. In this hierarchy, you can also decide the
form logic by specifying conditions for processing the nodes.

The context function in Form Builder is the link that binds the interface to
the layout. You construct the form context from the existing interface.

If the above explanation is too vague for you. Forget it. 

Simply remember Context as data declaration at the Global Area, may


be just like TOP Include program.

In short, if you want your parameters i.e internal tables, work areas or
variable etc to be passed from your driver program to Interface and then to
the Form then you need to define that internal table, work areas or
variables at the Context of the Form. Does it make sense? Or did I

confuse you more?

Anything defined in Context of the Form is available in the Form to be


displayed or manipulated. If you defined a variable in the Form Interface
but did not create it in the Context, then that Interface variable would
never be available in the Form.
Simple drag and drop the parameters from Interface to the Form Context
(as shown in the figure below). All the binding between Interface
parameters and Form context would happen automatically.

If you do not like short cuts (drag and drop) or if you want the context
parameter name to be different than that in Form Interface, then you need
to specify the Data Field in the properties of the Context element by
yourself. For example, if you want to create a context P_TEXT but you want
to bind it with IV_TEXT, then the Data Field should be IV_TEXT as shown
below.

Tip: Drag and Drop from Interface to the Context and then change the
name/description of the Context element. This will save your time and you
do not need to maintain the properties explicitly.

Let us check the Layout Tab.


Left side we have Hierarchy, Tab Order, Data View etc and Right side we
have Design, Mater and PDF Preview options.

Let us chose Data View and Drag and Drop the Field which we want to print
on the form to Design view. You can place this filed anywhere in the layout.
For our example, we have just one element IV_TEXT. The reason being
simple. We created just one element in the Context. You can add a couple
of more context elements and they would be available here to be passed to
the layout. In next posts, we will add more complexity to our requirement
and you would be able to see how we can handle multiple elements.
You can change the Caption from IV_TEXT to required caption. For
example: Text. Click on the element and change the properties of the
Object on the right hand side.

Check, Save and Activate the Form. 

You might also like to check ‘How I used SAP Adobe Form as my
personal PDF editor’

Stand Alone Testing of Adobe Form by using Interface:

To see output for test purpose even before your calling program or driver
program is ready, you can press F8 and again F8 and input some value to
the Interface and check the output.
note: Hopefully, by now you have realized that like Smartform, Adobe form
also generates a function module in the back end.

Execute (F8)
Press on Print preview button. Check the input parameter is successfully
passed from interface to the layout.

Like SAP Script and Smartform, Adobe Form also need a Driver Program.
Forms have no utility if they are alone. They need a partner to be complete.

Let us take a look at the other side of the coin.


If you have worked in Smartform earlier, you would find no difference. We
just need to pass the data to the Form using the Interface parameters. And
debugging is also similar as Smartform.

1  
2 *&---------------------------------------------------------------------*
3 *=======================================================
4 ===============*
5 *                     YRAM_ADOBE_FORM_PROGRAM1                           *
6 *=======================================================
7 ===============*
8 * Project     : SAP Adobe Forms Tutorial                               *
9 * Author      : Ramanjula Naidu DARURU                                 *
1 * Description : Driver Program to Print Adobe form                     *
0 *=======================================================
1 ===============*
1 REPORT yram_adobe_form_program1.
1  
2 TABLES : apb_lpd_otr_keys.
1  
3 **&&~~ Data Objects
1 DATA: gv_fm_name         TYPE rs38l_fnam,      " FM Name
4       gs_fp_docparams    TYPE sfpdocparams,
1       gs_fp_outputparams TYPE sfpoutputparams.
5  
1 CONSTANTS : gv_form_name TYPE fpname VALUE 'YRAM_ADOBE_FORM1'.
6  
1 **&&~~ Selection Screen
7 *
1 PARAMETERS : p_text TYPE char30.
8 *&---------------------------------------------------------------------*
1 **&&~~ Form Processing: Call Form - Open
9 *
2 CALL FUNCTION 'FP_JOB_OPEN'
0   CHANGING
2     ie_outputparams = gs_fp_outputparams
1   EXCEPTIONS
2     cancel          = 1
2     usage_error     = 2
2     system_error    = 3
3     internal_error  = 4
2     OTHERS          = 5.
4 IF sy-subrc <> 0.
2   " Suitable Error Handling
5 ENDIF.
2 *&---------------------------------------------------------------------*
6 **&&~~ Get the Function module name based on Form Name
2 *
7 CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
2   EXPORTING
8     i_name     = gv_form_name
2   IMPORTING
9     e_funcname = gv_fm_name.
3 IF sy-subrc <> 0.
0   " Suitable Error Handling
3 ENDIF.
1 *&---------------------------------------------------------------------*
3 **&&~~ Take the FM name by executing the form - by using Pattern-
2 **&&~~ call that FM and replace the FM Name by gv_fm_name
3 *
3 **&&~~ Call the Generated FM
3 CALL FUNCTION gv_fm_name   "'/1BCDWB/SM00000176'
4   EXPORTING
3     /1bcdwb/docparams = gs_fp_docparams
5     iv_text           = p_text
3 * IMPORTING
6 *   /1BCDWB/FORMOUTPUT       =
3   EXCEPTIONS
7     usage_error       = 1
3     system_error      = 2
8     internal_error    = 3
3     OTHERS            = 4.
9 IF sy-subrc <> 0.
4 * Implement suitable error handling here
0 ENDIF.
4 *&---------------------------------------------------------------------*
1 **&&~~ Form Processing: Call Form - Open
4 *
2 CALL FUNCTION 'FP_JOB_CLOSE'
4 * IMPORTING
3 *   E_RESULT             =
4 * EXCEPTIONS
4 *   USAGE_ERROR          = 1
4 *   SYSTEM_ERROR         = 2
5 *   INTERNAL_ERROR       = 3
4 *   OTHERS               = 4
6   .
4 IF sy-subrc <> 0.
7 * Implement suitable error handling here
4 ENDIF.
8 *&---------------------------------END----------------------------------*
4
9
5
0
5
1
5
2
5
3
5
4
5
5
5
6
5
7
5
8
5
9
6
0
6
1
6
2
6
3
6
4
6
5
6
6
6
7
6
8
6
9
7
0
7
1
7
2
7
3
7
4
7
5
7
6
7
7
7
8
7
9
8
0
8
1
8
2
8
3
8
4
Let us test the Output using the Driver Program:

Execute the Driver Program and chose the Print Preview option. The input
field is correctly displayed in the Form Layout.

Hopefully, you liked this simple article. This is just the ABCs of Adobe Form.
In next articles (Tables in Adobe Form), we would learn the words and then

start framing the sentences using these ABCs. . Do not worry, we will
hand hold you in this learning activity. But, you cannot learn to swim unless
you enter the water. So try practicing this simple exercise in your system
and I am sure you will have no issue. If any issue just shoot an email to
[email protected] or leave your questions in the comment section
and you will definitely have a quick response.
If you want to get such useful articles directly to your inbox, please
SUBSCRIBE. We respect your privacy and take protecting it seriously.

If you liked this post, please hit the share buttons and like us on
facebook.

Do you have anything to add to this article? Have you faced any issue using
Adobe Forms? Do you want to share any real project requirement or
solutions? Please do not hold back. Please leave your thoughts in the
comment section.

Thank you very much for your time!!

You might also like