SAP Adobe Interactive Form Tutorial - Part 2
SAP Adobe Interactive Form Tutorial - Part 2
SAP Adobe Interactive Form Tutorial - Part 2
Share on Facebook
Tweet on Twitter
In our first tutorial on Adobe Form, we showed the steps to create our
basic form and the driver program. One of our readers asked for
configuration steps of driver program and adobe form.
Question from our reader: Can u please explain where we will configure
the driver program and associated adobe form name, to trigger in any
transaction?
Answer: Go to t-code NACE==>Select any application. For example : V3
==> Press on “Output type” button ==> Select any output type. For
Example : RD00 ==> Press on “Processing Routines” ==> here we can
configure Medium / Program / Form Routine / Form / PDF-SmartForm
Form.
Disadvantages:
If we deactivate the fields in the context, it will be difficult to use if needed
in the form anywhere. For example in Script editor ( to have some
conditional printing etc)
Difficult to handle when we want to print the nested tables
Limitation when we want to print non-standard tables
SubForm Method:
What is Subform?
The subform is part of the form which is used for organizing the different
elements like input fields, tables, texts present body pages and rarely
master pages.
In other words, Subform is nothing but a group of elements. If we want to
group certain elements on the layout we can use subform and wrap them
into it.
Advantages:
Using subforms gives us more flexibility when laying out tables.
When we want to print multiple rows of table, subform is more useful
We can rearrange cells in subform (Print wherever we want )
It is very useful when we are printing nested tables in the form.
I am sure if you have not worked in Tables before, the above advantages
and disadvantages might have definitely confused you. Do not worry.
Ignore the above comparison. We will do a hands-on with step by step
guide and by the time you finish creating the tables using both the methods
mentioned, the picture would be clear.
In this tutorial, our aim is to display Customer Data from Customer Master
Table KNA1 using both the methods. Let’s Adobe.
Enter the Interface name and Create (Interface is mandatory for Adobe
form).
Provide the short description and Interface name which you have created
earlier.
You should deactivate the fields from the Table which are not required to
print since there are many fields in the table, it will not fit in the form.
Go to layout tab
Insert a text variable to have some heading on the form.
Change the text as required.
You can change the font and size of the text in the marked section above.
————————————————————————————————
Ram’s Tip 1: If you do not find Font toolbar by default, you can activate it
as shown below.
————————————————————————————————
You can adjust the column height or width, by drag and drop option. If you
want to be very precise, you can also go to the properties in the right hand
side and adjust the width and height.
Save, Check, Activate the form.
Please note: If you have data in the IT_KNA1 table more than 1-page
size, it would not flow to the next page. You have to do the following two
Select IT_KNA1 And check the check box ‘Allow Page Breaks within
Content’.
——————————————————————————————————————
——
Some clients in some countries would like the table to have the row Layout
from Right to Left.
But, in case you want your rows from Right to Left, choose the layout from
the Table properties.
End of Update on 27th February 2017
——————————————————————————————————————
——
The output would display the table with the Customer Master data.
At this point, we are tempted to end this article. Reason being two. First, it
is 11:20 PM in the night and second, the article is already long. But we
decided to continue the post and include the Method 2 in the same post so
that the readers do not lose the continuity and flow of learning. So take a
quick water break and proceed to the next Method. It would be more
Go to layout
Every form will have Master page and Body page by default (Untitled
Subform) (page1).
In Simple definition, we can use Master page to print the header data
and Body page for printing the item data.
The content area is used for printing the data in Body page. We can change
the length or width of the content area in Master page.
————————————————————————————————
Ram’s Tip 3: At any point of your development, if you want to see the
basic output of your form, you just need to click on Preview PDF Tab.
————————————————————————————————
Go to design view
This Subform can be used as the header. Please note Untitled SubForm has
been renamed as Header in the left hand side.
Change the header form content to Flowed, and Flow direction to Western
text, so that fields will be displayed side by side.
Select your header Subform go to insert -> 0 – Standard -> Text field.
You need to change the properties of the text field for better display and
appearance.
Select the TextField1. Change the appearance from Sunken box -> Solid
box.
Change the position from left -> none.
Value entered from user entered from -> Read-only.
Select the Border as the solid color.
Copy and Paste the TextField1 in Header sub from. (In this case paste 4
times because we need 5 fields to display)
You can Change the name of the field.
We have created the Header row. Now, it is time to print the item data of
the table.
Copy the five fields Customer No, Country, Name, Street, and Telephone
and paste under items subform.
Binding is a very important part of Adobe. Make sure you bind the data
correctly.
Bind the fields as:
CustomerNo to KUNNR,
Country to LAND1,
Name to NAME1
Street to STRAS
Telephone to TELF1
You must check the checkbox Repeat Subform for each data item.
Did you check this? 4 Versions of the same program to learn OOPs
ABAP
In both the Methods above, we used the below driver program to call the
Adobe Form. Snap it in your development SAP system and test your newly
created tables in the Adobe.
1
2 *&---------------------------------------------------------------------*
3 *=======================================================
4 ===============*
5 * YRAM_ADOBE_FORM_PROGRAM2 *
6 *=======================================================
7 ===============*
8 * Project : SAP Adobe Forms Tutorial *
9 * Author : Ramanjula Naidu DARURU (www.SAPYard.com) *
1 * Description : Driver Program for Printing the Customer data *
0 *=======================================================
1 ===============*
1 REPORT yram_adobe_form_program2.
1
2 **&&~~ Data Objects
1 DATA: gv_fm_name TYPE rs38l_fnam, " FM Name
3 gs_fp_docparams TYPE sfpdocparams,
1 gs_fp_outputparams TYPE sfpoutputparams,
4 gt_kna1 TYPE STANDARD TABLE OF kna1.
1
5 CONSTANTS : gv_form_name TYPE fpname VALUE 'YRAM_ADOBE_FORM2'.
1
6 *=======================================================
1 ===============*
7 * START of TREATMENT *
1 *=======================================================
8 ===============*
1 START-OF-SELECTION.
9 SELECT * FROM kna1 INTO TABLE gt_kna1 UP TO 50 ROWS.
2 *&---------------------------------------------------------------------*
0 **&&~~ Form Processing: Call Form - Open
2 *
1 CALL FUNCTION 'FP_JOB_OPEN'
2 CHANGING
2 ie_outputparams = gs_fp_outputparams
2 EXCEPTIONS
3 cancel = 1
2 usage_error = 2
4 system_error = 3
2 internal_error = 4
5 OTHERS = 5.
2 IF sy-subrc <> 0.
6 " Suitable Error Handling
2 ENDIF.
7 *&---------------------------------------------------------------------*
2 **&&~~ Get the Function module name based on Form Name
8 *
2 CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
9 EXPORTING
3 i_name = gv_form_name
0 IMPORTING
3 e_funcname = gv_fm_name.
1 IF sy-subrc <> 0.
3 " Suitable Error Handling
2 ENDIF.
3 *&---------------------------------------------------------------------*
3 **&&~~ Take the FM name by execuing the form - by using Pattern-
3 **&&~~ call that FM and replace the FM Name by gv_fm_name
4 *
3 **&&~~ Call the Generated FM
5 CALL FUNCTION gv_fm_name "'/1BCDWB/SM00000176'
3 EXPORTING
6 /1bcdwb/docparams = gs_fp_docparams
3 it_kna1 = gt_kna1
7 EXCEPTIONS
3 usage_error = 1
8 system_error = 2
3 internal_error = 3
9 OTHERS = 4.
4 IF sy-subrc <> 0.
0 * Implement suitable error handling here
4 ENDIF.
1 *&---------------------------------------------------------------------*
4 **&&~~ Form Processing: Call Form - Open
2 *
4 CALL FUNCTION 'FP_JOB_CLOSE'.
3 IF sy-subrc <> 0.
4 * Implement suitable error handling here
4 ENDIF.
4 *&---------------------------------------------------------------------*
5 *&---- Close the spool job
4 CALL FUNCTION 'FP_JOB_CLOSE'
6 EXCEPTIONS
4 usage_error = 1
7 system_error = 2
4 internal_error = 3
8 OTHERS = 4.
4 IF sy-subrc <> 0.
9 * <error handling>
5 ENDIF.
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
8
5
8
6
Hopefully, you were not overwhelmed by this long long article. The future
tutorials on Adobe would not be this long. Promise!! As we keep saying, we
cannot learn to swim unless we wade through the water. So try practicing
the exercises 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.
Next Post in Series: Adobe Form Tutorial Part III : Date, Time and
Floating Fields in Adobe.
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.