function zcm_get_bot_exchangerate.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(URI) TYPE C
*" VALUE(DEST) TYPE RFCDES-RFCDEST DEFAULT 'SAPHTTP'
*" VALUE(BTOCRLF) TYPE C DEFAULT 'Y'
*" TABLES
*" RESPONSE
*" RESPONSE_HEADERS
*"----------------------------------------------------------------------
types: begin of text,
line(120) type c,
end of text.
data: xuri type string,
status(3) type c,
statustext(128) type c,
rlength type i,
key type i value 1303621,
slen type i,
t1 type i,
t2 type i,
ti type i,
user(30) type c,
pwd(30) type c.
xuri = uri.
slen = strlen( user ).
call function 'HTTP_SCRAMBLE'
exporting
source = user
sourcelen = slen
key = key
importing
destination = user.
slen = strlen( pwd ).
call function 'HTTP_SCRAMBLE'
exporting
source = pwd
sourcelen = slen
key = key
importing
destination = pwd.
get run time field t1.
data : lv_uri(500) type c.
lv_uri = uri.
call function 'HTTP_GET'
exporting
absolute_uri = lv_uri
rfc_destination = dest
user = user
password = pwd
blankstocrlf = btocrlf
importing
status_code = status
status_text = statustext
response_entity_body_length = rlength
tables
response_entity_body = response
response_headers = response_headers.
call function 'RFC_CONNECTION_CLOSE'
exporting
destination = dest
exceptions
others = 0.
endfunction.
ไม่มีความคิดเห็น:
แสดงความคิดเห็น