Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

To display a URL in pop up message along with some more messages

Pavithrra
Participant
0 Kudos

Hi All,

I have a requirement to display  URL address (like http://help.sap.com )as hyperlink, along with normal text, in dialog screen.

For eg, I want to display

" The SAP version 7.0 is no longer supported and must be upgraded. Please contact your IT support to arrange for the latest version. If you have local administration/. Please install yourself.

The latest version can be obtained herefollow the link [http://help.sap.com] "( this is a sample hyperlink but i am using a bigger text here)

For that I need to know the Function module / Class-Method / HTML code , which I can use.

I am fetching the message text from an internal table.

How can I distinguish the normal text from hyperlink text ?

I am populating custom control using 'CL_GUI_TEXTEDIT'.

I can use a different class, if that will help me in displaying the hyperlink.

Solutions posted to this query would be highly appreciated.

Thanks in advance.

Regards,

Pavi

1 ACCEPTED SOLUTION

former_member184158
Active Contributor
0 Kudos

Hi Pavithrra Narayanan

I think, you can do your text as documentation and then you can display as F1, it is the same when we just press F1, and comes a documention, inside this documetniotn, you can maintain your URL.

look at this .

Regards

Ibrahim

14 REPLIES 14

Jelena
Active Contributor
0 Kudos

I don't have the exact answer from the top of my head, but the links may be frequently seen when documentation is displayed. So maybe you could maintain the text as documentation and then display it. There are some function modules for that, do Google search or debug any Help pop-up.

Juwin
Active Contributor
0 Kudos

Similar to Jelena's answer....

You have to format the data, similar to how you would define a documentation and once you have the internal table ready, you can call  HELP_DOCULINES_SHOW function module to show the documentation as a popup.

Thanks,

Juwin

0 Kudos

Thanks Juwin for pointing out the  function module HELP_DOCULINES_SHOW .

Regards,

Pavi

former_member184158
Active Contributor
0 Kudos

Hi Pavithrra Narayanan

I think, you can do your text as documentation and then you can display as F1, it is the same when we just press F1, and comes a documention, inside this documetniotn, you can maintain your URL.

look at this .

Regards

Ibrahim

0 Kudos

HI Ibrahim,

IF you don't mind,Can you please share me the class or the way the hyperlink can be added inside the documentation.

Thanks,

Pavithrra

0 Kudos

Hi,

I have another idea, you can create ALV grid with one field and set this field as hotspot, when he clicks, this link, it will open a new website. if you would like the code I can write it and post it here .

Regards.

Ibrahim

0 Kudos

Hi Ibrahim,

Thanks for the idea. If possible can you please share the sample code I will try that also and let you know.

Many Thanks,

Pavithrra

0 Kudos

Hi,

I have created an ALV-Grid, and in this alv, only one field which contains the message. when the user clicks the msg, so he can navigates the url

*&---------------------------------------------------------------------*
*& Report  Z_IBO_F4
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  z_ibo_alv_pop_sel_url_hotspot.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 3(30) text-001.
SELECTION-SCREEN PUSHBUTTON 35(20) oke1 USER-COMMAND oke1 MODIF ID aaa.
SELECTION-SCREEN END OF LINE.

DATA: BEGIN OF t_alv,
      msg_info
TYPE string,
     
END OF t_alv.

DATA lt_alv LIKE TABLE OF t_alv.
DATA: it_events TYPE slis_t_event,
      wa_events
LIKE LINE OF it_events.
DATA: it_variant LIKE disvariant.

*data declarations for ALV
DATA: s_fieldcat      TYPE slis_fieldcat_alv,
      t_fieldcat     
TYPE slis_t_fieldcat_alv,
      s_layout       
TYPE slis_layout_alv.

INITIALIZATION.
 
MOVE: 'SHOW MSG ' TO oke1.
  t_alv
-msg_info = 'Click here please for more information'.
 
APPEND t_alv TO lt_alv.

AT SELECTION-SCREEN.
 
CASE sy-ucomm.
   
WHEN 'OKE1'.

*      alv layout
      s_layout
-zebra = 'X'.
      s_layout
-colwidth_optimize = 'X'.

*      alv field catalog
     
CLEAR s_fieldcat.
      s_fieldcat
-row_pos   = '1'.
      s_fieldcat
-col_pos   = '2'.
      s_fieldcat
-fieldname = 'MSG_INFO'.
      s_fieldcat
-tabname   = 'T_ALV'.
      s_fieldcat
-seltext_m = 'INFO MSG '.
      s_fieldcat
-outputlen = 100.
      s_fieldcat
-hotspot = 'X'.
     
APPEND s_fieldcat TO t_fieldcat.

     
REFRESH: it_events.
     
CLEAR: wa_events,it_events.
      wa_events
-name = 'USER_COMMAND'.
      wa_events
-form = 'USER_COMMAND'.
     
APPEND wa_events TO it_events .
*--- ALV List Display

     
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       
EXPORTING
          i_callback_program     
= sy-repid
          i_callback_user_command
= 'USER_COMMAND'
          i_grid_title           
= 'Display Table'
          is_layout              
= s_layout
          it_fieldcat            
= t_fieldcat
          i_screen_start_column  
= 50
          i_screen_start_line    
= 1
          i_screen_end_column    
= 120
          i_screen_end_line      
= 13
       
TABLES
          t_outtab               
= lt_alv
       
EXCEPTIONS
          program_error          
= 1
         
OTHERS                  = 2.
     
IF sy-subrc  = 0.
     
ENDIF.
 
ENDCASE.


*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
                rs_selfield
TYPE slis_selfield.

* Check function code
 
CASE r_ucomm.
   
WHEN '&IC1'.

     
DATA ld_url(1000).

       ld_url = 'http://scn.sap.com/thread/3764715'.       

     
CALL FUNCTION 'CALL_BROWSER'
       
EXPORTING
          url
= ld_url.
 
ENDCASE.
ENDFORM.                    "user_command



0 Kudos

While in change mode of the documentation, click on Insert -> Link, to insert various kinds of hyperlinks in the documentation.

Thanks,

Juwin

0 Kudos

Hi Juwin Pallipat Thomas

yes you can do this, but he wants a URL to Website ... for example,

so you can create a link, but how can you call the url ... this is the question.

0 Kudos

It is discussed here:

Thanks,

Juwin

0 Kudos

Hi Ibrahim,

Thanks a lot for your sample code input. It helped me a  lot. based on that I have modified in the standard user exit. Once again thanks for your help.

Regards,

Pavithrra

0 Kudos

Thanks Juwin for this additional point also.

Pavithrra
Participant
0 Kudos

Hi Jelena, Juwin and Ibrahim,

Thanks for the input. Will try these options and see. Thanks for your time.

Thanks,

Pavithrra