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: 

How to call an URL from ABAP

Former Member
0 Kudos
2,322

Hi,

When an user clicks on a document display link in a SAP tranasction(for example FB02),an URL has to be called in the background(by ABAP) and the details of the URL should be displayed in a browser.

What are the possilbe options available in SAP4.7 to meet the above requirement?

Thanks in advance,

Leo

1 ACCEPTED SOLUTION

Former Member
0 Kudos
597

Do as below

DATA: gd_webaddr TYPE string VALUE 'www.google.co.in'.
CALL METHOD cl_gui_frontend_services=>execute
 EXPORTING
    document = gd_webaddr
  EXCEPTIONS
    OTHERS   = 1.

type the url u want to execute.

Hope this helps.

Kindly reward points for the answer which helped u.

4 REPLIES 4

Former Member
0 Kudos
597

hi,

you can use call browser function

data url(200) type c.

url = 'your_url'.

CALL FUNCTION 'CALL_BROWSER'

EXPORTING

URL = url

  • WINDOW_NAME = ' '

  • NEW_WINDOW = ' '

  • BROWSER_TYPE =

  • CONTEXTSTRING =

  • EXCEPTIONS

  • FRONTEND_NOT_SUPPORTED = 1

  • FRONTEND_ERROR = 2

  • PROG_NOT_FOUND = 3

  • NO_BATCH = 4

  • UNSPECIFIED_ERROR = 5

  • OTHERS = 6

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

for this you have to enable SSO on your server.

hope this helps you, else revert back.

regards,

Hemendra

Former Member
0 Kudos
597

Hi Dsouza,

You can call an URL from ABAP via HTTPS.You can use cl_http_client to achive the same.check out the following weblogs.

/people/durairaj.athavanraja/blog/2005/07/12/send-sms-to-india-from-abap

/people/thomas.jung3/blog/2005/05/13/calling-webservices-from-abap-via-https

/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap

Or You can check this web log :

/people/eddy.declercq/blog/2005/06/14/it146s-a-matter-of-trust

Also check the ABAP web service tutorial under help.sap.com?

http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/content.htm

reward points if you find the answers usefull.

Regards,

Albert

Former Member
0 Kudos
598

Do as below

DATA: gd_webaddr TYPE string VALUE 'www.google.co.in'.
CALL METHOD cl_gui_frontend_services=>execute
 EXPORTING
    document = gd_webaddr
  EXCEPTIONS
    OTHERS   = 1.

type the url u want to execute.

Hope this helps.

Kindly reward points for the answer which helped u.

Former Member
0 Kudos
597

Thanks for all your suggestions.I could locate the

Create external document(URL) in FB02 transaction application toolbar.

Thanks,

Leo