cancel
Showing results for 
Search instead for 
Did you mean: 

Popup Message

Former Member
0 Kudos

Hi,

I am looking for some step to build up a pop up message for on selection of employee. The popup text message information contains 4 lines with a TEXT that links to URL with a continue button. Can you pls let me know how to start with this requirment.

Many Thanks,

Kumar.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

I would suggest you to follow this approach :

1. Create another view View2.

2. Embed whatever UI elements you want.

Ex. As per your requriment , Embed a LinkToURL, Text Views, Buttons.

3. LinktoURL when clicked will take you to the URL you give.

4. Inside TextViews give any Text which you want to display when your pop up window opens.

5. Create another Window Win2.

6. Embed View2 into window win2.

7. Call this window using this code :

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 = 'WND2" Name of the new window

TITLE = 'Please enter all information'

CLOSE_BUTTON = ABAP_TRUE

BUTTON_KIND = if_wd_window=>CO_BUTTONS_YESNO

MESSAGE_TYPE = if_wd_window=>co_msg_type_error

CLOSE_IN_ANY_CASE = ABAP_TRUE

*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE

).

I hope it is clear.

Former Member
0 Kudos

hi Saurav,

I created a window and view accordingly and also embedded the view in the window. Included the text in the view. In Onaction button i included the code as below. The popup is comming up but with out the text tht been included in the view. Am i missing any thing ?

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 lr_view_controller TYPE REF TO if_wd_view_controller.

lo_api_component = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window =

lo_window_manager->create_window(

window_name = 'ZPOPUP_WINDOW'

  • title =

  • close_in_any_case = abap_true

message_display_mode = if_wd_window=>co_msg_display_mode_selected

  • close_button = abap_true2

button_kind = if_wd_window=>co_buttons_okcancel

*message_type = if_wd_window=>co_msg_type_information

default_button = if_wd_window=>co_button_ok

).

lo_window->open( ).

Thanks,

Kumar.

Former Member
0 Kudos

hi,

Have you created TextViews inside your new View and give them texts.

Try adding more UI's and see if they are visible or not.

Former Member
0 Kudos

Hi Saurav,

i was able to populate the pop up with text in it. i have one more issue . I concatenated URL along with the text as below. Though the 'Text for URL (Guide in this case)' is been grayed out its not providing the 'Hand link' to the URL .

w_url = '<a href="http://infodocs/pdfstore/ppfinal.pdf">Guide</a>'

CONCATENATE 'employees detais' w_url 'check the link for more info' into l_text.

Then i am assigning l_text to the Formatted Textview UI element.

Is there any thing i am missing for the URL link.

Thanks,

Kumar.

Former Member
0 Kudos

Have you used LinkTo URL or LinkToAction. If you have used Linktoaction then impelment the action handler for that then you will get the hand icon. If you are using the LinkToURL then try to give the correct URL(full domain).

Try to use LinkToAction UI element.

I guess, you are directly concatenating the string and display that message, and part of the text is URL right.

Then you have to have textview, LinkToAction,textview as a part of the UI elements.

Have you deisgned the layout that way or not.

Ex:

w_url = 'Guide'

CONCATENATE 'employees detais' w_url 'check the link for more info' into l_text.

display ' employee details' text in one Textview UI element,

LinkToAction - Guide

display 'check the link for more info' in other Text view.

Then i am assigning l_text to the Formatted Textview UI element.

Hope this is clear.

Regards,

Lekha.

Edited by: Lekha on Oct 24, 2009 12:51 PM

Former Member
0 Kudos

Hi kumar ,

create a VIEW for ur POP UP , embed it in the window

refer the related threads:

https://forums.sdn.sap.com/click.jspa?searchID=18060596&messageID=6339445

https://forums.sdn.sap.com/click.jspa?searchID=18060596&messageID=6198079

u create POPUP mesasage in ur embedded view under window as follow :

1 go to ur code wizard ( CNTRL + F7 )

2 click on the generate message

3 select appropriate method



**   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
*      .
*   CONCATENATE 'You have logged in as :' SY-UNAME
*    ' You are not authorised to add records .' into l_message
*      SEPARATED BY space .
*
*   CALL METHOD lo_message_manager->report_error_message
*     EXPORTING
*       message_text = l_message .

eg this report_error_message for error messages

4 u create ur button there inur embedded view and correspondingly navigate to URL

former_member40425
Contributor
0 Kudos

Create a new window and embedd a view in that which containts all UIs according to your requirement.

And open the new window in the main window.

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

Hi,

Create a view wtih the UI elements(URL(link to URL/Action, button) that you require and call this view in the MAIN view

as per your requirement. Create a window for this view and embed inside this.

Create an action for that URL in that view and navigate to other based on your requirement.

Regards,

Lekha.

Edited by: Lekha on Oct 23, 2009 2:51 PM