cancel
Showing results for 
Search instead for 
Did you mean: 

Get Interface Controller of Dynamic ALV and imbed ALV to view

Former Member
0 Kudos

Hey everyone, i have a requirement to create multiple ALV tables dynmically.

I am creating new component usage from an existing component with : (i dont know how to create an ALV from scratch).

if_wd_component_usage -> CREATE_COMP_USAGE_OF_SAME_TYPE

But after the component usage is created, i am stuck on :

1. How to get Interface controller so that i can set Data to the node i want to map it to.

i.e IWCI_SALV_WD_TABLE -> set_data

if it was a static alv, you would:

DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

lo_INTERFACECONTROLLER = wd_this->wd_cpifc_alv( ).

lo_INTERFACECONTROLLER->set_data( r_node_data = node ).

2. I need to imbed the new component usage to the view i want to display it in.

any assistance will be appreciated.. even a totally different approach.

Basically i want multiple ALV, in different views, and be able to set data in the ALV.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

1. How to get Interface controller after the component usage is created:

*create active component 
IF lr_comp_usage->has_active_component( ) IS INITIAL.
lr_comp_usage->create_component( ).
ENDIF.

*get interface controller through component usage
lo_interfacecontroller ?= lr_comp_usage->get_interface_controller( ).

*bind the node
lo_Iinterfacecontroller->set_data( r_node_data = node ).

2. I need to embed the new component usage to the view i want to display it in.


DATA lr_api_view TYPE REF TO if_wd_view_controller.

*define navigation link and embed interface view
lr_api_view = wd_this->wd_get_api( ).
lr_api_view->prepare_dynamic_navigation(
source_window_name = 'MAIN_WINDOW' "window in which it has to be embedded
source_vusage_name = 'MAIN_VIEW_USAGE_1' "view usage in which it has to be embedded
source_plug_name = 'VC_BOOKINGS_ALV' "outbound plug of MAIN_VIEW
target_component_name = 'SALV_WD_TABLE' "ALV component name
target_component_usage = 'ALV_BOOKING' "ALV component usage name
target_view_name = 'TABLE' "interface view of ALV TABLE
target_plug_name = 'DEFAULT' "inbound plug of TABLE
target_embedding_position = 'MAIN_VIEW/VC_BOOKINGS' "embedding position in MAIN_VIEW
).

*fire outbound plug of source view to display ALV interface view
wd_this->fire_vc_bookings_alv_plug( ).

Hope this helps!

Regards,

Srilatha

Edited by: Srilatha M on Jul 2, 2010 11:06 AM

Former Member
0 Kudos

Thank You, Thank You, Thank You

Answers (0)