cancel
Showing results for 
Search instead for 
Did you mean: 

Instance of the view POPUP_TASK_UPDATE already exists in component

Former Member
0 Kudos

Hi ,

I have an ALV and link to action on a particular filed for every row of an ALV .

When click on link to action , then i need to display a same POPUP for every row.

Now , my problem is

when I am clicking on Link to action I am getting Short dump saying that

' Instance of the view POPUP_TASK_UPDATE already exists in component.

What may be the reason is ?

cheers,

srak.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

avoid any of these :

1 in a component which already One view say VIEW , u r creating the other view with same name

2 for ur view in component with the name layout u try to add the component usage with the

same name, what are the names of your views in the application .

regards,

amit

Former Member
0 Kudos

Hi amit,

I am using two different Views for ALV display and for POPUP , whose names are different.

Cheers,

sravan.

Former Member
0 Kudos

Is this popup is also an ALV.....

Can you paste the code of this LinktoAction handler....

Edited by: Lekha on Dec 23, 2009 5:10 PM

Former Member
0 Kudos

Hi Lekha,

Thanks for your responce.

The POPUP is not an ALV.

Here is the Code for On Click Event ( Link to Action ) :::

DATA lo_nd_task TYPE REF TO if_wd_context_node.

DATA lo_el_task TYPE REF TO if_wd_context_element.

DATA ls_task TYPE wd_this->element_task.

  • navigate from <CONTEXT> to <TASK> via lead selection

lo_nd_task = wd_context->get_child_node( name = wd_this->wdctx_task ).

  • get element via lead selection

lo_el_task = lo_nd_task->get_element( ).

CALL METHOD lo_nd_task->get_static_attributes

EXPORTING

index = r_param->index

IMPORTING

static_attributes = ls_task.

**----


DATA lo_nd_task_disp_info TYPE REF TO if_wd_context_node.

DATA lo_el_task_disp_info TYPE REF TO if_wd_context_element.

DATA ls_task_disp_info TYPE wd_this->element_task_disp_info.

  • navigate from <CONTEXT> to <TASK_DISP_INFO> via lead selection

lo_nd_task_disp_info = wd_context->get_child_node( name = wd_this->wdctx_task_disp_info ).

  • get element via lead selection

lo_el_task_disp_info = lo_nd_task_disp_info->get_element( ).

CLEAR ls_task_disp_info.

MOVE-CORRESPONDING ls_task TO ls_task_disp_info.

CALL METHOD lo_nd_task_disp_info->set_static_attributes

EXPORTING

  • index = USE_LEAD_SELECTION

static_attributes = ls_task_disp_info

.

*----


DATA lo_api TYPE REF TO if_wd_view_controller.

DATA lo_window_ctlr TYPE REF TO if_wd_window_controller.

DATA lo_popup TYPE REF TO if_wd_window.

lo_api = wd_this->wd_get_api( ).

lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).

lo_popup = lo_window_ctlr->get_window( ).

IF lo_popup IS BOUND.

lo_popup->close( ).

ENDIF.

*----


DATA lo_window_manager TYPE REF TO if_wd_window_manager.

DATA lo_api_component TYPE REF TO if_wd_component.

DATA lo_window TYPE REF TO if_wd_window.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window = lo_window_manager->create_window(

window_name = 'POPUP_TASK_UPDATE'

  • title =

  • close_in_any_case = abap_true

message_display_mode = if_wd_window=>co_msg_display_mode_selected

  • close_button = abap_true

button_kind = if_wd_window=>co_buttons_ok

message_type = if_wd_window=>co_msg_type_none

default_button = if_wd_window=>co_button_ok

).

lo_window->open( ).

Cheers,

sravan.

Former Member
0 Kudos

One last question, view that you are trying to display is in the same component...

If yes, is it in the same window where the ALV views are also there..

If yes, then this will go for a dump..as stated..

Do one thing..Create one more window inside this embed the view that you want to show it in popup...

Ans show this popup as Modal window by passing the window name..

Is this clear.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

I am using two windows . One for ALV and other for POPUP.

cheers,

sravan.

Former Member
0 Kudos

Try to uncomment this

  • close_in_any_case = abap_true

and test it out..

some where the refernce of the window is already embeded.

Former Member
0 Kudos

Thanks Lekha for your continious support.

I've uncommented and tested it.

But still same problem.

cheers,

sravan.

Former Member
0 Kudos

Do one thing,

When first time the popup is created then store the referces to the gloabl variables of view attributes..

Form second time on wards try to use these references..instaed on exectuing the same code again for popup creation..

Try it out..

Former Member
0 Kudos

Hi Sravan,

Firstly check for any existing popup and if exist close that popup.



DATA lo_api         TYPE REF TO if_wd_view_controller.
DATA lo_window_ctlr TYPE REF TO if_wd_window_controller.
DATA lo_popup       TYPE REF TO if_wd_window.

lo_api         = wd_this->wd_get_api( ).
lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).
lo_popup       = lo_window_ctlr->get_window( ).

IF lo_popup IS BOUND.
  lo_popup->close( ).
ENDIF.

Write that code before creating popup.

Hope this will resolve the defect.

Nawal Kishor Mittal

Former Member
0 Kudos

Hi Kishor,

Thanks for your reply.

I did the same, but still am geetting same problem.

Cheers,

Sravan.