Building Tree structure in WebDynpro application and Calling another WebDynpro application on clicking the nodes

...Previous

16. Bind DATASOURCE property of TreeItemType with TREETYPE node.

Create an action ON_FI for TreeItemType finance.

17. Now right click on BODY and create element TRAY2 of type tray.

Set element Tray2’s Property as below:

Layout Data: MatrixData , height : 413px , width : 90px. 

18. By right clicking on TRAY2 create element frame of type IFRAME.

Set element frame’s Property as below:

height : 500px , width : 700px.

19.Bind FRAME’s SOURCE property with TEXT1 as below.

20. Bind Tray’s caption’s text property with heading attribute.

21. Now click on Methods tab in the view and select onactionon_sales method and write a code as given below.

Note: Here value of lv_text1 is the link of another web dynpro application.

METHOD onactionon_sales .
  DATA: lo_el_context TYPE REF TO if_wd_context_node,
         r_element TYPE REF TO if_wd_context_element,
        lv_text1 TYPE string,
        lv_heading TYPE string.
  CLEAR: lv_text1,
         lv_heading.
  r_element = wd_context->get_element( ).
  CALL METHOD wd_context->get_child_node
    EXPORTING
      name       = 'NODE1'
    RECEIVING
      child_node = lo_el_context.
* Tray
  lv_text1 = 'http://:8000/sap/bc/webdynpro/sap/y_excel_upload?sap-language=EN'.
  lv_heading = 'SALES REPORT FOR UPLOADING DATA'.
* Set attributes for frame content
  CALL METHOD lo_el_context->set_attribute
    EXPORTING
      value = lv_text1
      name  = 'TEXT1'.
* Set attributes for frame heading
  CALL METHOD lo_el_context->set_attribute
    EXPORTING
      value = lv_heading
      name  = 'HEADING'.
ENDMETHOD. 

22. Now click on Methods tab in view and select onactionon_fi method and write a code as given below.Here code is same as below code.just you need to change heading text and link for the report.

METHOD onactionon_fi .
  DATA:  lo_el_context TYPE REF TO if_wd_context_node,
         r_element TYPE REF TO if_wd_context_element,
         lv_text1 TYPE string,
         lv_heading TYPE string.
  CLEAR: lv_text1,
         lv_heading.
  r_element = wd_context->get_element( ).
  CALL METHOD wd_context->get_child_node
    EXPORTING
      name       = 'NODE1'
    RECEIVING
      child_node = lo_el_context.
* Tray
  lv_text1 = 'http://:8000/sap/bc/webdynpro/sap/y_error_message?sap-language=EN'.
  lv_heading = 'FINANCE REPORT'.
* Set attributes for frame content
  CALL METHOD lo_el_context->set_attribute
    EXPORTING
      value = lv_text1
      name  = 'TEXT1'.
* Set attributes for frame heading
  CALL METHOD lo_el_context->set_attribute
    EXPORTING
      value = lv_heading
      name  = 'HEADING'.
ENDMETHOD.

23. Right click on Application and select Create then Mime Object and then Import as shown as below.

Select an image from your desktop that you want to display as logo.

24. Now in view’s layout right click on ROOTUIELEMENTCONTAINER and insert an element image. Order should be like below for image.

25.Set Property of image like below.

Width : 870 px.

Set its Source property by pressing F4. as below.

26.Create a web dynpro application by right clicking.

27. Test Application by right clicking on above application.

OUTPUT:

Click on Sales Link From Left Tree

By clicking on Finance Link following will be displayed.

Note: Here you can use more than one IFRAME element in the same view for displaying various reports or Web DynPro application.
 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image