How To Create An Adobe Form From Scratch
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?
- In the form interface, you specify the data that is exchanged with the application program (such as tables, structures, work areas).
- Under Global Definitions, you define your own fields, variables etc.
- 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.
*&---------------------------------------------------------------------* *======================================================================* * YRAM_ADOBE_FORM_PROGRAM1 * *======================================================================* * Project : SAP Adobe Forms Tutorial * * Author : Ramanjula Naidu DARURU * * Description : Driver Program to Print Adobe form * *======================================================================* REPORT yram_adobe_form_program1. TABLES : apb_lpd_otr_keys. **&&~~ Data Objects DATA: gv_fm_name TYPE rs38l_fnam, " FM Name gs_fp_docparams TYPE sfpdocparams, gs_fp_outputparams TYPE sfpoutputparams. CONSTANTS : gv_form_name TYPE fpname VALUE 'YRAM_ADOBE_FORM1'. **&&~~ Selection Screen * PARAMETERS : p_text TYPE char30. *&---------------------------------------------------------------------* **&&~~ Form Processing: Call Form - Open * CALL FUNCTION 'FP_JOB_OPEN' CHANGING ie_outputparams = gs_fp_outputparams EXCEPTIONS cancel = 1 usage_error = 2 system_error = 3 internal_error = 4 OTHERS = 5. IF sy-subrc <> 0. " Suitable Error Handling ENDIF. *&---------------------------------------------------------------------* **&&~~ Get the Function module name based on Form Name * CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' EXPORTING i_name = gv_form_name IMPORTING e_funcname = gv_fm_name. IF sy-subrc <> 0. " Suitable Error Handling ENDIF. *&---------------------------------------------------------------------* **&&~~ Take the FM name by executing the form - by using Pattern- **&&~~ call that FM and replace the FM Name by gv_fm_name * **&&~~ Call the Generated FM CALL FUNCTION gv_fm_name "'/1BCDWB/SM00000176' EXPORTING /1bcdwb/docparams = gs_fp_docparams iv_text = p_text * IMPORTING * /1BCDWB/FORMOUTPUT = EXCEPTIONS usage_error = 1 system_error = 2 internal_error = 3 OTHERS = 4. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. *&---------------------------------------------------------------------* **&&~~ Form Processing: Call Form - Open * CALL FUNCTION 'FP_JOB_CLOSE' * IMPORTING * E_RESULT = * EXCEPTIONS * USAGE_ERROR = 1 * SYSTEM_ERROR = 2 * INTERNAL_ERROR = 3 * OTHERS = 4 . IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. *&---------------------------------END----------------------------------*
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 mailsapyard@gmail.com 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!!
Useful Tutorials in SAPYard
1. ABAP for SAP HANA Tutorials
2. ABAP Web Dynpro Tutorials
3. GOS Tutorial
4. OOPs ABAP Tutorial
5. HANA Tutorial
6. SAP Netweaver and OData Tutorial
7. SAP Adobe Form Tutorial
8. SAP Fiori Tutorial
9. SAPUI5 Tutorial
How To Create An Adobe Form From Scratch
Source: https://sapyard.com/sap-adobe-interactive-form-tutorial-part-i-first-adobe-form/
Posted by: kennedyweds2000.blogspot.com

0 Response to "How To Create An Adobe Form From Scratch"
Post a Comment