|
文件: | BOCNET银企对接标准版前置机接口规范(20101120).rar |
大小: | 264KB |
下载: | 下载 |
|
FUNCTION zfm_ficob2eboc_intf.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_DATAIN) TYPE ANY
*" VALUE(I_TRANSACTION) TYPE ZFICOE008
*" VALUE(I_MULTIRESP) TYPE CHAR1
*" VALUE(I_TRNID) TYPE ZFICOE009
*" VALUE(I_SEQUENCE) TYPE INT2
*" VALUE(I_REAPPEND1) TYPE ANY DEFAULT ''
*" VALUE(I_REAPPEND2) TYPE ANY DEFAULT ''
*" EXPORTING
*" REFERENCE(E_ERROR)
*" REFERENCE(E_DATAOUT) TYPE ANY
*" REFERENCE(E_RSPMSG) TYPE ANY
*" CHANGING
*" REFERENCE(C_MSGOUT) TYPE ZFICOTT0001
*"----------------------------------------------------------------------
*错误消息的设计:错误消息标识分为stg1和stg2,stg1表示SAP请求在成功发送出
*去及之前发生的错误,stg2表示成功发送后开始接收响应到框架结束这段时间发
*生的错误
* 数据对象声明
DATA:lv_flg TYPE c, "标识 ='X'表示接口出错
ls_request TYPE string, "请求的XML串
ls_response TYPE string. "银行端响应的XML串
* 初始化全局变量
CALL FUNCTION 'ZFM_FICOCLEAR'.
* 检查配置信息
CALL FUNCTION 'ZFM_FICOCONFIGCHECK'
EXPORTING
i_transaction = i_transaction
i_reappend1 = i_reappend1
i_reappend2 = i_reappend2
i_dataout = e_dataout
i_rspmsg = e_rspmsg
CHANGING
c_msgout = c_msgout.
IF LINES( c_msgout ) NE 0.
lv_flg = cns_yes.
ENDIF.
* 配置检查通过
IF lv_flg NE cns_yes.
* 将SAP内表转换为符合银行端要求的XML格式信息
CALL FUNCTION 'ZFM_FICODATA2XML'
EXPORTING
i_datain = i_datain
i_transaction = i_transaction
i_reappend1 = i_reappend1
i_reappend2 = i_reappend2
IMPORTING
e_dataout = ls_request
CHANGING
c_msgout = c_msgout.
IF LINES( c_msgout ) NE 0.
lv_flg = cns_yes.
ENDIF.
ENDIF.
* 内表内容转换为银行端要求XML格式正确
IF lv_flg NE cns_yes.
* 将消息发送到银行端,同时获取返回的响应消息
CALL FUNCTION 'ZFM_FICOSEND2BANK'
EXPORTING
i_datain = ls_request
IMPORTING
e_dataout = ls_response
CHANGING
c_msgout = c_msgout.
IF LINES( c_msgout ) NE 0.
lv_flg = cns_yes.
ENDIF.
ENDIF.
* 只是在开发机测试用,正式环境无数据
CALL FUNCTION 'ZFM_FICOLOCALTEST'
EXPORTING
i_transaction = i_transaction
i_sequence = i_sequence
IMPORTING
e_dataout = ls_response
CHANGING
c_flg = lv_flg.
* 请求/响应正常结束
IF lv_flg NE cns_yes.
* 将银行端返回的响应消息转换为内表数据
CALL FUNCTION 'ZFM_FICOXML2DATA_2'
EXPORTING
i_datain = ls_response
i_transaction = i_transaction
i_multiresp = i_multiresp
IMPORTING
e_dataout = e_dataout
e_rspmsg = e_rspmsg
CHANGING
c_msgout = c_msgout.
IF LINES( c_msgout ) NE 0.
lv_flg = cns_yes.
ENDIF.
ENDIF.
* 记录接口日志,记录与否取决于开发配置
* 建议代发/转账类型的交易记录日志,查
* 询类的交易不做记录
IF gs_deftran-zlogflg = cns_yes.
CALL FUNCTION 'ZFM_FICORECLOG'
EXPORTING
i_transaction = i_transaction
i_request = ls_request
i_response = ls_response
i_trnid = i_trnid
i_sequence = i_sequence
CHANGING
c_msgout = c_msgout.
* 日志记录错误,不报错
* IF LINES( c_msgout ) NE 0.
* lv_flg = cns_yes.
* ENDIF.
ENDIF.
e_error = lv_flg.
ENDFUNCTION.
阅读(4198) | 评论(4) | 转发(0) |