Hi Sanjiv,
As your requirement i can suggest you a method for creating the bar graph for instance i want two loumns say planned vs actual as column graphs then 1. create two UI elements one as category and other as series point if for eg we want 2 things to be represented as planned vs actual so u create two series points and in context create two nodes say (Category and BarData).
Here Bar Data should consits of two attributes(Planned , Actual ) since we need planned and actual two things now bind the two series points to bar data .
Now by means of either bapi or through Function module you can get the data into the graphs and display simple. ðŸ˜Š
Try this !.
Have a Good Day.
Regards,
Sana.
HI,
right click on the Business Graphics and insert category for the x-axis of the graph.
After defining the x-axis for defining y-axis right click on the Business Graphics and insert series i.e
So define y-axis for say company 1 , company 2, company 3 .....and so on.
Bind where ever required.
Click on the BUSINESS_GRAPHICS and right click on it and go to the Edit Customizing as shown below and define the required properties
i will provide you sample code also............
METHOD wddoinit .
DATA: itab_series TYPE if_main=>elements_series,
struc_series LIKE LINE OF itab_series,
v_rand TYPE i.
DATA lo_nd_series TYPE REF TO if_wd_context_node.
NAVIGATE FROM <CONTEXT> TO <SERIES> VIA LEAD SELECTION
lo_nd_series = wd_context->get_child_node( name = wd_this->wdctx_series ).
DEFINE random_generate.
call function 'GENERAL_GET_RANDOM_INT'
exporting
range = 120
importing
random = v_rand.
END-OF-DEFINITION.
struc_series-description = 'X1'.
random_generate.
struc_series-company1 = v_rand.
random_generate.
struc_series-company2 = v_rand.
random_generate.
struc_series-company3 = v_rand.
random_generate.
APPEND struc_series TO itab_series.
struc_series-description = 'X2'.
random_generate.
struc_series-company1 = v_rand.
random_generate.
struc_series-company2 = v_rand.
random_generate.
struc_series-company3 = v_rand.
random_generate.
APPEND struc_series TO itab_series.
struc_series-description = 'X3'.
random_generate.
struc_series-company1 = v_rand.
random_generate.
struc_series-company2 = v_rand.
random_generate.
struc_series-company3 = v_rand.
random_generate.
APPEND struc_series TO itab_series.
struc_series-description = 'X4'.
random_generate.
struc_series-company1 = v_rand.
random_generate.
struc_series-company2 = v_rand.
random_generate.
struc_series-company3 = v_rand.
random_generate.
APPEND struc_series TO itab_series.
BIND ALL THE ELEMENTS
lo_nd_series->bind_elements(
new_items = itab_series
set_initial_elements = abap_true
).
ENDMETHOD.
Add comment