on 02-15-2011 1:40 PM
I am trying to create a dinamic BGR following the step by step tutorial from the link.
But It does not active, and the error is the following:
Properties "seriesSource" of element "GRAPH" must be bound .
Does anyone how to solve it?
Regards,
Hallo Gaston,
Have you followed the instructions exactly as described or you did it on your own.
It is activating for me .
Since you say not activating, seems to me that you have created the BGR on your view and you didnt bind the property as described by the error.
According to the instruction you do not have to do anything in your layout. It is all dynamically created on wddomodifyview.
The Pdf is not really for the beginners as it is not guiding where you should write your code. For example creating dynamic node should happen before the control goes to the wddomodifyview. That can be either in component controller or called in the from doinit method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
write the logic for creating the node in the wddoinit method like as shown below.
IN the wddoinit
DATA:
node_info type ref to if_wd_context_node_info,
struct_type TYPE REF TO cl_abap_structdescr,
table_type type ref to cl_abap_tabledescr,
comp_tab TYPE cl_abap_structdescr=>component_table,
comp LIKE LINE OF comp_tab.
comp-name = 'SERIES'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'CHAR4' ).
APPEND comp TO comp_tab.
comp-name = 'CATEGORY'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'I' ).
APPEND comp TO comp_tab.
"now this structure contains the required fields
struct_type = cl_abap_structdescr=>create( comp_tab ).
" now the nodeinfo is created only first time
node_info = wd_context->get_node_info( ).
node_info = node_info->add_new_child_node(
name = 'NODE_DYN'
IS_MANDATORY = ABAP_false
IS_MULTIPLE = ABAP_true
STATIC_ELEMENT_RTTI = struct_type
IS_STATIC = ABAP_false ).
then write th rest of the code in the wddomodify which contains creating BG dynamically and binding the seriessource and category.
DATA:
lr_graph TYPE REF TO cl_wd_business_graphics,
lr_cat TYPE REF TO cl_wd_category,
lr_series TYPE REF TO cl_wd_simple_series,
lr_container TYPE REF TO cl_wd_uielement_container,
lr_flow TYPE REF TO cl_wd_flow_data.
if first_time eq abap_true.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_graph = cl_wd_business_graphics=>new_business_graphics( bind_series_source = 'NODE_DYN'
chart_type = cl_wd_business_graphics=>e_chart_type-lines
height = 340
width = 750
* * BIND_TOOLTIP = 'GRAPH.TT'
id = 'GRAPH' ).
lr_flow = cl_wd_flow_data=>new_flow_data( element = lr_graph ).
lr_container->add_child( lr_graph ) .
wd_this->value_cs ?= lr_graph.
wd_this->mr_view ?= view.
endif.
DATA: lr_bgr_ss TYPE REF TO cl_wd_simple_series.
lr_bgr_ss = cl_wd_simple_series=>new_simple_series(
bind_value = 'NODE_DYN.SERIES'
label = 'Series_1'
view = wd_this->mr_view ).
DATA: lr_bgr_cs TYPE REF TO cl_wd_category.
lr_bgr_cs = cl_wd_category=>new_category(
view = wd_this->mr_view
bind_description = 'NODE_DYN.CATEGORY'
).
wd_this->value_cs->set_category( lr_bgr_cs ).
Code user two attributes also.
create them also
first one is
MR_VIEW of type ref to IF_WD_VIEW
other one is
VALUE_CS of type ref to CL_WD_BUSINESS_GRAPHICS.
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.