cancel
Showing results for 
Search instead for 
Did you mean: 

Alv output with 2 tables..

Former Member
0 Kudos

Hi gurus,

my requirement is as follows:

I have two radio buttons , for two radiobuttons i have two different tables ( different fields in final table ) to display in alv

How can i do this..?

Like the way we do in report program for alv grid display..

Need this urgently..

best regards,

navin fernandes.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As you want too display the final ALV data ...

Create teh node that your final internal table has and create the ALV instance and bind the DATA noe to this node..

for ex:

If you have already data in some internal tables...

Loop through them and fill the final internal table..

Bind this table to the node..

It's all the same as in report program, just popuplate teh internal table..

Get teh node reference and bind it...

lo_node->bind_table ( it_final ).

Regards,

Lekha.

Former Member
0 Kudos

Hi lekha,

I think i can do it this way..

create two alv component usage and map the two nodes ( table ) to different alv components..This should work.

But one thing i want to know is...

I have mapped two different alv components to two different views..

Depending on my radio button selection i want to call 2 different views..

For Eg: radiobutton 1 is selected.. View1 will get diplayed

radiobutton2 is selected ..view2 will get displayed.

but how to call view dynamically..?

best Regards,

navin fernandes.

Former Member
0 Kudos

Hi,

In teh radiobutton selction action event...try to use the if_wD_window_manager and use the create_window or create_external window to show the different views of ALvs..

Or

When you have taken 2 views of ALV in dfferenct windows of main component...

Do you want to open them as separate sessions external window or....

when you move to view1 on radiobutton, you want to come back to same main view..

Create the links for them,

You neeed to fire the plugs repsectively...

Edited by: Lekha on Dec 22, 2009 1:44 PM

Former Member
0 Kudos

Hi Lekha,

I am aware of the concept of fire plug but that becomes static..

with this i can navigate from selection view to View3

VIEW3 is the destination view for Selection View

create two views VIEW1 and VIEW2 with alv components each.

now i create one more view VIEW3 and have a 2 view containers and map view1 and view 2 under them.

here i have variable cs_visibility and map it to VIEW3 view container visiblity property..

hence accordingly whichever view is visible will be called..

Will this work..>?

Best Regards,

Navin Fernandes.

Former Member
0 Kudos

hi

1 bind both the view , to 2 different context attribute of type WDUI_VISIBILITY

2 initially set both the views under ur ViewContainer to invisible

// set the context attrribute to '01' to make it invisible

3 now bind the VISIBLE property of ur views to the context attribute

4 now make a action for ur radiobutton & in OnAction of tht , set the attribute to '02' to make either of ur view visible

5 other view wud remain invisible still

u can use code wizard set_attribute method , press control +f7 and set the attribute to '02'


DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr.
*   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   set single attribute
    lo_el_cn_node->set_attribute(
      EXPORTING
        name =  `CA_ATTR`
       value = '02' ).
// attribute CA_ATTR under node CN_NODE  set to '02' now 

regards,

amit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Navin,

You either go by creating 2 context nodes, 2 ALV usages and playing with the visibility. Or you can use dynamic ALV and instantiate it based on the radio button you click on. This functionality can controlled in the radio button event.

Check this link [http://wiki.sdn.sap.com/wiki/display/sandbox/DynamicContextManipulationandALVIntegration|http://wiki.sdn.sap.com/wiki/display/sandbox/DynamicContextManipulationandALVIntegration]

- Reena