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

SAP Adobe Form

The document describes the steps to create a simple Adobe form and call it from an ABAP program. Step 1 involves creating a form interface with importing parameters. Step 2 is to create and design the form, binding importing parameters to the form fields. Step 3 is to create an ABAP driver program that calls the generated function module to open a spool job, pass parameters to the form, and close the spool job. Step 4 is to execute the driver program.

Uploaded by

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

SAP Adobe Form

The document describes the steps to create a simple Adobe form and call it from an ABAP program. Step 1 involves creating a form interface with importing parameters. Step 2 is to create and design the form, binding importing parameters to the form fields. Step 3 is to create an ABAP driver program that calls the generated function module to open a spool job, pass parameters to the form, and close the spool job. Step 4 is to execute the driver program.

Uploaded by

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

SAP Adobe Form - Steps to create simple ADOBE Form and calling it

from ABAP Program


SAP ADOBE Forms is part of SAP Web Application Server. To develop SAP Adobe
forms you will require the Adobe Life Cycle Designer installed in your system and Adobe
Document Services (ADS) installed and configured on the server.

Step 1: Create the Form Interface

Go to transaction SFP(Form Builder).

Create Interface(ZOVH_INTERFACE) by selecting Interface radio button.

Provide interface Description and Select ABAP Dictionary-Based Interface as


Interface Type.

Save as Local object or transportable object.

Interface TabImportCreate three importing parameters(PERNR, ENAME,


BUKRS).

Save and Activate.

Step 2: Create and Design the Form

Go to transaction SFP(Form Builder).

Create Form(ZOVH_SIMPLE_FORM) by selecting Form radio button.

Provide form Description and provide Interface as ZOVH_INTERFACE created in


the above step.

Save as Local object or transportable object.

Context TabOpen Import nodeSelect all importing parameters(PERNR,


ENAME, BUKRS) by holding CTRL key, drag and drop parameters from Interface area
to Context area as shown in the screen shot.

Layout TabClick on Layout button. You can view form designer in larger.

Click on Data View tab on the form. Drag parameter(PERNR, ENAME and
BUKRS) and drop on to the form. By doing this binding will take place automatically.

Save and Activate. When you activate, system generate function module.

Step 3: Create ABAP Driver program to call Form

Go to transaction SE38(ABAP Editor) and create an executable


program ZTEST_SIMPLE_ADOBE.

Save as Local object or transportable object.

Program steps
o

Get the function module of generated Form


using FP_FUNCTION_MODULE_NAME.

Open the spool job using function module FP_JOB_OPEN.

Call the generated function module.

Close the spool using function module FP_JOB_CLOSE.

Program code

REPORT ztest_simple_adobe.
*&--------------------------------------------------------------------&
* Declarations

*&--------------------------------------------------------------------&
TYPES:
ty_outputparams TYPE sfpoutputparams, "Form Parameters for Form
Processing
ty_docparams
TYPE sfpdocparams.
"Form Processing Output
Parameter
DATA:
wa_outputparams TYPE sfpoutputparams,
wa_docparams
TYPE sfpdocparams.
DATA:
gv_fm_name
TYPE rs38l_fnam,
gv_pernr
TYPE pa0001-pernr,
gv_ename
TYPE pa0001-ename,
gv_bukrs
TYPE pa0001-bukrs.
*&--------------------------------------------------------------------&
* Selection-Screen
*&--------------------------------------------------------------------&
PARAMETERS:
p_pernr
TYPE pa0001-pernr.

*&--------------------------------------------------------------------&
* Start-Of-Selection
*&--------------------------------------------------------------------&
START-OF-SELECTION.

" Sets the output parameters and opens the spool job
wa_outputparams-device
= 'PRINTER'.
wa_outputparams-dest
= 'LP01'.
wa_outputparams-NODIALOG = 'X'.
wa_outputparams-preview
= 'X'.

CALL FUNCTION 'FP_JOB_OPEN'


CHANGING
ie_outputparams = wa_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
= 'ZOVH_SIMPLE_FORM'
IMPORTING
e_funcname = gv_fm_name.
IF sy-subrc <> 0.
"<error handling>
ENDIF.

wa_docparams-langu
= 'E'.
wa_docparams-country = 'SG'.

" Fetch the Data and store it in the Internal Table


SELECT SINGLE pernr ename bukrs
FROM pa0001
INTO (gv_pernr, gv_ename, gv_bukrs)
WHERE pernr EQ p_pernr.

CALL FUNCTION gv_fm_name


EXPORTING
pernr
= gv_pernr
ename
= gv_ename
bukrs
= gv_bukrs
EXCEPTIONS
usage_error
= 1
system_error
= 2
internal_error = 3.

" Close the spool job


CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error
= 1
system_error
= 2
internal_error = 3
OTHERS
= 4.
IF sy-subrc <> 0.
" <error handling>
ENDIF.

Step 4: Execute driver program

Execute the program ZTEST_SIMPLE_ADOBE.

Selection Screen.

Output

You might also like