cancel
Showing results for 
Search instead for 
Did you mean: 

WDA Error : An instance of popup view already exists in the application

0 Kudos

Dear Experts,

I have used a popup in my WDA application which gets opened on the click of the button. Whenever the application is launched for the first time and when I click on the button to display the pop up I get the error "An instance of popup view already exists in the application"; when I close the application, relaunch it once again and click on the button to open the popup, it works fine. What would be the reason for this behaviour?

My piece of code is as follows,

try.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

CALL METHOD lo_window_manager->CREATE_WINDOW

EXPORTING

WINDOW_NAME = 'POP_UP_QOH'

TITLE = 'Stock Overview'

BUTTON_KIND = IF_WD_WINDOW=>CO_BUTTONS_OK

  • MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE

  • CLOSE_IN_ANY_CASE = ABAP_TRUE

RECEIVING

WINDOW = LO_WINDOW

.

CALL METHOD LO_WINDOW->OPEN

.

CATCH CX_WDR_RT_EXCEPTION.

ENDTRY.

Kindly please help to resolve the issue.

Warm Regards,

Kanthimathi

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Dear Experts,

I have left a portion of the note un-applied. Hence the problem. The note application resolved the issue. Thanks.

Regards,

kanthimathi

koushikking
Explorer
0 Kudos

Dear Krishnan,

Yet if you remember the solution, Please guide me because i got similar type of error.

Regards,

Koushik

0 Kudos

Hi Saravan,

Thanks for the detailed reply. My piece of code already have the model attribute set to 'X'. I would just give a detailed info on my issue.

I launch my WDA application for the first time; I click on the button to open the popup. I get an information on the status bar called "Error on Page" and the popup doesn't show up. When I click on the button again I get the dump

"An instance of popup view already exists in the application". But if I refresh the page and try once again everything works fine.

Previously when I launch the application for the first time and when I click on the button I got the error "sapPopupMainId_X1". If I ignore the error and try launching the popup I got the eeror "An instance of popup view already exists in the application".

To avoid the error "sapPopupMainId_X1" i applied the SAP Note 997989; but after this note application I am not getting the error "sapPopupMainId_X1" but I get a status information "Error on Page".

These issues persits only when the application is launched for the first time.

Regards,

Kanthimathi

0 Kudos

Hi Viji,

I now changed my piece of code as follows,

if lo_window is initial.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

CALL METHOD lo_window_manager->CREATE_WINDOW

EXPORTING

  • MODAL = ABAP_FALSE

WINDOW_NAME = 'POP_UP_QOH'

TITLE = 'Stock Overview'

  • CLOSE_BUTTON =

BUTTON_KIND = IF_WD_WINDOW=>CO_BUTTONS_OK

  • MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE

  • CLOSE_IN_ANY_CASE = ABAP_TRUE

RECEIVING

WINDOW = LO_WINDOW

.

CALL METHOD LO_WINDOW->OPEN

.

endif.

but still facing the same problem. By the way what does the message type argument mean here?

Regards,

Kanthimathi

former_member515618
Active Participant
0 Kudos

Hi Kanthimathi,

When we create a window using CREATE_WINDOW, the key parameter is the window name. Upon this method call, say

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

l_window = l_window_manager->create_window(

window_name = 'ADMINISTRATION_INFO' ).

We create a window with the Component and the window name as key fields. When clicked on for the second time, the same create window is called with the same set of keys so a duplication happens as a result the message is thrown.

When window is closed, All the references are invalidated so when opened again the issue doesnt come up.

There is an option to set the application as read only when an window is launched. Try setting the modal parameter as 'X' when creating a window and check. This disables the option of edditing the application when the window is still open.

Regarding the 2nd point, Message type field is to identify what type of window it is. Should it be a Information type, or a warning, error message. Accordingly the window design changes.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

HI,

Try the below code,

lo_api_component         = wd_comp_controller->wd_get_api( ).
  lo_window_manager = l_cmp_api->get_window_manager( ).
  if wd_this->m_popup1_1 is initial.
    wd_this->m_popup1_1 = lo_window_manager->create_window(
             window_name  = 'POP_UP_QOH'
             button_kind  = if_wd_window=>co_buttons_ok
             message_type = if_wd_window=>CO_MSG_TYPE_STOPP ).
    endif.
  wd_this->m_popup1_1->open( ).

Here M_POPUP1_1 is the type of IF_WD_WINDOW. You should declare this in a Attributes Tab.

Try this and let me know.

Thanks.