Skip to Content

Calling Popup with a text box and button in Webdynpro button click

Hi Experts,

I have a requirement in Webdynpro, in which on clicking a button, a pop up should appear with a Input field (Text box) and button. After filling the input field, user clicks the button, on clicking a button an event should be called. Please help me to achieve this. Thanks in Advance.

With Regards,

SivaG.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2016 at 02:47 PM

    Hi Sivag,

    I believe the following code can work in a webdynpro, but i've used this in se38 programs.

    CALL FUNCTION 'POPUP_TO_DECIDE_LIST'

    EXPORTING

    textline1 = lv_line1

    titel = lv_titel

    IMPORTING

    answer = lv_answer

    TABLES

    t_spopli = lt_spopli.


    This FM allow's user to input values, there is also one that just provides buttons for users to click and that is


    CALL FUNCTION 'POPUP_TO_CONFIRM'

    EXPORTING

    titlebar = 'Confirmation of product mapping'

    text_question = text-c02

    text_button_1 = 'Yes'

    text_button_2 = 'No'

    IMPORTING

    answer = lv_answer

    EXCEPTIONS

    text_not_found = 1

    OTHERS = 2.


    Another way to do this since you are working in web dynpro is to create a second view with all of the proper logic and then have the second view get triggered when your trigger button is clicked and then you can pass any data or results between the views via the context nodes.


    Just a thought, it really depends on how many views your program has as to which one makes more sense or if you may have many different scenarios where you ask for different input fields and perform different logic as to which makes more sense.


    *Edit*

    I've gone ahead and provide an example below of what the pop view approach looks liek

    As you can see in the screen shot below i have a view called need_info and i have that view in the contained of the main app with in my case 2 outbound plugin's that i needed for my situation. You can have only 1 or you can have more, just depends on your needs and how many different places this view would need to be displayed in.

    The next screenshot below is of the popup window

    Once you have those inbound and outbound plugs defined and linked in all the impacted views you just need to ensure that your popup view code for the popup view is done.

    In my case it was just 2 on action methods and the wdoinit method on startup. It may look like alot but it really is not much especially if you need a pop up window that can perform complex logic and be used for many different situations.


    Hope this helps,

    Geoffery

    Message was edited by: Geoffery Blackwell


    Capture1.JPG (210.5 kB)
    Capture2.JPG (163.6 kB)
    Capture3.JPG (194.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Geoffery,


      Thanks for your reply. I achieved it by creating a separate View (popup_view) and a Window (popup_win) for popup, and I embedded the popup_view in popup_win. In on_action method of button in Main view I added the below code (Through Code wizard -> General Tab->Generate Popup).

      DATA lo_window_manager TYPE REF TO if_wd_window_manager.

      DATA lo_api_component TYPE REF TO if_wd_component.

      DATA lo_window TYPE REF TO if_wd_window.

      DATA lt_buttons TYPE wdr_popup_button_list.

      DATA ls_canc_action TYPE wdr_popup_button_action.

      lo_api_component = wd_comp_controller->wd_get_api( ).

      lo_window_manager = lo_api_component->get_window_manager( ).

      * create the cancel icon, but without any action handler

      ls_canc_action-action_name = '*'.

      * Simple example, see docu of method create_and_open_popup for details

      lt_buttons = lo_window_manager->get_buttons_ok(

      * default_button = if_wd_window=>co_button_ok

      ).

      lo_window = lo_window_manager->create_and_open_popup(

      window_name = 'POPUP_WIN'

      title = 'My Pop up'

      message_type = if_wd_window=>co_msg_type_none

      message_display_mode = if_wd_window=>co_msg_display_mode_selected

      * is_resizable = ABAP_TRUE

      buttons = lt_buttons

      cancel_action = ls_canc_action

      ).


      Thanks for your time and kind reply.


      Regards,


      SivaG.

  • Posted on Jan 12, 2016 at 03:25 PM

    Do the following steps to achieve this:

    1. Create a new view (for Pop-up) with input field and button (create an event for the button)

    2. Insert the view in Window

    3. Call the following methods to open the popup:

    window manager create window: if_wd_window_manager->create_window( )

    then open( ).

    4. Once you are in the pop up, you can use the following method to close the popup:

    window close: close( ).

    Please post these kind of messages in "Web Dynpro ABAP" forum.

    -Chandra

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.