on 03-20-2009 11:38 AM
Hi,
I have some data which i need to show in bar chart when I click a button.
So, can you guide me the procedure to do so.
Thanks and Regards
Tenzin
To display graph in popup -
1) Embed 'BusinessGraphicsUIElement' in the view
2) Embed this view in a window
3) Write logic to fetch data for graph in this view
4) Write following code to open this window in the event of button click
data: l_window_manager type ref to if_wd_window_manager,
window type ref to if_wd_window,
api_component type ref to if_wd_component.
api_component = wd_comp_controller->wd_get_api( ).
l_window_manager = api_component->get_window_manager( ).
Create window and pass parameters
call method l_window_manager->create_window
exporting
modal = abap_true
window_name = 'W_ABC'
title = 'ABC'
close_button = abap_true
receiving
window = wd_comp_controller->z_window.
wd_comp_controller->z_window->open( ).
*z_window is an public attribute of type IF_WD_WINDOW declared in Componentcontroller
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Declare 'z_window' as publicin componentcontroller (tick both checkboxes).
To pass the data,
1) create a node in componentcontroller
2) map it with both the views
3) collect data in the internal table
4) using bind_table( ) method, bind data to the node
5) map this node Graph UI element
step 3 & 4 can be implemented in any view (i.e. either main view or popup view)
Tenzin,
No, we can't do that. You have two ways two ways to do it.
- Create a node in your component controller and drag and drop it over the context of view controller. This way both the nodes will be mapped
or
- Create a node in component controller and then go the view controller, create a similar node with similar attributes (same as in component controller). Right click on it, select 'define mapping' and then select the node in the component controller. This will map the two node.
Regards
Arjun
Hi,
I have created the node in component controller and mapped to both the views. then i am passing the data to the context node of the view which is calling the chart view. to the chart view i have created the business graphics element and binded with the context node, but i am not getting the chart...
1) is it necessary to bind only to table or wat.
2) while refering to the context node in the view, how do i refer it, as the current node which is mapped to the current node or do i need to refer to the componenent controller? can u give me a demo code as to how to refer to the component controller so that data is reflected from both the views.
thanks and regards
Tenzin
Hi Tenzin,
while refering to the context node in the view, how do i refer it, as the current node which is mapped to the current node or do i need to refer to the componenent controller? can u give me a demo code as to how to refer to the component controller so that data is reflected from both the views.
I am not sure what exactly you are trying to ask here, but if you want to refer a node in any view which is mapped to component controller, simply read that node with the help of code wizard. If both the nodes are mapped then they'll contain same data at all time. You cannot refer to any node present in the component controller from view controller without mapping them. If you want to refer to any node in component controller, simply map it in the view and then just read it.
I hope it helps.
Regards,
Arjun
Hi Tenzin,
If you create node in component controller, map it with view controllers (suppose there are 2 views in the application) in the application & binds data in any of the view to the context of that view, then that data becomes available everywhere i.e. 2 view controllers & 1 componentcontrollers.
steps:
1) create node cn_abc in component controller
2) map it with contexts of the 2 views
3) collect data in the internal table of type context node
4) using following code in method of any view, bind the data to the context of that view. Then the collected data will be available in all the 3 contexts
DATA lo_nd_cn_abc TYPE REF TO if_wd_context_node.
DATA lo_el_cn_abc TYPE REF TO if_wd_context_element.
DATA ls_cn_alv TYPE wd_this->element_cn_alv.
navigate from <CONTEXT> to <CN_ALV> via lead selection
lo_nd_cn_abc = wd_context->get_child_node( name = wd_this->wdctx_cn_abc ).
collect data in t_abc table
lo_nd_cn_abc->bind_table( t_abc ).
Convert the data in string format,
I hope you have followed all the remianing steps correctly.
Regards,
Saket.
Hi,
If you want to have this text displayed as part of the image then simply enter it as the Caption of the Title (or Subtitle).
I.e. when editing the chart in the chart designer click on the Title node, enter the text in the Caption property and set the Alignment propery to South for changing its position.
Regards, Kai
Hi Tenzin,
You can use business graphics UI element. Refer this article for for help: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ca932ebc-0901-0010-68a0-b4dd81a4...
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tenzin,
Try searching 'How to Create Business Graphics in Web Dynpro for ABAP' in SDN, you'll get the required document.
how do i create the bar charts graphics in a different popup when i will press the button
In the pop up view, insert the business graphics UI element, write the code for it. On action of the button, generate the pop up window with the help of code wizard.
Regards
Arjun
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.