You are on page 1of 6

Web Dynpro ABAP

A Simple Web Dynpro Application to display a pdf file in the browser window
Here is a simple web dynpro application to show the use of U! Element ' !nteractiveform' and thus importing and displaying an adobe pdf file .
in SE80 transactiion select web Dynpro compfint create 8 save by assigning a name.



in the following window give viewName 8 Window Name


Goto the context tab of main view and create an Attribute of type Xstring.




Added by Ndi.Deeba , last edited by Ndi.Deeba on Jun 08, 2009 (view change)
Labels: webdynpro, abap, adobe, pdf, interactive, form, display, file, application, interactive_form

Goto the Layout tab of the view and create an element of type Interactive form.

InteractiveForm:
You can use the !nteractiveForm U! element to insert an interactive or a non-interactive PDF form into a view. This enables you to create and design a form from scratch.
!n the standard system the form context is predetermined by an XNL schema, which is generated at design time on the basis of the Web Dynpro context.
The form builder is automatically called when you edit the !nteractiveForm U! element inserted into the view. You edit the !nteractiveForm U! element by double-clicking on the U! element in the view
Designer.When using the !nteractiveForm U! element you cannot display two !nteractiveForm U! elements at the same time in the browser window.
Presently we display a non-interactive PDF form in the browser.


Create binding for the field pdfsource by clicking on the pushbutton provided.

Select the attribute PDF by double clicking on it.



Select the Component Z_Adobe -> Create -> Mime Object -> Import

Browse 8 Upload a pdf file that is to be displayed.assign a name 8 Save
here Name : test.pdf -> the same name will b mentioneed in coding part.


Goto* Nethods tab* of the main view and write the following code in the method WDDOINIT

method WDDO!N!T .
data: mime_repository type ref to if_mr_api,
url type string value 'fSAPfBCfWEBDYNPROfSAPfZ_ADOBEfTEST.PDF',
content type xstring.
CALL NETHOD cl_mime_repository_api=>if_mr_api~get_api
receiving
r_mr_api = mime_repository .
*method get:to supply contents of a mime object
CALL NETHOD mime_repository->get*
EXPORT!NG
i_url = url
!NPORT!NG
e_content = content
EXCEPT!ONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = +
others = 5.
*method set_attribute : sets the content of individual attribute
CALL NETHOD wd_context->set_attribute*
EXPORT!NG
value = content
name = 'PDF' .
endmethod.
Activate the component 8 Create a Web Dynpro Application.
Create-> Web Dynpro Application





The following Non !nteractive Form Output is obtained.
Contact Us Site !ndex Narketing Opportunities Legal Terms Privacy !mpressum
Powered by SAP NetWeaver

You might also like