码迷,mamicode.com
首页 > 其他好文 > 详细

Call Adobe Form through ABAP Program

时间:2015-04-23 17:33:20      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:adobe form

Scenario

Create an Adobe Form and call it through an ABAP Program

Pre-request:

1)  In the Front End System Adobe Life Cycle Designer has to install. Then only the Adobe Form  Layout  and Adobe form will open in the SAP system
2)  Adobe Reader 8.0 and above version has to installed

Steps to Create and Call the adobe form

1)  Create a Table Type for a Table
 2) Create the Interface for the Adobe Form
3)  Create the Adobe Form and design the layout
4)  Write a Program to Call the Adobe Form

Step by Step Approach

1)   Create a  Table Type for a Table

Go to the Transaction Code "SE11" and give the Table Type name as "zmari_tb1".

 

技术分享
Then click "Create" and a popup will appear as shown below.

Select the radio button "Table Type" and press enter

技术分享

 

Enter the Table Name ‘MARI‘ in the line type.
技术分享

 

Then save it as Local Object and activate it.

技术分享

 

Activate the Table Type.

技术分享

 

2) Create the Interface for the Adobe Form

Go to Transaction code ‘SFP‘ and create the Interface for the ADOBE FORM

Enter the Interface Name as ‘ZSUR_ADOBE_INTR‘ and click "Create"

技术分享

 

Give the Description and click save.

技术分享

 

Give Description and press enter

技术分享

 

Save as Local Object

技术分享

 

Then the below screen will appear.

技术分享

 

Then Click "Append Row" icon as indicated below.
技术分享

 

Then as new row will inserted and assign the Table Type ZMARI_TBL value as shown below.

技术分享

 

Then activate it.

技术分享

 

Then go back and Give the Adobe Form name click Create.

 3) Create Adobe Form and design the layout in the Same Transaction Code "SFP"

技术分享

 

Give the Description and the Interface name, which just created as indicated below.

技术分享

 

Then Save as Local Object.

技术分享

 

Then the below Screen will appear.

技术分享

 

Expand the import button and you can find the Table Parameter ZMARI.

技术分享

 

Then Drag and drop it to the Context as shown below

技术分享

 

After Drag and Drop the Table type to Context, then below screen will appear.

技术分享

 

Then Click the "Layout" Tab and the Below Screen will appear.

技术分享

 

Drag and Drop the table type "ZMARI" to Design View Layout as indicated below.

技术分享

 

Then adjust the Table in the Top center of the layout as shown below. 
技术分享

 

Select the ‘Text‘ from the Library and drop it the Layout ‘Design" View and give a description to the Table as shown below.

技术分享

 

技术分享

 

Then Activate the Adobe form

技术分享

 

4) Write a Program to Call the Adobe Form


Go to Transaction code SE38 and Create a Test Program "ZCALL_ADOBE_FORM". 

技术分享

技术分享

 

Save it as local Object.

技术分享

 

Then enter the Below Code.

技术分享

 

REPORT  zcall_adobe_form.
&-----------------------------------------------------------------------&
*& Author  : P Surjith Kumar
*& Purpose : Call the Adobe form in the ABAP Program
*&------------------------------------------------------------------------
DATA: fm_name           TYPE rs38l_fnam,      " CHAR300 Name of Function Module
      fp_docparams      TYPE sfpdocparams,    " Structure  SFPDOCPARAMS Short Description  Form ParametersforForm Processing
      fp_outputparams   TYPE sfpoutputparams, " Structure  SFPOUTPUTPARAMS Short Description  Form Processing Output Parameter
      it_mari           TYPE zmari_tbl.       " Table Type ZMARI_TBL MARI Table Tyoe
* Sets the output parameters and opens the spool job
CALL FUNCTION ‘FP_JOB_OPEN‘                   "& Form Processing: Call Form
  CHANGING
    ie_outputparams = fp_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‘           "& Form Processing Generation
  EXPORTING
    i_name     =‘ZSUR_ADOBE_FORM‘
  IMPORTING
    e_funcname = fm_name.
IF sy-subrc <> 0.
*  <error handling>
ENDIF.
*-- Fetch the Data and store it in the Internal Table
SELECT * FROM mari INTO TABLE it_mari UP TO15ROWS.
* Language and country setting (here US as an example)
fp_docparams-langu   =‘E‘.
fp_docparams-country =‘US‘.
*&--- Call the generated function module
CALL FUNCTION fm_name
  EXPORTING
    /1bcdwb/docparams        = fp_docparams
    zmari                   = it_mari
*    IMPORTING
*     /1BCDWB/FORMOUTPUT       =
  EXCEPTIONS
    usage_error           =1
    system_error          =2
    internal_error           =3.
IF sy-subrc <> 0.
*  <error handling>
ENDIF.
*&---- Close the spool job
CALL FUNCTION ‘FP_JOB_CLOSE‘
*    IMPORTING
*     E_RESULT             =
  EXCEPTIONS
    usage_error           =1
    system_error          =2
    internal_error        =3
    OTHERS               =4.
IF sy-subrc <> 0.
*            <error handling>
ENDIF.

 

Then activate and Execute (F8) it.

技术分享

 

Then the printer screen will appear.
技术分享

 

Click the Print Preview

技术分享

 

Then the Output will shown as below.

技术分享

Call Adobe Form through ABAP Program

标签:adobe form

原文地址:http://blog.csdn.net/champaignwolf/article/details/45222813

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!