cancel
Showing results for 
Search instead for 
Did you mean: 

Popup Action from other view

jakob_steen-petersen
Active Participant
0 Kudos

Hi

I´m calling a separate view from the main view as a popup like this:

  lref_view = ??? .
   LOOP AT lt_buttons INTO ls_buttons.
     ls_buttons-action-view  = lref_view.
     ls_buttons-action-action_name  = 'SAVE_CAL'.
     ls_buttons-text    = 'Create'.
     ls_buttons-tooltip = 'Create reservation and exit'.
     MODIFY lt_buttons FROM ls_buttons.
   ENDLOOP.

   lo_window                  = lo_window_manager->create_and_open_popup(
       window_name          = 'ZVMRM_CAL_OV_CREATE'
*      title                = 'Create reservation'
       message_type         = if_wd_window=>co_msg_type_none
       message_display_mode = if_wd_window=>co_msg_display_mode_selected
       is_resizable         = abap_false
       buttons              = lt_buttons
       cancel_action        = ls_canc_action ).

But i cannot really get how to supply the reference to the view in parameter ls_buttons-action-view. The action i want to use is NOT in the calling view (MAIN) but in the called view.


Any ideas?


Jakob



Accepted Solutions (0)

Answers (2)

Answers (2)

ramakrishnappa
Active Contributor
0 Kudos

Hi Jakob,

If your scenario is like calling VIEW2 as popup window from view1. and buttons and actions present in view1.

lref_view = ??? .


then to get view reference of VIEW 1, proceed as below....


lref_view ?= wd_this->wd_get_api( ). " as you are calling popup window in VIEW1, wd_this refers to the view1


Hope this helps you.


Regards,

Rama

jakob_steen-petersen
Active Participant
0 Kudos

Hi

Yes correct - but the point here is that the Action are located in VIEW2. How is the reference then?

/Jakob

ramakrishnappa
Active Contributor
0 Kudos

Hi Jakob,

If you have the actions in view2, i would suggest create buttons directly in  layout editor of view2 and assign the actions to that. So that while populating you no need to pass the buttons.

Regards,

Rama

jakob_steen-petersen
Active Participant
0 Kudos

Hi

yes i can do that - but i wanted to try to pass it like mentioned. I suppose it´s possible right?

/Jakob

Gowtham
Contributor
0 Kudos

Hi Jakob,

Instead of creating buttons from the calling screen dynamically , you can create physical buttons in the called view(popup view) and assign the actions to it.

- Gowtham

jakob_steen-petersen
Active Participant
0 Kudos

Hi Gowtham

Yes i know - but i did´nt like the layout of that Button 🙂

/Jakob