TYPES:BEGIN OF tp_title,
funnam TYPE char20,
dattyp TYPE c,
lgnnam TYPE char20,
END OF tp_title.
TYPES: BEGIN OF tp_payqx,
buscod TYPE c,
busmod TYPE c,
modals TYPE c,
END OF tp_payqx.
TYPES: BEGIN OF tp_paydtx,
yurref TYPE c,
eptdat TYPE c,
epttim TYPE c,
dbtacc TYPE c,
dbtbbk TYPE c,
c_dbtbbk TYPE c,
trsamt TYPE c,
ccynbr TYPE c,
c_ccynbr TYPE c,
stlchn TYPE c,
c_stlchn TYPE c,
nusage TYPE c,
busnar TYPE c,
crtacc TYPE c,
crtnam TYPE c,
brdnbr TYPE c,
crtbnk TYPE c,
ctycod TYPE c,
crtpvc TYPE c,
crtcty TYPE c,
crtdtr TYPE c,
ntfch1 TYPE c,
ntfch2 TYPE c,
crtsqn TYPE c,
END OF tp_paydtx.
TYPES: BEGIN OF tp_body,
funnam TYPE char20,
dattyp TYPE c,
lgnnam TYPE char20,
buscod TYPE c,
busmod TYPE c,
modals TYPE c,
yurref TYPE c,
eptdat TYPE c,
epttim TYPE c,
dbtacc TYPE c,
dbtbbk TYPE c,
c_dbtbbk TYPE c,
trsamt TYPE c,
ccynbr TYPE c,
c_ccynbr TYPE c,
stlchn TYPE c,
c_stlchn TYPE c,
nusage TYPE c,
busnar TYPE c,
crtacc TYPE c,
crtnam TYPE c,
brdnbr TYPE c,
crtbnk TYPE c,
ctycod TYPE c,
crtpvc TYPE c,
crtcty TYPE c,
crtdtr TYPE c,
ntfch1 TYPE c,
ntfch2 TYPE c,
crtsqn TYPE c,
END OF tp_body.
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA:
it_dbcon TYPE dbcon OCCURS 0,
wa_dbcon TYPE dbcon.
DATA: http_client TYPE REF TO if_http_client,
lv_xstring TYPE xstring,
lv_string TYPE string,
v_string TYPE string,
return_str TYPE string.
DATA: proxy_host TYPE string VALUE '172.27.70.66' ,
proxy_port TYPE string VALUE '8080',
proxy_user TYPE string ,
proxy_pass TYPE string .
DATA: len TYPE i.
CONSTANTS:
* C_T01 TYPE STRING VALUE
* '',
* C_T02 TYPE STRING VALUE
* '',
c_t01 TYPE string VALUE
'',
c_t03 TYPE string VALUE ''.
LOOP AT zttr_eppk INTO zttr_eppk.
CONCATENATE c_t01
''
''
'' 'Payment' ''
'' '2' ''
'' 'ZL01' ''
''
''
'' 'N02031' ''
'' '00001' ''
''
''
'' zttr_eppk-yurref ''
'' zttr_eppk-eptdat ''
'' zttr_eppk-epttim ''
'' zttr_eppk-dbtacc ''
'' zttr_eppk-c_dbtbbk ''
* '' zttr_eppk-trsamt ''
'' zttr_eppk-ccynbr ''
'' zttr_eppk-c_ccynbr ''
'' zttr_eppk-nusage ''
'' zttr_eppk-crtacc ''
'' zttr_eppk-crtnam ''
'' zttr_eppk-crtbnk ''
'' zttr_eppk-crtpvc ''
'' zttr_eppk-crtcty ''
'' zttr_eppk-oprlgn ''
''
''
INTO v_string.
ENDLOOP.
*----------------------------------------------------------------------*
* Deal with layout format to xml *
*----------------------------------------------------------------------*
SELECT *
INTO CORRESPONDING FIELDS OF TABLE it_dbcon
FROM dbcon
WHERE con_name = connect.
IF sy-subrc = 0.
READ TABLE it_dbcon INTO wa_dbcon WITH KEY con_name = connect.
IF sy-subrc 0.
MESSAGE 'ERROR ' TYPE 'E'.
ENDIF.
ENDIF.
CALL METHOD cl_http_client=>create
EXPORTING
host = '172.0.0.1'
service = '8080'
proxy_host = '172.0.0.1'
proxy_service = '8080'
scheme = '1'
* ssl_id =
* sap_username =
* sap_client =
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4
.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
len = STRLEN( v_string ).
http_client->propertytype_logon_popup = http_client->co_enabled .
CALL METHOD http_client->request->set_header_field
EXPORTING
name = '~request_method'
value = 'POST'.
CALL METHOD http_client->request->set_cdata
EXPORTING
data = v_string
offset = 0
length = len.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR return_str.
return_str = http_client->response->get_cdata( ).
CONDENSE return_str NO-GAPS.
CALL METHOD http_client->close.
|