report rshttp20 line-size 132.
parameters: uri(264) type c lower case,
uri2(132) type c lower case,
dest like rfcdes-rfcdest,
btocrlf type c default 'Y'.
selection-screen skip 1.
parameters: user(30) type c lower case,
pwd(30) type c lower case.
types: begin of text,
line(120),
end of text.
data: xuri(250) type c,
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.
data: response type table of text with header line,
response_headers type table of text with header line.
set blank lines on.
concatenate uri uri2 into uri.
set parameter id 'HTTP01' field dest.
xuri = uri(250).
set parameter id 'HTTP02' field xuri.
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.
call function 'HTTP_GET'
exporting
absolute_uri = 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.
get run time field t2.
ti = ( t2 - t1 ) / 1000.
write: status, at 5 statustext, at 70 ti,'ms'.
skip 2.
loop at response_headers.
write response_headers-line.
endloop.
skip 2.
write: text-002, rlength.
skip 2.
loop at response.
write response-line.
endloop.
call function 'RFC_CONNECTION_CLOSE'
exporting
destination = dest
exceptions
others = 0.
* set default values for selection screen
initialization.
get parameter id 'HTTP01' field dest.
if sy-subrc ne 0. dest = 'SAPHTTP'. endif.
get parameter id 'HTTP02' field uri.
at selection-screen output.
loop at screen.
if screen-name = 'PWD'.
screen-invisible = '1'.
modify screen.
endif.
endloop.
阅读(9065) | 评论(0) | 转发(1) |