cancel
Showing results for 
Search instead for 
Did you mean: 

taking value which is entered in popup during an action

adil_gndz
Explorer
0 Kudos

Hi,

I have an "event", in which i call a popup and i want user to enter a "text". Then i want to close the popup and use the entered text but when that popup opens, the event comes to end.

How can i solve this?

Thanks

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Adil,

Declare a global variable in Component controller type string in the Attribute tab. When you click the close button, at this time assign the user entered value in this global variable.

Now you can use this value anywhere you want. Hope it will work for you.

Thanks

Sanket

Former Member
0 Kudos

Take a look at this article, this is a bit clearer on how to use a POPUP and the subscribe_to_button method:

[Quick Tips andTtricks on Web Dynpro for ABAP - How to use ALV and Pop Ups|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4]

Former Member
0 Kudos

hi,

declare an event in the component controller method.then in the event where you are opening the pop up after this raise the event of component controller by passing the value from the pop up.then in the event handler of the component controller you will have the pop up value ,so now you can use the value and write the necessary logic.

Former Member
0 Kudos

Hi adil,

Create one method in component controller to trigger the event.Now call that method where ever you want.

follow the steps below.

1. I created an event in the component controller named as call_view.

2. Created a method to call this event in the component controller.

method EVENT_RAISE .

wd_this->fire_call_view_evt( ).

endmethod.

3. from popup window I am triggering the event by calling the above method.

METHOD onactionsubmit .

data lo_componentcontroller type ref to ig_componentcontroller .

lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).

lo_componentcontroller->event_raise( ).

endmethod.

4. Implement event handler method to capture the above action where ever you want.

here you can close the popup window.

Former Member
0 Kudos

Hi Adil,

Give a Button on the POP-UP lets call it SAVE in addition to the input fields. when user enters data & presses on SAVE, you need to catch the ONACTION SAVE event. After reading the value close the pop-up.

i have an action SHOW_SUMMARY in my view , that would be called when i press button YES in the pop-up my sample application

data :  l_cmp_api          type ref to if_wd_component,
          l_window_manager   type ref to if_wd_window_manager,
          l_popup            type ref to if_wd_window,
          l_text             type        string_table,
          l_api              type ref to if_wd_view_controller.

  l_cmp_api        = wd_this->wd_get_api( ).
  l_window_manager = l_cmp_api->get_window_manager( ).
  l_text = 'Select One'.
   rr_popup_window = l_window_manager->create_popup_to_confirm(
                text            = l_text
                button_kind     = if_wd_window=>co_buttons_yesnocancel
                message_type    = if_wd_window=>co_msg_type_warning
                window_title    = 'INFO'
                window_position = if_wd_window=>co_center
                ).      #
                
               
     rr_popup_window->subscribe_to_button_event(
               button            = if_wd_window=>co_button_yes
               action_name       = 'SHOW_SUMMARY'
               action_view       = ir_view "reference to view
               is_default_button = abap_true ).


  endcase.

Greetings

Prashant