Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

Embed Size (px)

Citation preview

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    1/23

    Demo scenario on Adobe Forms using ABAP WebDynpro - Part 2

    By G.K.Akbar, The Washington Post

    In the earlier example , we have created a WebDynpro application to populate the data into thecustom table ZDEPT. In this, we would display the data from the ZDEPT using ABAP WebDynpro.

    Following are the contents of the table:

    Create a table type ZDEPTTBL for table ZDEPT

    http://www.saptechnical.com/Tutorials/AdobeForms/UsingABAPDynpro/Page1.htmhttp://www.saptechnical.com/Tutorials/AdobeForms/UsingABAPDynpro/Page1.htmhttp://www.saptechnical.com/Tutorials/AdobeForms/UsingABAPDynpro/Page1.htm
  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    2/23

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    3/23

    Save the Interface

    Create Transport for the Interface

    Enter the Import parameter ZDEPT and type ZDEPTTBL. Save and activate the interface

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    4/23

    Create the form ZDEPFRM

    Enter the Interface Name as ZDEPTINF

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    5/23

    Save the form

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    6/23

    Drag and drop the Node ZDEPT onto the context

    Go to the Layout tab and Drag & Drop the ZDEPT node on to the form layout, Save and Activatethe form

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    7/23

    You can also create a Report program (Print Program) and call the above mentioned form, but weare going to write the print program logic in the Web Dynpro.

    Go to transaction SE80 and create a Web Dynpro component Z_NON_INT_FRM.

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    8/23

    Press Yes to create the object

    Enter the details as show below and press enter

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    9/23

    Save and enter a workbench request

    You can see the Component Controller, Interface controller and window being created

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    10/23

    Create a view as shown below:

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    11/23

    Give the Name of the View as MAIN_VIEW

    Go to the layout tab of the MAIN_VIEW and create a place holder for the adobe form as shownbelow

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    12/23

    Give the name of the node as adobe and type Interactive form

    In the properties list set the Height and width and the template source as ZDEPFRM this is theactual name of the adobe form which we have created earlier, you can see the interface context isautomatically mapped to the data source.

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    13/23

    You can see the mapped data source in the context tab of the MAIN_VIEW

    Go to the Methods table of the MAIN_VIEW and double click on the WDDOINIT method,

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    14/23

    We are going to write the print programs logic in this method, we are not going to use the standardfunction modules that we use normally in the Report print program such as

    FP_JOB_OPEN, FP_FUNCTION_MODULE_NAME, FP_JOB_CLOSE.

    Copy and Paste the below given code in the method.

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    15/23

    method WDDOINIT .data:

    Node_Zdepfrm type ref to If_Wd_Context_Node,Elem_Zdepfrm type ref to If_Wd_Context_Element,Stru_Zdepfrm type If_Main_View=>Element_Zdepfrm ,Item_ZDEPT like Stru_Zdepfrm-ZDEPT,i_dept type zdepttbl.

    * navigate from to via lead selectionNode_Zdepfrm = wd_Context->get_Child_Node

    ( Name = IF_MAIN_VIEW=>wdctx_Zdepfrm ).

    * @TODO handle not set lead selectionif ( Node_Zdepfrm is initial ).endif.

    * get element via lead selectionElem_Zdepfrm = Node_Zdepfrm->get_Element( ).

    * @TODO handle not set lead selectionif ( Elem_Zdepfrm is initial ).

    Elem_Zdepfrm = Node_Zdepfrm->create_element( ).endif.

    select * from zdept into table i_dept.Item_Zdept = i_dept.

    * get single attributeElem_Zdepfrm->set_Attribute(

    exportingValue = Item_ZdeptName = `ZDEPT`).

    Node_Zdepfrm->bind_element( Elem_Zdepfrm ).

    endmethod.

    Go to the window Z_NON_INT_FRM and select the window tab as shown below

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    16/23

    Drag and Drop the MAIN_VIEW on to the window

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    17/23

    Save and activate the Web Dynpro

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    18/23

    Create a Web Dynpro application as show below

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    19/23

    Enter the name of the application Z_NON_INT_FRM and save the application

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    20/23

    Test the Web Dynpro application

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    21/23

    Logon with you credentials enter the username and password.

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    22/23

    You can see the output in the form below.

  • 7/31/2019 Demo Scenario on Adobe Forms Using ABAP WebDynpro - Part 2

    23/23