cancel
Showing results for 
Search instead for 
Did you mean: 

Business Graphics Dynamically

Former Member
0 Kudos

Hi Guys,

I have the following requirement :

Description:

1.I need to plot a graph based on valuation types.

2.The number valuation types will be chosen by the user.

3.The graph will be plotted on the following bases:

Say 2 valuation types are being chosen:

Time Amount for val typ 1 Amount for val typ 2

Jan 2009 400 200

July 2009 0 500

Oct 2009 100 700

Now say 3 valuation types are being chosen:

Time Amount for val typ 1 Amount for val typ 2 Amount for val typ 3

Jan 2009 400 250 200

July 2009 0 0 500

Oct 2009 100 0 700

This way if n valuation types are being chosen then this table of the graph will have 'n' columns along with the time column.

I need a graph whose:

x axis: time

y axis: Amount for each valuation time

Ie the valuation types amount for each time period(jan , july etc) must be captured.

Thus i have :

1.Created a node graph , with attribute time , this is static

2.I now add the attributes VAL_AMT1 to VAL_AMTn for as many valuation types chosen dynamically

3.I can get a reference of this node with all the attribute values set.

4.I am now unable to find a way to bind my values to this node Graph , so that the table for the graph is bound and hence the graph displayed.

I am using Category : for time

and Simple series.

Classes: CL_WD_CATEGORY, CL_WD_SIMPLE_SERIES.

Please help!

Thanks in Advance!

Best Regards,

Gayathri

Edited by: Gayathri R on Jan 31, 2009 7:25 AM

Accepted Solutions (0)

Answers (4)

Answers (4)

GayathriRR
Product and Topic Expert
Product and Topic Expert
0 Kudos

Solution is like this:

Create a node dynamically with as many fields as needed.

Create a busin graph dynamically.

At every action , delete the old instance of the graph and create a new one.

Thus the graph is right everytime.

For filling the node dynamically created with data have a method or altenatively use a Supply function.

Use the stmt: lo_node->invalidate( );

before the graph is called.

This way the supply function will be triggered and the main node for graph is filled.

Next dynamicaly create a simple series and in the bind value give the path of the attribute from the dynamically created node.

Next dynamically create a category , this can be an attribute from the dynamically created node or from any other node.

Thanks!

Gayathri

yesrajkumar
Active Participant
0 Kudos

Hi,

Try the following Abap webdynpro components you will get some ideas on the same.

DEMO_BG_GANTT

WDR_TEST_BG_BLEND

WDT_BG_SCATTER

Thanks,

Rajkumar.S

Pramanan
Active Participant
0 Kudos
GayathriRR
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ,

The problem for me is that the lt_series structure will be known only at runtime, so in that case how do i bind my data???

Field struc not an idea since the components too will be known only at runtime.

GayathriRR
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Guys ,

Thanks!

I found it myself.

Cheers,

Gayathri

Edited by: Gayathri R on Apr 7, 2009 6:08 AM

Former Member
0 Kudos

Hi,

As per your requirement, you have one value on X axis and need to show 2 different sets of values as Y axis.

Please check out this example that I implemented in my requirement- this is a static one-

When we look into the standard examples in the Business graphics the BG->Series node is bound to the table from which it is takking values and the subnodes of it category and series are bound to the Values .

I have two tables where i have to set the SERIES1 to the 1st table value and SERIES2 to the 2nd table value and the Category to any of them as the Catorgory values are same in both. I took another node where I got the serires values into a single node based on the category. I have combined both the table entires into a one table. Then in the BG I have bound the Catergory and series to this resultant node and BG->category and series1 and serires2 are bound to that repsective values of this resultant node.

Like this I achieved. Now I was able to view the two different series for the given Category in a single graph.

For the dyamic graph creation,

Have a context attribute for the number of valuation types.

Create a node to hold the values.

In the WDDOMODIFY view, create a BG UI element and create a series node as per the input entered in the initial screen and a single catoegory node.

Bind the respective attributes and node to the BG UI element, series, category.

Initially refer to the dynmaic UI element creation documents and then proceed with respect to BG.

Regards

Lekha