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: 

Launch an URL

0 Kudos

Hi,

Your requirement is to retrieve a XML file from an application unSAP. For this, in SAP, we must launch an query (an http URL with an user and password) in order to retrieve a XML file and add this content in an SAP internal table.

Do you know how do this?

Thanks in advance.

3 REPLIES 3

Former Member
0 Kudos

Hi!

Please check out this sample:

DATA: ls_zll_service TYPE zll_service.
  DATA: sysid TYPE srcsystem.

  DATA: command TYPE string,
        lv_application TYPE string,
        returncode TYPE  i.

  DATA: c1(200) TYPE c,
        c2(200) TYPE c,
        c3(200) TYPE c,
        c4(200) TYPE c,
        c5(200) TYPE c.

  DATA: lv_objkey_url TYPE borident-objkey,
        lv_index TYPE sy-index,
        lv_length TYPE i.

  CALL FUNCTION 'GET_SYSTEM_NAME'
       IMPORTING
            system_name = sysid.

    MOVE 'http://www.sap.com'
                TO c1.

    CONCATENATE c1 c2 c3 c4 c5 INTO command.
    CONCATENATE 'url.dll,FileProtocolHandler'
                command
           INTO command
       SEPARATED BY space.

    MOVE 'rundll32' TO lv_application.
    CALL METHOD cl_gui_frontend_services=>execute
       EXPORTING
         APPLICATION            = lv_application
         PARAMETER              = command
       EXCEPTIONS
         CNTL_ERROR             = 1
         ERROR_NO_GUI           = 2
         BAD_PARAMETER          = 3
         FILE_NOT_FOUND         = 4
         PATH_NOT_FOUND         = 5
         FILE_EXTENSION_UNKNOWN = 6
         ERROR_EXECUTE_FAILED   = 7
         others                 = 8
            .
  ENDIF.

100% working solution, we are using this in the productive system.

Regards

Tamá

Former Member
0 Kudos

Hi!

OR if you have to execute a WebService from SAP, then go through this document:

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30f1b585-0a01-0010-3d96-ad0ea291c...

Regards

Tamá

0 Kudos

Thank you for your answer.

I can launch an URL. BUT, by IE, my URL will return an XML. How do you do to store the XML data in an SAP internal table?