Beruflich Dokumente
Kultur Dokumente
In the Create Interface pop-up give a description and then click on the
Save button.
Similarly, double click on the Global Data in the Global Definitions and
create a new variable PA0006 of type PA0006.
DATA :
lt_p0006
REFRESH
lt_p0006.
= 'A'
pernr
= pernr
infty
= '0002'
begda
= '18000101'
endda
= '99991231'
TABLES
infty_tab
= lt_p0006
EXCEPTIONS
infty_not_found = 1
OTHERS
= 2.
IF sy-subrc <> 0.
*
Come back to the main screen of the transaction SFP, select the radio
button Form, give your form a name and click on the create button.
In the Create Form pop-up box enter a description and the interface name
created in Step 1, then click on the save button.
Drag and drop all required fields from the Data View to the Body Pages,
and set the field properties as per your requirement.
In the create object pop-up click on the Yes button to create a new Web
Dynpro Application. Enter the description and choose the Type radio
button as Web Dynpro Component.
Now go to the Layout tab and insert a new Label UI, an Input field UI and a
Button UI element in the ROOTELEMENTCONTAINER.
Bind the Input field UI elements value property with the context attribute
PERNR.
Copy and paste the code below to the event handler ON ACTION
SHOW_FORM.
method ONACTIONSHOW_FORM .
DATA
`PERNR`
IMPORTING
value = lv_PERNR ).
gs_fpoutparams-nodialog = 'X'. " suppress printer dialog popup
gs_fpoutparams-getpdf = 'X'.
*
gs_fpoutparams-getxml = 'X'.
= 1
usage_error
= 2
system_error
= 3
internal_error
= 4
OTHERS
= 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
ENDIF.
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name
= 'Y_FORM'
IMPORTING
e_funcname = gv_fmname.
CATCH cx_root INTO lv_w_cx_root.
lv_mesg = lv_w_cx_root->get_text( ).
*
ENDTRY.
CALL FUNCTION gv_fmname
EXPORTING
pernr
= lv_pernr
IMPORTING
/1bcdwb/formoutput = formoutput.
IF sy-subrc <> 0.
*
*
ENDIF.
CALL FUNCTION 'FP_JOB_CLOSE'
* IMPORTING
*
E_RESULT
EXCEPTIONS
usage_error
= 1
system_error
= 2
internal_error
= 3
OTHERS
= 4.
cl_wd_runtime_services=>attach_file_to_response( i_filename
= 'SAP_ADO
BE_FORM.pdf'
i_content
= formoutput-pdf
i_mime_type = 'application/pdf' ).
endmethod.
Create the Web Dynpro Application by right clicking the Web Dynpro
Component. Give your application a name and description.
Closing Notes:
You can also call the Adobe Form in Web Dynpro Application by using the
UI element Interactive-Form. But, it is a good idea to design your ADOBE
form separately in transaction code SPF as shown in this tutorial. This way
you can also call the same form in reports and other applications too.
Also, instead of opening the Adobe form in the web browser, we have used
the method attach_file_to_response( ) of
class cl_wd_runtime_services to open the ADOBE form via download
pop-up, this is also a good way because many a times users have
performance issues when showing the form in the web browser.