cancel
Showing results for 
Search instead for 
Did you mean: 

Closing popup window when parent and child are different components

former_member184111
Active Contributor
0 Kudos

Hi Forum,

I am enhancing a standard component in SRM 7 to achieve some functionality.

The WD Component is FPM_OIF_COMPONENT, created a post exit for the method ONACTION_BUTTONPRESSED and opening a new window from there

CALL METHOD lo_window_manager->create_window_for_cmp_usage

                      EXPORTING

                        interface_view_name       = 'ZWD_LGC_LRSC'

                        component_usage_name = 'ZWD_LGC_LRSC'

                        close_in_any_case         = ABAP_TRUE <------------this should close the window?

                        is_resizable                    = ABAP_FALSE

                      RECEIVING

                        window               = LO_WINDOW

                        .

     lo_window->open( ).

In the component ZWD_LGC_LRSC thers a Create button, on clicking this some processing happens. I expected that the pop up window will close after the processing is completed because of  close_in_any_case         = ABAP_TRUE ?

But that is not happening.

How can achieve the functionality to close the pop up window automatically after the processing finishes on click of Create button?

Thanks,

Anubhav

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

1) lets say you have some action button that that trigger the exit , e.g. SAVE, or Exit or Close button

write this logic in the action method.

data:

            l_api         type ref to if_wd_view_controller,

            l_window_ctlr type ref to if_wd_window_controller,

            l_popup       type ref to if_wd_window.

            l_api         = wd_this->wd_get_api( ).

            l_window_ctlr = l_api->get_embedding_window_ctlr( ).

            if l_window_ctlr is bound.

            l_popup       = l_window_ctlr->get_window( ).

           l_popup->close( 'l_popup' ).

            endif.

  

OR

if you are doing event based programmin then fire the exit plug event and you can programm close the window on that event.

refer below link

http://help.sap.com/saphelp_nw70/helpdata/en/45/1bc575ba064574e10000000a114a6b/frameset.htm

Answers (1)

Answers (1)

chengalarayulu
Active Contributor
0 Kudos

Anubhav,

create a IF_WD_WINDOW reference attribute at your feeder class level, then assign the LO_WINDOW reference while opening popup.

then, you can call CLOSE( ) method of window wherever you want.

ex. LR_WINDOW is your feeder class level attribute,

<feederclass>->LR_WINDOW = LO_WINDOW.

LO_WINDOW->OPEN( ).

For closing,

<feederclass>->LR_WINDOW->CLOSE( ).

Hope this would be helpful.