Skip to end of metadata
Go to start of metadata

Here is a simple web dynpro application to show the use of UI Element  ' Interactiveform'  and thus importing  and displaying an  adobe pdf   file .
in SE80 transactiion select  web Dynpro comp/int   create & save by assigning a name.
 
 

 in the  following window give ViewName & Window Name

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




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

InteractiveForm:

You can use the InteractiveForm UI 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.

In the standard system the form context is predetermined by an XML 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 InteractiveForm UI element inserted into the view. You edit the InteractiveForm UI element by double-clicking on the UI element in the View Designer.When using the InteractiveForm UI element you cannot display two InteractiveForm UI 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 & Upload a pdf file that is to be displayed.assign a name  & Save

here Name : test.pdf  -> the same name will b mentioneed in coding part.

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

method WDDOINIT .

data: mime_repository type ref to if_mr_api,

url type string value '/SAP/BC/WEBDYNPRO/SAP/Z_ADOBE/TEST.PDF',

content type xstring.

CALL METHOD 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 METHOD mime_repository->get*

EXPORTING

i_url = url

IMPORTING

e_content = content

EXCEPTIONS

parameter_missing = 1

error_occured = 2

not_found = 3

permission_failure = 4

others = 5.

*method set_attribute : sets the content of individual attribute

CALL METHOD wd_context->set_attribute*

EXPORTING

value = content

name = 'PDF' .

endmethod.

 Activate the component & Create a Web Dynpro Application.

Create-> Web Dynpro Application




 
The following Non Interactive Form Output is obtained.