Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

10/18/2014

An SAP Consultant: Integration of SAP Adobe Forms with Web Dynpro ABAP Application

An SAP Consultant
HOME

ABAP

ALV

SMART FORMS

ADOBE FORMS

HR ABAP

WORKFLOW

WEB DYNPRO ABAP

Tuesday, April 15, 2014

Integration of SAP Adobe Forms with Web Dynpro ABAP


Application
In this tutorial we create simple Adobe Form showing Employee details and then calling this form in Web Dynpro

HCM

Want to Contribute ?

If you are interested in writing about the new stu

you learn everyday while working, please write t


the.sap.consultants@gmail.com.

ABAP application.

Tutorial Steps
Step 1: Create the Form Interface
Step 2: Create and Design the Form

Click on Contribution for more details.


Find us on Facebook

An SAP Consultant

Check Simple ADOBE Form and calling it from ABAP Program for Step 1 & Step 2.

Like

Step 3: Creating Web Dynpro ABAP Component

575 people like An SAP Consultant.

Create Web Dynpro Component(ZOVH_WD_ADOBE) with window name W_WINDOW with default iview
V_VIEW.

Followers
Join this site
w ith Google Friend Connect

Members (30)

Save as local object or transportable object.


Double click on V_VIEW->Context tab: Define one attribute ADOBE_FORM(of type XSTRING) for the
PDF that comes from Adobe forms.
Already a member? Sign in

Popular Posts

http://www.an-sap-consultant.com/2014/04/Integrating-Adobe-forms-in-Webdynpro-ABAP.html

ABAP - ALV Report example with steps

Execute ABAP Report using SUBMIT


statement

Web Dynpro ABAP ALV - ON_CLICK event

ABAP - Dynamic WHERE clause

ABAP - Download report output as PDF file

ABAP - Sending email with pdf attachment

ABAP - ALV Demo programs

ABAP - Binary to String, String to XSTRING,


String to Binary

1/5

10/18/2014

An SAP Consultant: Integration of SAP Adobe Forms with Web Dynpro ABAP Application
9
10

Web dynpro abap Error / Success message


sample program
Web Dynpro ABAP - Download file

ABAP-Categories
SAP ABAP - (00)-Enhancement
SAP ABAP - (01)-BADIs
SAP ABAP - (02)-User Exits
SAP ABAP - ALV
SAP ABAP - Application Server
SAP ABAP - Background jobs
SAP ABAP - BDC - Batch Input Session
SAP ABAP - BDC related
SAP ABAP - Class
Layout tab: Insert screen element ADOBE_FORM(of type InteractiveForm) to display Adobe form in PDF
format.

SAP ABAP - Control framework


SAP ABAP - Date n Time function modules
SAP ABAP - Debugging
SAP ABAP - Dialog Programming
SAP ABAP - Dictionary
SAP ABAP - Dynamic Programming
SAP ABAP - FTP related
SAP ABAP - Function Modules
SAP ABAP - General
SAP ABAP - Get Last Day of The Month
SAP ABAP - Native n Open SQL
SAP ABAP - Objects
SAP ABAP - PDF Generation
SAP ABAP - Program Variants
SAP ABAP - Sapscripts
SAP ABAP - Scripts n Smartforms
SAP ABAP - Selection Screen

Goto ADOBE_FORM element properties->Bind PdfSource property with ADOBE_FORM attribute for
Context.

SAP ABAP - Sending Mails


SAP ABAP - Smartforms
SAP ABAP - Tab. Maint.Generator
SAP ABAP - Tables
SAP ABAP - Tips n Tricks
SAP ABAP - Transport Mgmt
SAP ABAP - Zipping in ABAP

http://www.an-sap-consultant.com/2014/04/Integrating-Adobe-forms-in-Webdynpro-ABAP.html

2/5

10/18/2014

An SAP Consultant: Integration of SAP Adobe Forms with Web Dynpro ABAP Application

Websites I follow
HTML/CSS/Javscript Generator
Easy CSS3 Generator
Digital Inspiration
Shout ME Loud
Twitter Feed

Methods tab->WDDOMODIFYVIEW method. Here we write code to get the PDF format of ADOBE form.
Get the function module of generated Form using FP_FUNCTION_MODULE_NAME. Set GETPDF to 'X'
Open the spool job using function module FP_JOB_OPEN.
Call the generated function module. Get PDF data
Close the spool using function module FP_JOB_CLOSE.
Pass PDF to Context attribute for PDF.
Code
METHOD wddomodifyview .
TYPES:
ty_outputparams TYPE sfpoutputparams, "Form Parameters for Form Processing
ty_docparams
TYPE sfpdocparams,
"Form Processing Output Parameter
ty_fpformoutput TYPE fpformoutput.
DATA:
wa_outputparams TYPE ty_outputparams,
wa_docparams
TYPE ty_docparams,
wa_fpformoutput TYPE ty_fpformoutput.
DATA:
gv_fm_name
TYPE rs38l_fnam,
gv_pernr
TYPE pa0001-pernr,
gv_ename
TYPE pa0001-ename,
gv_bukrs
TYPE pa0001-bukrs.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context
TYPE wd_this->element_context.
DATA lv_adobe_form TYPE wd_this->element_context-adobe_form.
DATA:
c_pernr TYPE pernr_d VALUE '10008289'.
" 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'.
wa_outputparams-getpdf
= 'X'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = wa_outputparams
http://www.an-sap-consultant.com/2014/04/Integrating-Adobe-forms-in-Webdynpro-ABAP.html

3/5

10/18/2014

An SAP Consultant: Integration of SAP Adobe Forms with Web Dynpro ABAP Application

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 c_pernr.
CALL FUNCTION gv_fm_name
EXPORTING
pernr
= gv_pernr
ename
= gv_ename
bukrs
= gv_bukrs
IMPORTING
/1bcdwb/formoutput = wa_fpformoutput
EXCEPTIONS
usage_error
=1
system_error
=2
internal_error
= 3.
lv_adobe_form = wa_fpformoutput-pdf.
" 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.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* set single attribute
lo_el_context->set_attribute(
NAME = `ADOBE_FORM`
VALUE = lv_adobe_form ).
ENDMETHOD.

Step 4: Creating Web Dynpro ABAP Application


Create web dynpro Application(ZOVH_WD_ADOBE) for the component.
Run the application
Output

http://www.an-sap-consultant.com/2014/04/Integrating-Adobe-forms-in-Webdynpro-ABAP.html

4/5

10/18/2014

An SAP Consultant: Integration of SAP Adobe Forms with Web Dynpro ABAP Application

Recommend this on Google

0 comments:
Post a Comment

Your use ful com m e nts, sugge stions are appre ciate d.Your com m e nts are m ode rate d.

Enter your comment...

Comment as:

Publish

Google Account

Preview

An SAP Consultant
Contact US

About US

Follow US
Facebook

Follow by Email
Email address...

Twitter

Privacy Policy
LinkedIn
Google

B logger Template created with Artisteer by .

http://www.an-sap-consultant.com/2014/04/Integrating-Adobe-forms-in-Webdynpro-ABAP.html

5/5

You might also like