‎2010 Jul 12 9:05 AM
Hi,
I want to read a file on http server of a 3rd party application, in R/3 system.
How can this be acheived?
Kindly help!
Thanks,
Pratibha.
‎2010 Jul 12 11:28 AM
The following code will POST a parameter to a server and receive data:
DATA: lo_client TYPE REF TO if_http_client,
lv_url TYPE string VALUE 'http://someserver.com/'
CALL METHOD cl_http_client=>create_internal
IMPORTING
client = lo_client.
cl_http_utility=>set_request_uri( request = lo_client->request
uri = lv_url ).
lo_client->request->set_header_field( name = '~request_method'
value = 'POST' ).
lo_client->request->set_form_field( EXPORTING name = 'myfield'
value = 'myvalue' ).
lo_client->send( ).
* get response
call method li_client->receive
exceptions
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.
However, you might be better of creating a web service for this kind of communication.
regards
Frank