cancel
Showing results for 
Search instead for 
Did you mean: 

Displayed Rows in ALV

Former Member
0 Kudos

Hi all,

we have a ALV in WebDynpro. Ther are shown many people. Downstairs we have a Business Graphics who show some imformation from the people somthing like the vacation days for example.

Now when we filter in ALV we want get the displayed rows in ALV and only shown the displayed people in ALV in the Business Graphics.

Does someone have expirience in these or exists a good guidline for dynamic programming with Web Dynpro ABAP?

Thanks,

Markus

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

look here ->

Former Member
0 Kudos

If you want to add graph dynamically check this code.

method wddomodifyview .

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.

lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

lr_graph = cl_wd_business_graphics=>new_business_graphics(

  • BACKGROUND_COLOR = BACKGROUND_COLOR

  • BIND_CATEGORY_SOURCE = BIND_CATEGORY_SOURCE

  • BIND_ENABLED = BIND_ENABLED

BIND_SERIES_SOURCE = 'NODENAME'

  • BIND_TOOLTIP = BIND_TOOLTIP

  • BIND_VISIBLE = BIND_VISIBLE

CHART_TYPE = CL_WD_BUSINESS_GRAPHICS=>E_CHART_TYPE-COLUMNS

CUSTOMIZING = 'chart1.xml'

  • DIMENSION = E_DIMENSION-TWO

  • ENABLED = ABAP_TRUE

  • FONT_FAMILY = FONT_FAMILY

HEIGHT = 300

ID = 'GRAPH2'

  • IGS_URL = IGS_URL

  • IMAGE_SOURCE = IMAGE_SOURCE

  • MAP_SOURCE = MAP_SOURCE

  • ON_ACTION = ON_ACTION

  • TOOLTIP = TOOLTIP

  • TRANSPARENT_COLOR = *TRANSPARENT_COLOR

  • VIEW = VIEW

  • VISIBLE = E_VISIBLE-VISIBLE

  • WIDTH = 300

).

lr_cat = cl_wd_category=>new_category(

BIND_DESCRIPTION = 'NODE.DESCVAL'

  • BIND_EVENT_ID = BIND_EVENT_ID

  • BIND_TOOLTIP = BIND_TOOLTIP

  • EVENT_ID = EVENT_ID

ID = 'CAT1'

  • TOOLTIP = TOOLTIP

  • VIEW = VIEW

).

lr_graph->set_category( the_category = lr_cat ).

lr_series = cl_wd_simple_series=>new_simple_series(

BIND_VALUE = 'NODE.VALUE'

  • CUSTOMIZING_ID = CUSTOMIZING_ID

  • EVENT_ID = EVENT_ID

ID = 'SERIES1'

  • LABEL = LABEL

  • TOOLTIP = TOOLTIP

  • VIEW = VIEW

).

lr_graph->add_series(

  • INDEX = INDEX

the_series = lr_series

).

lr_flow = cl_wd_flow_data=>new_flow_data( element = lr_graph

).

lr_container->add_child( lr_graph ) .

endmethod.

To customize the chart

1. Create a chart through Chart desiner and save as XML file.

2. Import this XML into your Web Dynpro component through MIME.

If you have any doubts please let me know.

Thanks

Suman

Former Member
0 Kudos

hi,

I believe we are not talking of the same and that is why I try to explain it again :-).

So We have a ViewContainerUIElement. In this Element we have do a ALV. So when we filter in the alv for example only people are male. We would see only the male people in the Business Grephics.

So i want to get the rows that i can see on the ALV.

I Hope you understand it better and can give me an example

Best regards,

Markus

TomVanDoo
Active Contributor
0 Kudos

The problem you're facing is that the ALV is filtered, not the context.

Your ALV is bound to the context which contains all elements

Your Graph is bound to the very same context, still containing all elements

When you filter the ALV, the context will still contain all elements, but the ALV will only display some. As a result, the Graph will still display all elements.

to fix this, you need to implement your own proprietary filter which will only keep the relevant elements in the context.

I believe there's an onfilter event in the ALV. (update: there's no onfilter event, but there is an on_std_function_before, which passes it's parameters. use that one)

Catch this event.

Filter your data via a method in your assistance class

(in other word: you have an internal table containing all data in the assistance class. now you call a method which will loop over this internal table and copy only the relevant lines to a second internal table. in the supply function of your context node, you bind this second table)

now invalidate the context node so that it reloads it's data.

this results in a filtered context, so that your graph will show the same data as the ALV

Edited by: Tom Van Doorslaer on Sep 2, 2008 9:46 AM

TomVanDoo
Active Contributor
0 Kudos

stupid me.

there's another option:

An ALV has the option "display as"

set this to "table and graph"

and that's it

this way the alv generates the graph and you don't even need to add a second graph element on the screen.

the alv will for you.

easiest possible solution/

Former Member
0 Kudos

the data in BG are not the same as in the ALV.

I need only an example to get the filtered data from ALV(ViewContainerUIElement).

Forget the BG. When i have the Data from ALV i can get it and set it to the BG.

So i hope someone can give me a code example to get the filtered Data from the ALV.

Best regards,

Markus

Former Member
0 Kudos

Hi,

If you want to change the graph values dynamically.

Change the context values which are binded to Graphics UI element in the Filter event of ALV.

Still your problem is not solved let me know.

Thanks

Suman

Former Member
0 Kudos

Changing the properties of a business graphics ui-element at runtime via providing additional customizing-XML is shown in Web Dynpro application WDR_TEST_EVENTS in the View BG_SIMPLE_IN_MPANE. See method wddomodifyview, where the use of The interface if_wd_busin_graphics_mtd_hndl is shown.

Former Member
0 Kudos