Application Development and Automation 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: 
Read only

SAP screen

Former Member
0 Likes
1,099

how to add url to screen?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,062

In a dynpro, you would setup a output only field in the screen which would respond to double click(check the check box), you can then use the EXECUTE method of the class CL_GUI_FRONTEND_SERVICES to fire IE with your url. That's it.

Regards,

Rich Heilman

how to add url to screen?

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,063

In a dynpro, you would setup a output only field in the screen which would respond to double click(check the check box), you can then use the EXECUTE method of the class CL_GUI_FRONTEND_SERVICES to fire IE with your url. That's it.

Regards,

Rich Heilman

Read only

0 Likes
1,062

to expand on Rich's suggestion.. this is how you call the URL on double click..

call method cl_gui_frontend_services=>execute
  exporting
    document = 'http://www.sap.com'
  exceptions
    others   = 1.

~Suresh

P.S. Pl ignore my post as Rich has given the complete solution.

Message was edited by: Suresh Datti

Message was edited by: Suresh Datti

Read only

0 Likes
1,062

Check this sample program. Here i have created an input field called URL on the screen and made it output only. I also checked the "Responds to double click" checkbox. I create the gui status 100 and assign the fcode "PICK" to the F2 function. Now when you click on that field on the screen it will fire the PAI with the sy-ucomm = 'PICK', there you can fire the method call.



report  zrich_0003.

<b>data: url type string.

url = 'http://www.sap.com'.</b>

call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
  set pf-status '0100'.
*  SET TITLEBAR 'xxx'.

endmodule.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.

  case sy-ucomm.

    when 'PICK'.

<b>    call method cl_gui_frontend_services=>execute
      exporting
        document = url.</b>


    when 'BACK'.

    leave program.

  endcase.


endmodule.                 " USER_COMMAND_0100  INPUT

Regards,

Rich Heilman

Read only

0 Likes
1,062

Oh, that's for the backup, Suresh, I was in the middle of doing a sample.

Regards,

Rich Heilman

Read only

0 Likes
1,062

BTW, Venu, Welcome to SDN!

Suresh, see you vegas?

Regards,

Rich Heilman

Read only

0 Likes
1,062

Yes Rich I will be there all 5 days.. hope I get a chance to meet you during your Next Gen session..

~Suresh

Read only

0 Likes
1,062

I'll be there.... we got some really cool stuff to show, but we are counting on the group to drive the session, so bring your questions, comments, ideas, suggestions, etc. Should be a good session.

Regards,

Rich Heilman

Read only

0 Likes
1,062

hallo suresh,

thanx for your answer,but the url on screen look like <u>sdn.sap.com</u>.by clicking once it should open the site.

is it possible?

Read only

0 Likes
1,062

Yes, but you will have to concatenate the 'http://www.' on to the url field before calling the method.

Regards,

Rich Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,062

Venu, if your problem is solved, please make sure to award points for helpful answers and mark as solved. Thanks and welcome to SDN

Regards,

Rich Heilman