Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com
Webdynpro ABAP

Business Graphics

 

 

Scenario :  Let us create a table with some records in it. Based on the selected record, The datas in the selected row should be displayed in a Graphical format. The graphical format by default will be Column type which we can change later.

 

 

Step 1: Create a webdynpro component as shown below.

 

clip_image002

 

 

Step 2:  Create a Context node EKPO with some attributes.

clip_image004

 

 

 

 

Step 3: Insert a table UI element and bind the context node to the table.

 

clip_image006

 

Step 4 : Populate the context node in the WDDOINIT method.

 

clip_image008

 

 

Step 5: Save and activate the whole component and test the application.

 

Output:

clip_image010

 

 

 

 

 

Step 6: Create a context node similar to that of the node EKPO to bind the values to the Graphics UI element.

 

clip_image012

 

 

Copy the context node from the view.

 

clip_image014

 

 

 

 

 

 

Select the node which you want to copy.

clip_image016

Rename the context node and save it.

 

clip_image018

 

clip_image020

 

 

 

clip_image022

 

  

Step 7 : In the layout tab of the view controller insert the Business graphics UI element.

 

clip_image024

 

 

 

clip_image026

 

 

clip_image028

 

For the X axis, Insert the category UI element in the Business graphics.

 

clip_image030

 

For Y axis, Insert Simple series UI element.

 

clip_image032

 

clip_image034

 

Similiarly create series for all the Context attributes.

 

clip_image036

 

 

clip_image038

 

clip_image040

 

 

Similarly bind the series1 and series2.

 

clip_image042

 

 

clip_image044

 

Map the properties of the Business UI element to the series source property.

clip_image046 

 

 

 

 

Select the UI element table and create an action for onlead.

 

clip_image048

 

In the action onlead, read the row which is selected and set it back to the context node business which is mapped to the business graphics UI element.

 

method ONACTIONONLEAD .
   
DATA LO_ND_EKPO TYPE REF TO
IF_WD_CONTEXT_NODE.

   
DATA LO_EL_EKPO TYPE REF TO
IF_WD_CONTEXT_ELEMENT.
   
DATA LS_EKPO TYPE
WD_THIS->ELEMENT_EKPO.

*   navigate from <CONTEXT> to <EKPO> via lead selection

    LO_ND_EKPO = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_EKPO ).

*   get element via lead selection
    LO_EL_EKPO = LO_ND_EKPO->GET_ELEMENT( ).

*   get all declared attributes
    LO_EL_EKPO->GET_STATIC_ATTRIBUTES(
     
IMPORTING
        STATIC_ATTRIBUTES = LS_EKPO ).


 
DATA LO_ND_BUSINESS TYPE REF TO IF_WD_CONTEXT_NODE.

 
DATA LT_BUSINESS TYPE
WD_THIS->ELEMENTS_BUSINESS.

* navigate from <CONTEXT> to <BUSINESS> via lead selection

  LO_ND_BUSINESS = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_BUSINESS ).

 
append ls_ekpo to lt_business.
*

  LO_ND_BUSINESS->BIND_TABLE( NEW_ITEMS = LT_BUSINESS SET_INITIAL_ELEMENTS = ABAP_TRUE ).

endmethod.

 

 

 

 

 

 

 

 

 

 

Step 8: Save and activate the whole application. Test the output.

 

clip_image050

 

clip_image052

 

 

 

 

About Arun

9 Comments:

  1. What is ZCSK_BUSINESS_GRAPH component. I think we need to create it manually. But I am not able to find information about that

    ReplyDelete
  2. Jordanian specialists became serious competitors against other Arab countries which had previously monopolised the fields of design and printing. https://medijo.lt/vizitines-korteles/

    ReplyDelete
  3. Some portion of beginning another bookkeeping business is choosing for logo bookkeeping that would make you particular among other bookkeeping firms. By having a viable logo structure, you are really making a focused on spotlight on the promoting endeavors and this will empower you to achieve accomplishment in your line of business. logo design service

    ReplyDelete
  4. Thanks for your insight for your fantastic posting. I’m exhilarated I have taken the time to see this. It is not enough; I will visit your site every day. Image background removal service

    ReplyDelete
  5. Your article provide me huge knowledge related to Cliping path services.
    Thanks for sharing this post.nettoyage résidentiel

    ReplyDelete
  6. In the event that your advanced camera bolsters a more slow shade speed, it is as yet workable for you to shoot some brilliant activity shots. Background removal service

    ReplyDelete
  7. Good post but I was wondering if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit further. Appreciate it..! Corporate Headshots

    ReplyDelete
  8. The exceptional business and enterprising aptitudes exhibited by Ghanaian business ladies should be hailed and recognized even as the world praises moms this week. payroll singapore

    ReplyDelete
  9. one thing that i like about the blog could be that the information is very helpful and keeps one informed on issues related to politics.  affiliate marketing

    ReplyDelete

Powered by Blogger.