cancel
Showing results for 
Search instead for 
Did you mean: 

Closing a Window in portal

Former Member
0 Kudos

Hello experts

I am trying to close a window in the portal.

I used the below code.

DATA: lr_view_cntr TYPE REF TO if_wd_view_controller,

lr_win_cntr TYPE REF TO if_wd_window_controller,

lt_parameter_list TYPE wdr_event_parameter_list,

ls_parameter TYPE wdr_event_parameter,

lr_val TYPE REF TO data.

FIELD-SYMBOLS <fs> TYPE any.

lr_view_cntr = wd_this->wd_get_api( ).

lr_win_cntr = lr_view_cntr->get_embedding_window_ctlr( ).

  • Set this value because we have to close the window

ls_parameter-name = 'CLOSE_WINDOW'.

  • Set parameter value to 'X' - true

CREATE DATA lr_val TYPE c.

ASSIGN lr_val->* TO <fs>.

<fs> = 'X'.

  • Add Parameter into parameter list

ls_parameter-value = lr_val.

INSERT ls_parameter INTO TABLE lt_parameter_list.

  • Call outbound exit plug of the window in which this view is embedded

lr_win_cntr->if_wd_view_controller~fire_plug(

EXPORTING plug_name = 'EXIT_PLUG'

parameters = lt_parameter_list ).

It is well being executed in web dynpro application but the same is not happening in the portal instead a message

"The application has closed and you can now close the window" is being displayed. but the window is not being closed.

Could anyone please help me achieving this in portal.

Thanks

Shravan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shravan

If it is a pop up you are speaking of, I have tried this approach and it has worked.

Say MAIN is your default view and PopUpWin is your window holding the pop up view, define a node called POPUPNODE and an attribute under it called PopUpWin (type ref to - if_Wd_window). Map this to the component controller and also create and map the same in your pop up view.

When you are calling the popup view you get a reference to the pop up window right, say it is lv_window (The reference to the Pop Up window you get when you autogenerate code for a pop up.), set this reference to the PopUpWin attribute under the POPUPNODE. As this is present in CC and Pop up view, it gets mapped automatically.

Now in the pop up view in the action where you want this pop up window to close just read the attribute & get reference to this attribute popupwin under POPUPNODE and say the reference is lv_window. Writing the code lv_window -> close ( ) will close this window.

Thanks & Regards,

Gayathri Shanbhag

Former Member
0 Kudos

Hi GS,

Its not regarding the Pop-Up.

Thanks & Regards,

Shravan.

Former Member
0 Kudos

You must be calling this exit plug from your view isnt? You have to pass it from there.

Window has exit plug with parameters.

You use window controller as required controller in your view to fire Exit plug on certain condition.

Former Member
0 Kudos

Hello Senthil,

Thanks for your response, i tried to pass the parameter in the exit plug but i could not able to do it.

Could you send the piece of code on how to pass the parameter in the exit plug in the below code.

  • Call outbound exit plug of the window in which this view is embedded

lr_win_cntr->if_wd_view_controller~fire_plug(

EXPORTING plug_name = 'EXIT_PLUG'

parameters = lt_parameter_list ).

Please help me.

Let me know if there is any other approach to close the window in portal.

Best Regards,

Shravan.

Former Member
0 Kudos

My suggestion was

lr_win_cntr->if_wd_view_controller~fire_plug(

EXPORTING plug_name = 'EXIT_PLUG'

close_window = abap_true ).

So please remove the lt_parameters list as parameter for exit_plug and use as suggested close_window as parameter,

Former Member
0 Kudos

Hello Senthil,

Thank you for the code, I've tried it but its giving the Syntax error.

"Formal parameter "CLOSE_WINDOW" does not exist".

So what can be done..??

Best Regards,

Shravan.

Former Member
0 Kudos

in the window also you have to remove the parameter lt_parameter for the exit_plug and insert close_window of type wdy_boolean.

Former Member
0 Kudos

you need to supply close_window = abap_true parameter along with exit_plug.

Former Member
0 Kudos

Hello senthil,

Thanks for your quick reply,

but where do we need to supply the parameter Close_window = abap_true ? as it is not the exporting parameter for FIRE_PLUG.

Please elaborate a bit more on this.

Best Regards,

Shravan.

Former Member
0 Kudos

window has the exit plug right ? Create there a parameter close_window of type wdy_boolean.

When you fire that plug as you do now, pass the value abap_true to close_window.

Former Member
0 Kudos

Hi Senthil,

I've Created a parameter of type wdy_boolean ,

but i got stuck on where should i pass the parameter value in the above code.

Please help me on this.

Best Regards,

Shravan.