07-23-2010 12:50 PM
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.
07-23-2010 1:37 PM
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á
07-23-2010 1:41 PM
Hi!
OR if you have to execute a WebService from SAP, then go through this document:
Regards
Tamá
07-23-2010 2:21 PM
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?