Create_popup_to_confirm

Dear Friends,
Kindly suggest me any way to use create_popup_to_confirm outside of WDA in a custom class method.
Thanks ,
Lalit Singh

>
Lalit Singh wrote:
> Hi Friends,
>
> I have to enhance Travel Management System by putting popup on SaveDraft button.
> When i put popup logic in PRE_EXIT, popup appears after execution all phase model (WD Framework) , thus running SAVE_AS_DRAFT method also.
>
> I tried POPUP_TO_CONFIRM, but it throws dump.
>
> then i tried to create a class method using CREATE_POPUP_TO_CONFIRM, but it again has some restriction like we cant use WD_GET_API outside of WD Framework.
>
> So i seek an alternate way to use CREATE_POPUP_TO_CONFIRM in a class method so that i could trigger it from outside WD framework without giving dump.
>
>
> Thanks
>
> Edited by: Lalit Singh on Dec 24, 2010 12:32 PM
Hi,
few days ago Thomas Jung answered to similar question.
As the event phase model is not completed, your pop up is not appearing in between. Pre and post exits. Let me search for Thomas Jung reply if he has suggested any work around.
This was thread  [Re: How to Add POPUP for user confirmation using enhancement|Re: How to Add POPUP for user confirmation using enhancement] and unfortunately you were the person asked that question.
Since this is an FPM application you can try the following . i am not sure if it would work though
1. Some how you need to find a way to defer the FPM event from your pre_exit method.
2. Display your own custom dialog popup (webdynpro window).
3.Based on the yes or no answer you can resume or fail the event which you defer in step-1.
See the FPM developer's manual regarding this approach (POPUP dialog).
Edited by: Baskaran Senthivel on Dec 24, 2010 1:33 PM
Edited by: Baskaran Senthivel on Dec 24, 2010 1:39 PM

Similar Messages

  • Urgent : Runtime error in create_popup_to_confirm

    I get the below runtime error.
    +View V_ANALYSIS_DETAILS has no action BUTN_REJECT x«Â +
    and this is my code. can someone suggest me what am i missing in it
    l_api_main = wd_this->wd_get_api( ).
      l_cmp_api = wd_comp_controller->wd_get_api( ).
      str = 'Approved'.
      APPEND str TO str_table.
      str = 'Reason Rate Transferred set on activity'.
      APPEND str TO str_table.
      l_window_manager = l_cmp_api->get_window_manager( ).
      l_popup = l_window_manager->create_popup_to_confirm(
      text = str_table
      button_kind = if_wd_window=>co_buttons_ok "4
      message_type = 1
      close_button = 'X'
      window_title = 'Status Confirmation'
      window_position = if_wd_window=>co_center ).
      l_popup->subscribe_to_button_event(
      button = if_wd_window=>co_button_yes
      action_name = 'BUTN_REJECT'
      action_view = l_api_main
      is_default_button = abap_true ).
      l_popup->open( ).

    Hi Suri,
    Firstly we have to pass  the action name and not the button name to action_name at the time of subscribing the action.
    By default, the popup for confirmation will get closed upon any action performed.
    Check the code in the action assigned 'Ok' button. there might be a case where the code for calling the popup is triggered again.
    Please find the below code snippet for creating a Pop up for confirmation.
    *data declaration
      data:
        l_componentcontroller_api TYPE REF TO if_wd_component,
        l_window_manager TYPE REF TO if_wd_window_manager,
        l_window TYPE REF TO if_wd_window,
        lt_text TYPE string_table,
        l_text_line TYPE string,
        l_api TYPE REF TO if_wd_view_controller,
      l_api = wd_this->wd_get_api( ).
      l_text_line = cl_bsp_runtime=>if_bsp_runtime~get_otr_text( alias = '/RIO/ZHSE/025' ).
      APPEND l_text_line TO lt_text.
      l_componentcontroller_api = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_componentcontroller_api->get_window_manager( ).
      CALL METHOD l_window_manager->create_popup_to_confirm
        EXPORTING
          text                 = lt_text
          button_kind          = if_wd_window=>co_buttons_yesnocancel
          message_type         = if_wd_window=>co_msg_type_question
          CLOSE_BUTTON         = ABAP_TRUE
          WINDOW_TITLE         =
          WINDOW_LEFT_POSITION =
          WINDOW_TOP_POSITION  =
          window_position      = if_wd_window=>co_center
          WINDOW_WIDTH         =
          WINDOW_HEIGHT        =
        RECEIVING
          result               = l_window.
      CALL METHOD l_window->subscribe_to_button_event
        EXPORTING
          button            = if_wd_window=>co_button_yes
          BUTTON_TEXT       =
          TOOLTIP           =
          action_name       = 'BACK_AND_SAVE'
          action_view       = l_api
          is_default_button = abap_true.
      CALL METHOD l_window->subscribe_to_button_event
        EXPORTING
          button            = if_wd_window=>co_button_no
          BUTTON_TEXT       =
          TOOLTIP           =
          action_name       = 'BACK_AND_NO_SAVE'
          action_view       = l_api
          is_default_button = abap_false.
      l_window->open( ).
    endif.

  • Run Time error using create_popup_to_confirm in Post_Exit Method

    Hi,
    I am trying to use the create_popup_to_confirm method to display a popup box in order to create a simple confirmation popup box. The transaction is failing with an exception. Following is the Error analysis from ST22
    An exception occurred which is explained in detail below.                      
    The exception, which is assigned to class 'CX_WDR_RT_EXCEPTION', was not caught
    and therefore caused a runtime error.
    The reason for the exception is:
    Component ID_0001000300140017 Not Found
    Nothing I tried seem to work. I even copied the following code directly from SAP Help in order to try to get the popup box working:
    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_cmp_api = wd_this->wd_get_api( ).
    l_window_manager = l_cmp_api->get_window_manager( ).
    INSERT `Data where changed`   INTO TABLE l_text.        "#EC *
    INSERT `Do you want to save?` INTO TABLE l_text.        "#EC *
    l_popup = 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_question
              window_title    = 'Test: Popup to confirm'
              window_position = if_wd_window=>co_center ).
    l_popup->open( ).
    Now there is one thing that I am wondering that might be causing this, but I don't know for sure. I am executing this code from a Post_Exit method of a method in the COMPONENTCONTROLLER. Since enhancements are in their own container, I don't know if this may be confusing the Web Dynpro App. However the purpose of this enhancement is to show the end user a simple confirmation popup box so that they are informed that they did a particular action. Please let me know if you any ideas. Point will be awarded for helpful answers.

    hi,
    use following code.
    DATA: lt_text type string_table.
      DATA: mr_popup_window TYPE REF TO if_wd_window.
    pop a confirmation window for display purpose
    DATA: l_window_manager TYPE REF TO if_wd_window_manager,
    l_cmp_api        TYPE REF TO if_wd_component,
    l_window         TYPE REF TO if_wd_window.
    l_cmp_api        = wd_comp_controller->wd_get_api( ).
    l_window_manager = l_cmp_api->get_window_manager( ).
    append 'DO YOU WANNA SAVE DATA' to lt_text.
    CALL METHOD l_window_manager->create_popup_to_confirm
       EXPORTING
        text                 = lt_text
        button_kind          = if_wd_window=>CO_BUTTONS_YESNO
        CLOSE_BUTTON        = ' '
        WINDOW_TITLE        = 'POPUP WINDOW'
        WINDOW_WIDTH        = '25'
        WINDOW_HEIGHT       = '50'
        WINDOW_LEFT_POSITION = 10
        WINDOW_TOP_POSITION  = 10
        WINDOW_POSITION      = '25'
    RECEIVING
        result               =    mr_popup_window      .
    associated the action handling methods with the window
    DATA: view_controller TYPE REF TO if_wd_view_controller.
    view_controller = wd_this->wd_get_api( ).
    CALL METHOD mr_popup_window->SET_WINDOW_SIZE
    EXPORTING
      WIDTH   = '150'
      HEIGHT  = '150'.
    CALL METHOD mr_popup_window->subscribe_to_button_event
       EXPORTING
         button            = if_wd_window=>co_button_yes
         action_name       =   'ON_DELETE_POPUP_YES'
         action_view       =  view_controller      .
    CALL METHOD mr_popup_window->subscribe_to_button_event
    EXPORTING
      button            = if_wd_window=>co_button_no
      action_name       = 'ON_DELETE_POPUP_NO'
      action_view       =  view_controller
      is_default_button = abap_true    .
    mr_popup_window->open( ).

  • Reduce window size by Create_popup_to_confirm

    Hi Gurus,
    I need to generate a popup of reduced size in Webdynpro for ABAP. I have Netweaver 7.0.
    When I use the method Create_popup_to_confirm it generates a popup of default size even though I pass the height and width parameters. I need to reduce the size. Please tell me what are the options to do so in Netweaver 7.0
    Thanks
    Roshan

    Hi sanjay ,
    use the method set windoe size after you called the method create popup to confirm , give your size value in '%'
    data : lv_text type string_table .
    wd_comp_controller->popup_01 = lo_window_manager->CREATE_POPUP_TO_CONFIRM(
        TEXT                 = lv_text
        BUTTON_KIND          = ls_popup_properties-button_kind
    *    MESSAGE_TYPE         =
    *    CLOSE_BUTTON         = ABAP_TRUE
        WINDOW_TITLE         = 'Resized window '
    *    WINDOW_LEFT_POSITION =
    *    WINDOW_TOP_POSITION  =
    *    WINDOW_POSITION      =
    *    WINDOW_WIDTH         =
    *    WINDOW_HEIGHT        =
    *    DEFAULT_BUTTON       =
    wd_comp_controller->popup_01->SET_WINDOW_SIZE                           " popup_01 type if_wd_window
        WIDTH  = '75%'
        HEIGHT = '75%'                  
    let me know if you face any problem in this
    Regards
    chinnaiya .P

  • Action for handling YES/NO functionality in create_popup_to_confirm

    Hi all,
    I am creating several Popup window in the View using method create_popup_to_confirm of interface IF_WD_WINDOW_MANAGER.Is there any restrictions of creating Actions YES/NO only for button kind 'YESNO'.
    For each Popup can i create different actons for handling corresponding functionalities in different Methods.
    Can i use any suitable Action name for handling YES/NO functionality.
    Points will be sured.
    Thanks
    Sanket sethi

    Hi Sanket,
    Yes you can make the actions as you want by assigning the action name to YES/NO events.
    call method lr_wd_window_manager->create_popup_to_confirm
            exporting
              text         = lt_text
              button_kind  = '4'
              window_title = 'title'
            receiving
              result       = lr_wd_window.
      lr_wd_window->subscribe_to_button_event(
             exporting
               button            = if_wd_window=>co_button_yes
               action_name       = 'ACT_YES'
               action_view       = lr_view_controller
    lr_wd_window->subscribe_to_button_event(
            exporting
              button            = if_wd_window=>co_button_no
              action_name       = 'ACT_NO'
              action_view       = lr_view_controller
    Regards
    Amol Deshmukh

  • Lose Context SelectedItems on calling Create_popup_to_confirm

    Hi,
    I hope someone can give me an advice,
    I have a multiselectable table and an delete selected rows option,
    I want to confirm the delete action, I have subscribed an event ok_delete that is triggered after the user select ok in the popup window,
    The problem is that when the popup is displayed, the selected items i have get unselected.
    I could save selected items in a different context node before calling the popup window and read it from onactionok_delete, but i think this is not the better way.
    Can anyone tell me why the selected items get unselected after calling the popup to confirm window.
    Waiting for comments,
    Greetings.

    You can keep the table/structures by declare them as global attributes. For this refre to the below steps:
    1) Go to Comp controller and create a Global Node (Which you want to access globally), add attributes in this Node.
    2) click on Attribute tab.
    3) Declare the Table/structure here and give the attribute type as ELEMENT_<Context Node Name> for structure and ELEMENTS_<Context Node Name> for Table.
    4) Make sure to check the Public check box.
    Now you can access this attribute anywhere in ur Component as below.
    I) in Comp Controll - WD_THIS-><Attribute Name>
    II) In View - WD_COMP_CONTROLLER-><Attribute Name>
    Hope it helps you.

  • Problem with POPUP and exit plug

    Hi together,
    in my case under certain conditions i create a popup window from a view with the method "if_wd_window_manager->create_popup_to_confirm( )"
    The popup displays an error or success message to the user and a "OK" button is available. I stored the popup window in the attributes of the underlying view. So an action "OK_BUTTON_PRESSED" of the view is assigned to the OK-button of the popup using method "if_wd_window->subscribe_to_button_event( )".
    In the action handler two commands are executed:
    1) closing the popup with "if_wd_window->close( ) method of the popup reference stored in the view attributes".
    and
    2) firing a navigation plug from the view to the underlying window which calls its own window exit-plug.
    Now my problem is that the popup window does not close when i leave the view with the navigation plugs. Without the plugs everything is working fine. It seems that the underlying view/window must still be available to close the popup.
    In my case the exit plug is called. I can see it because a new URL is called and i can see the new page but the modal popup is still there and not closed.
    Has anyone an idea how to solve that problem?
    Edited by: Dirk Jäckel on May 23, 2008 3:34 PM

    hi dirk......
             what you can do is first execute the close method and set an attribute to 'X' once this close is over. then in your wddomodify method of the view check for that attribute and fire that plug. so the firing should take place in the modify view method.
    ---regards,
       alex b justin

  • Webdynpro pop up text change

    Hi All,
    I have created a pop up window by using method create_popup_to_confirm of if_wd_window_manager . I have created the OK button by using if_wd_window=>co_button_ok of if_wd_window .
    I need to change the default button text " OK  " to " EDIT ". I am following the below approach .
            view_controller = wd_this->wd_get_api( ).
            lo_window->subscribe_to_button_event(
            button = if_wd_window=>co_button_ok
            button_text = 'EDIT'
            action_name = 'MSG'
            action_view = view_controller ).
    Note : Action " MSG "  is a dummy action which I have created just to change the default button text .
    This works if the control is in the same view where pop up is called . If we have to go back to other webdynpro component/ view then , after clicking on EDIT button in pop up , it gives the dump with the error " Controller for View, Window, Interface, and Configuration Cannot Be Created " .
    Please let me know if there is any other way to change the default text in the pop up screen or any other solution . I am ok to use any other method which creates pop up window and default text should be modified .
    Thanks,
    Kiran.

    Hi Kiran,
    If its that important for you to change the button label, I would suggest creating a new view and calling it as a popup.
    Please follow below steps to do so:
    1) Create a new view with your respective design having message and EDIT button.
    2) Create a new window say Popup_Window
    3) Add the new view to this window and add below code
    4)Create a
    Data: context_node type ref to if_wd_context_node.
      data: lr_popup type ref to if_wd_window,
            lr_view_controller type ref to if_wd_view_controller.
      data: lr_api_comp_controller type ref to if_wd_component,
            lr_window_manager type ref to if_wd_window_manager.
      lr_api_comp_controller = wd_comp_controller->wd_get_api( ).
      lr_window_manager = lr_api_comp_controller->get_window_manager( ).
      lr_popup = lr_window_manager->create_window(
      MODAL               = ABAP_TRUE
      window_name         = 'POPUP_WINDOW'  "Name of the window created in step 2
      TITLE               = Confirmation Message"
      CLOSE_BUTTON        = ABAP_TRUE
      BUTTON_KIND         = if_wd_window=>CO_BUTTONS_OKCANCEL
    MESSAGE_TYPE        = if_wd_window=>co_msg_type_error
      CLOSE_IN_ANY_CASE   = ABAP_TRUE
    *MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
    Adds an action to the popup screen buttons
    lr_view_controller = wd_this->wd_get_api( ).
    lr_popup->subscribe_to_button_event(
    button = if_wd_window=>co_button_ok
    button_text = 'EDIT'
    action_name = 'EDIT'
    action_view = lr_view_controller ).
      lr_popup->open( ).
    I hope it helps.
    Please revert back in case of issues.
    Regards,
    Sumit

  • ACTIONS ON ALV REPORT FOR CHECKBOX?

    hi All,
    i have to display ALVreport with one of the columns has checkbox.whenever user presses any checkbox,in repected row values have to be validated and updated in DataBase.
    My First Doubt is,How can i get the column of checkBoxes in ALV Report.?
    2.How can i add action for that checkBox?
    Regards,
    Ravi.

    Hi Ravi,
    Your requirement can be achieved by creating a custom function in your ALV.
    We create a button in the ALV toolbar with text 'Confirm'. When user clicks on this, a popup screen is called for confirmation. Based on the input we set the flag.
    To accomplish this, When defining the configuration model of the ALV, do the following
    Assume that we get the model of the ALV into lo_list
    lo_list = lo_ref_interfacecontroller->get_model( ).
    DATA:
    * Generate an object for self defined functions
        lo_self_functions          TYPE REF TO if_salv_wd_function_settings,
    * Generate an object for button 'Confirm'
        lo_button_conf          TYPE REF TO cl_salv_wd_fe_button,
    * Set Self-defined functions
    * 'Confirm' Button
      lo_self_functions ?= lo_list.
      lo_self_function = lo_self_functions->create_function( 'CONFIRM' ).
      CREATE OBJECT lo_button_conf.
      CLEAR l_text.
      l_text = 'Confirm'
      lo_button_sel_all->set_text( l_text ).
      lo_button_sel_all->set_image_source( '< Any icon name >' ).
      lo_button_sel_all->set_image_first( 'X' ).
      lo_self_function->set_editor( lo_button_conf ).
    In the methods tab, Create a event handler for ON_FUNCTION event of the ALV.
    ONFUNTION     Event Handler     ON_FUNCTION     ON_FUNCTION     INTERFACECONTROLLER     alv_name
    In the ONFUNCTION method, Do the following.
      DATA:
        l_window                  TYPE REF TO if_wd_window,
        l_componentcontroller_api TYPE REF TO if_wd_component,
        l_window_manager          TYPE REF TO if_wd_window_manager,
        l_api                     TYPE REF TO if_wd_view_controller,
        lt_text                   TYPE string_table,
        l_text_line               TYPE string.
    * Based on the function selected, set the selection
      CASE  r_param->id.
        WHEN 'CONFIRM'.
    * Call the confirmation for popup
      l_api = wd_this->wd_get_api( ).
      l_componentcontroller_api = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_componentcontroller_api->get_window_manager( ).
      CALL METHOD l_window_manager->create_popup_to_confirm
        EXPORTING
          text            = lt_text
          button_kind     = if_wd_window=>co_buttons_yesno
          message_type    = if_wd_window=>co_msg_type_question
          window_position = if_wd_window=>co_center
        RECEIVING
          result          = l_window.
      CALL METHOD l_window->subscribe_to_button_event
        EXPORTING
          button            = if_wd_window=>co_button_yes
          action_name       = 'YES'
          action_view       = l_api
          is_default_button = abap_false.
      CALL METHOD l_window->subscribe_to_button_event
         EXPORTING
           button            = if_wd_window=>co_button_no
           action_name       = 'NO'
           action_view       = l_api
           is_default_button = abap_false.
      l_window->open( ).
      ENDCASE.
    Create 2 actions with names YES and NO ( As mentioned in the subscription.
    In these actions, bases on the inputs, set the flag to a context attribute and update the same in the table you wanted.
    Hope this is what you want.
    Regards,
    Sravan Varagani.

  • Not able to display the desired view if button is pressed in POPup window

    Hi Experts,
    I have developed a web dynpro application.In this i have created a pop up window which consists of three buttons YES , NO and CANCEL.
    I have developed three event handlers in the view VIEW_POPUP which is acting as view of the pop_up window.  When i click on any of these buttons no event handler is getting triggered.
    Please give your suggestion as where the problem is.

    Hi Ravi,
    I think u created a  view and embedded it in another window and calling that window.,
    If u want to display a popup window with action buttons., jus use create_popup_to_confirm() method.
    refer this code,.
    * Data declarations for Pop up window
      data: lt_text type string_table,
            lo_window_manager type ref to if_wd_window_manager,
            lo_api_component type ref to if_wd_component,
            lo_window type ref to if_wd_window,       
            l_api type ref to if_wd_view_controller.
       msgtext = 'Do u want to continue. ?'
        append msgtext to lt_text.
          clear: tmp_from , tmp_to .
          l_api = wd_this->wd_get_api( ).
          lo_api_component = wd_comp_controller->wd_get_api( ) .
          lo_window_manager  = lo_api_component->get_window_manager( ).
          lo_window1 =
          lo_window_manager->create_popup_to_confirm(
                 text = lt_text
                 button_kind = if_wd_window=>co_buttons_okcancel
                 message_type = if_wd_window=>co_msg_type_information   " this is info msg u can give error message here
                 close_button = 'X'
                 window_title = 'Confirmation message box'
    *       lo_window->subscribe_to_button_event
          lo_window1->subscribe_to_button_event(
            button = if_wd_window=>co_button_ok
            action_name = 'SUBMIT_REQUEST'                     " Submitting Request. " u have to create SUBMIT_REQUEST Action
            button_text = 'Yes'                                             " And Place the code in that action which u want to execute when yes
            action_view = l_api
            is_default_button = abap_false
    *       lo_window->subscribe_to_button_event
          lo_window1->subscribe_to_button_event(
            button = if_wd_window=>co_button_cancel
            action_name = 'CANCEL_REQUEST'                     " Calling Action On clicking NO. "u have to create CANCEL_REQUEST
            button_text = 'NO'                                              "Action
            action_view = l_api
            is_default_button = abap_true
          lo_window1->open( ).
    reply if u need some more clarifications.,
    Thanks & Regards
    Kiran

  • Pass Message to a pop-up view

    Hi,
    I  pop-up a view in a window, that contains an error message.
    How can i change this error message using a parameter or anything else ?
    Thanks in advance.
    Edited by: dyngry on Apr 14, 2011 2:23 PM

    Hi dyngry.,
    If u want to display only message in popup window., no need of another view and window., use create_popup_to_confirm() method.,
    try this.,
    * Data declarations for Pop up window
      data: lt_text type string_table,
            lo_window_manager type ref to if_wd_window_manager,
            lo_api_component type ref to if_wd_component,
            lo_window type ref to if_wd_window,       
            l_api type ref to if_wd_view_controller.
       msgtext = 'Do u want to continue. ?'
        append msgtext to lt_text.
          clear: tmp_from , tmp_to .
          l_api = wd_this->wd_get_api( ).
          lo_api_component = wd_comp_controller->wd_get_api( ) .
          lo_window_manager  = lo_api_component->get_window_manager( ).
          lo_window1 =
          lo_window_manager->create_popup_to_confirm(
                 text = lt_text
                 button_kind = if_wd_window=>co_buttons_okcancel
                 message_type = if_wd_window=>co_msg_type_information   " this is info msg u can give error message here
                 close_button = 'X'
                 window_title = 'Confirmation message box'
          lo_window1->open( ).
    reply if u need some more clarifications.,
    Thanks & Regards
    Kiran

  • Pop up not working

    I am having table and i have to delete the record from that table........when i click that delete button the popup to be displayed.....
    for the generation of the popup i have used the below coding.........
    DATA: LR_API_COMP_CONTRL      TYPE REF TO IF_WD_COMPONENT,
           LR_WINDOW_MANAGER       TYPE REF TO IF_WD_WINDOW_MANAGER,
           LR_POPUP_WINDOW         TYPE REF TO IF_WD_WINDOW,
           LR_VIEW_CONTROLLER      TYPE REF TO IF_WD_VIEW_CONTROLLER,
           POPUP_MSG               TYPE STRING_TABLE.
           LR_API_COMP_CONTRL = WD_COMP_CONTROLLER->WD_GET_API( ).
           LR_WINDOW_MANAGER = LR_API_COMP_CONTRL->GET_WINDOW_MANAGER( ).
    clear POPUP_MSG[].
    APPEND 'Are You Sure to Delete The Records?' TO POPUP_MSG.
           CALL METHOD LR_WINDOW_MANAGER->CREATE_POPUP_TO_CONFIRM
             EXPORTING
               TEXT                 = POPUP_MSG
               BUTTON_KIND          = IF_WD_WINDOW=>CO_BUTTONS_YESNO
               MESSAGE_TYPE         = IF_WD_WINDOW=>CO_MSG_TYPE_QUESTION
              CLOSE_BUTTON         = ABAP_TRUE
                WINDOW_TITLE         = 'Message Box'
              WINDOW_LEFT_POSITION =
              WINDOW_TOP_POSITION  =
              WINDOW_POSITION      =
              WINDOW_WIDTH         =
              WINDOW_HEIGHT        =
             RECEIVING
               RESULT               = LR_POPUP_WINDOW
    LR_VIEW_CONTROLLER = WD_THIS->WD_GET_API( ).
    CALL METHOD LR_POPUP_WINDOW->SUBSCRIBE_TO_BUTTON_EVENT
         EXPORTING
           BUTTON            = IF_WD_WINDOW=>CO_BUTTON_YES
          BUTTON_TEXT       =
          TOOLTIP           =
           ACTION_NAME       = 'YES'
           ACTION_VIEW       = LR_VIEW_CONTROLLER
          IS_DEFAULT_BUTTON = ABAP_FALSE
    LR_POPUP_WINDOW->OPEN( ).
    And on action YES (For the popup's Yes button) I have written the code for deleting the record.........
    DATA:
        NODE_MODULE                         TYPE REF TO IF_WD_CONTEXT_NODE,
        ELEM_MODULE                         TYPE REF TO IF_WD_CONTEXT_ELEMENT,
        STRU_MODULE                         TYPE IF_V_MODULE=>ELEMENT_MODULE .
      DATA id TYPE ZAC_MODULES-ZMODULE_id.
    navigate from <CONTEXT> to <MODULE> via lead selection
      NODE_MODULE = WD_CONTEXT->GET_CHILD_NODE( NAME = `MODULE` ).
      ELEM_MODULE = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
       CALL METHOD ELEM_MODULE->GET_ATTRIBUTE
        EXPORTING
          NAME  = 'ZMODULE_ID'
        IMPORTING
          VALUE = id.
      NODE_MODULE->REMOVE_ELEMENT( ELEM_MODULE ).
    delete FROM zac_modules WHERE zmodule_id = id.
    wd_comp_controller->filltablemodule( ).
      get message manager
      DATA: L_CURRENT_CONTROLLER TYPE REF TO IF_WD_CONTROLLER,
            L_MESSAGE_MANAGER    TYPE REF TO IF_WD_MESSAGE_MANAGER.
      L_CURRENT_CONTROLLER ?= WD_THIS->WD_GET_API( ).
      CALL METHOD L_CURRENT_CONTROLLER->GET_MESSAGE_MANAGER
        RECEIVING
          MESSAGE_MANAGER = L_MESSAGE_MANAGER
      report message
      CALL METHOD L_MESSAGE_MANAGER->REPORT_SUCCESS
        EXPORTING
          MESSAGE_TEXT  = 'Record Deleted Successfully'
         PARAMS        =
         MSG_USER_DATA =
    While clicking on the YES button of that popup "Null Object Reference error has occured". The above coding works fine without popup..........plz help me regarding with this.............
    THANKS IN ADVANCE
    ALAGAPPAN.S

    Hello
    you need to modify the code little bit to get the index number of the row or element to be deleted.
    for this
    1. create one context attribute say name 'INDX' of type i.
    2. then the code for generating the popup should be like
    data el type ref to if_wd_context_element.
      el = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
      data indx type i.
      indx = el->get_index( ).
      wd_context->set_attribute(
      name = 'INDX'
      value = INDX
      DATA: LR_API_COMP_CONTRL TYPE REF TO IF_WD_COMPONENT,
    LR_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER,
    LR_POPUP_WINDOW TYPE REF TO IF_WD_WINDOW,
    LR_VIEW_CONTROLLER TYPE REF TO IF_WD_VIEW_CONTROLLER,
    POPUP_MSG TYPE STRING_TABLE.
    LR_API_COMP_CONTRL = WD_COMP_CONTROLLER->WD_GET_API( ).
    LR_WINDOW_MANAGER = LR_API_COMP_CONTRL->GET_WINDOW_MANAGER( ).
    clear POPUP_MSG[].
    APPEND 'Are You Sure to Delete The Records?' TO POPUP_MSG.
    CALL METHOD LR_WINDOW_MANAGER->CREATE_POPUP_TO_CONFIRM
    EXPORTING
    TEXT = POPUP_MSG
    BUTTON_KIND = IF_WD_WINDOW=>CO_BUTTONS_YESNO
    MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_QUESTION
    * CLOSE_BUTTON = ABAP_TRUE
    WINDOW_TITLE = 'Message Box'
    * WINDOW_LEFT_POSITION =
    * WINDOW_TOP_POSITION =
    * WINDOW_POSITION =
    * WINDOW_WIDTH =
    * WINDOW_HEIGHT =
    RECEIVING
    RESULT = LR_POPUP_WINDOW
    LR_VIEW_CONTROLLER = WD_THIS->WD_GET_API( ).
    CALL METHOD LR_POPUP_WINDOW->SUBSCRIBE_TO_BUTTON_EVENT
    EXPORTING
    BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
    * BUTTON_TEXT =
    * TOOLTIP =
    ACTION_NAME = 'YES'
    ACTION_VIEW = LR_VIEW_CONTROLLER
    * IS_DEFAULT_BUTTON = ABAP_FALSE
    LR_POPUP_WINDOW->OPEN( ).
    3. modify the code for yes action event handler also like below
    DATA:
    NODE_MODULE TYPE REF TO IF_WD_CONTEXT_NODE,
    ELEM_MODULE TYPE REF TO IF_WD_CONTEXT_ELEMENT
    *STRU_MODULE TYPE IF_V_MODULE=>ELEMENT_MODULE
    DATA id TYPE ZAC_MODULES-ZMODULE_id.
    ** navigate from <CONTEXT> to <MODULE> via lead selection
    NODE_MODULE = WD_CONTEXT->GET_CHILD_NODE( NAME = `MODULE` ).
    DATA IND TYPE I.
    WD_cONTEXT->GET_ATTRIBUTE(
    EXPORTING
    NAME = 'INDX'
    IMPORTING
    VALUE = IND
    ELEM_MODULE = NODE_MODULE->GET_ELEMENT( INDEX = IND ).
    CALL METHOD ELEM_MODULE->GET_ATTRIBUTE
    EXPORTING
    NAME = 'ZMODULE_ID'
    IMPORTING
    VALUE = id.
    NODE_MODULE->REMOVE_ELEMENT( ELEM_MODULE ).
    delete FROM zac_modules WHERE zmodule_id = id.
    wd_comp_controller->filltablemodule( ).
    * get message manager
    DATA: L_CURRENT_CONTROLLER TYPE REF TO IF_WD_CONTROLLER,
    L_MESSAGE_MANAGER TYPE REF TO IF_WD_MESSAGE_MANAGER.
    L_CURRENT_CONTROLLER ?= WD_THIS->WD_GET_API( ).
    CALL METHOD L_CURRENT_CONTROLLER->GET_MESSAGE_MANAGER
    RECEIVING
    MESSAGE_MANAGER = L_MESSAGE_MANAGER
    * report message
    CALL METHOD L_MESSAGE_MANAGER->REPORT_SUCCESS
    EXPORTING
    MESSAGE_TEXT = 'Record Deleted Successfully'
    * PARAMS =
    * MSG_USER_DATA =
    thanks
    sarbjeet singh

  • Display Error Message in ESS

    Dear all,
    I have a requirement in WEB DynPro, Our ESS system using WEB DynPro.
    In ESS leave system need to display error message.ie
    once leave approved, employees are not allowed to change the leave.
    Any idea to write code to display error message.
    Thanks.
    Shruthi.

    Error messages can be displayed in two ways:
    1. In the message area
    2. As a popup
    Below are the code snippets for it.
    1.
    * get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
        CALL METHOD lo_message_manager->report_error_message
          EXPORTING
            message_text = 'Error message'.
    2.
    "Display Popup 
      DATA:  l_popup  TYPE REF TO if_wd_window,
             l_text  TYPE string_table.
      APPEND `Error Message` TO l_text.
      l_popup = wd_comp_controller->wd_get_api( )->get_window_manager( )->create_popup_to_confirm(
        text  = l_text
        close_button = abap_false
        button_kind  = if_wd_window=>co_buttons_ok
        message_type  = if_wd_window=>co_msg_type_error
        window_title  = 'Error'
        window_position = if_wd_window=>co_center ).
      l_popup->open( ).
    Hope this helps!

  • Error message as popup in webdynpro for Abap

    Hi,
    Use method REPORT_ERROR_MESSAGE of interface IF_WD_MESSAGE_MANAGER to create an error message in the webdynpro application.
    This works fine, the message is shown in the message area.
    Now I want to have the error message in a popup.
    In the method REPORT_ERROR_MESSAGE i set the parameter SHOW_AS_POPUP on abap_true but i get no popup.
    Is anyone familar with this?
    Thanks.
    Vincent.

    Hi Vincent.
    That's one I fell into as well.  That importing field is not is use yet.  Perhaps in a future support stack.
    You can bypass that by using the CREATE_POPUP_TO_CONFIRM method.  Below, you'll find some code from SAP's documentation.  All you need to do is select the button type and create some actions to receive input from the popup.
    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_comp_controller->wd_get_api( ).
    l_window_manager = l_cmp_api->get_window_manager( ).
    insert `Data where changed` into table l_text. "#EC *
    insert `Do you want to save?` into table l_text. "#EC *
    l_popup = 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_question
        window_title = 'Test: Popup to confirm'
        window_position = if_wd_window=>co_center )."#EC *
    l_api = wd_this->wd_get_api( ).
    l_popup->subscribe_to_button_event(
        button = if_wd_window=>co_button_yes
        action_name = 'YES'
        action_view = l_api
        is_default_button = abap_true ).
    l_popup->subscribe_to_button_event(
        button = if_wd_window=>co_button_no
        action_name = 'NO'
        action_view = l_api
        is_default_button = abap_false ).
    l_popup->subscribe_to_button_event(
        button = if_wd_window=>co_button_cancel
        action_name = 'CANCEL'
        action_view = l_api
        is_default_button = abap_false ).
    l_popup->open( ).
    Hope this helps.
    Adam

  • Popup size error in Webdynpro for ABAP

    Hi Experts!
    Recently we upgraded our SAP HR system
    FROM
    SAP_BASIS     700       0016
    SAP_ABA        700       0016
    TO
    SAP_BASIS     700       0017
    SAP_ABA        700       0017
    After the upgrade, all popup called with create_popup_to_confirm in our Webdynpro ABAP programmes, has become oversized. And we can't see the buttons just like links. As you can see at the links.
    [View before and after SP|http://www.geocities.com/bajusz79/popup.JPG]
    1. Oversized popup
    2. No buttons displayed, just links
    I cant find any usefull SAP notes. If you know a note number or any solution, please help me!
    Thank you!
    Peter
    Edited by: Peter Bajusz on Jul 17, 2009 10:34 AM

    Hi,
    We faced a similiar problem. Luckily for us, we were supposed to upgrade to SP19 and the problem got resolved post SP19 upgrade.
    Pls. share if you've got any alternative solution.
    Regds,
    Srini

Maybe you are looking for

  • Iphoto 11 on macbook pro os 10.7 - can't edit photos

    I am using an older macbook pro with lion 10.7 OS with iphoto 11 and aperture 3.  My iphoto library is a rebuilt one because I did have trouble with the original.  All has been working fine.  Suddenly I cannot edit.  On certain photos I get a message

  • How can get document from mac to iphone

    How can I get document from imac that is saved, to my iphone?

  • Display Payment Proposal

    Hi All, We have a requirement to give access to some users to only view the payment proposal. Txn FBZ0 gives user the access to edit the proposal as well. Is there any way we can restrict the user to only view the payment proposal & not be able to ed

  • Web Dynpro Tree with Hyperlink

    Hello experts, i´ve got a WebDynpro Abap application which conaints a tree - UI Element. This tree is filed with WD-Component names and by clicking a tree element the named WD-Component is loaded. Now i need a tree-node which sends the user to an ext

  • Firefix stops responding when I try to open a web page

    The Firefox browser page turns white & says not responding when I try to go to a web page. This happens every time I try to go to a web page in a new tab. This only started happening after I did the last Firefox update.