SAP 接口PO(PI,XI)在ECC端日志记录及显示

在接口的处理中通常会需要记录日志,而如果是与PO(PI,XI)做的接口的话,可以使用事务码SXI_MONITOR – XI:消息监控,来查询日志,但对于一些有加密,或者在业务接口功能上想直接查询报文日志时,会在ECC中创建一个表来记录报文日志信息,以下是一个调用PI的接口,调用完成后,把PI接口的MESSAGE_ID记录到表中,这样可以通过表中记录的MESSAGE_ID来直接打开PI日志。同时由于发送的报文是加密的,所以把发送前未加密的报文,及收到的解密 后的报文保存到日志表中。最后使用一个程序来显示 日志,

1.日志记录

调用接口后,记录日志,以下是一个调用接口,有加解密,

FUNCTION ZFM_TR_GYLJY_LYR_PTFW.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  IMPORTING
*"     VALUE(IV_DATUM1) TYPE  DATUM OPTIONAL
*"     VALUE(IV_DATUM2) TYPE  DATUM OPTIONAL
*"  EXPORTING
*"     REFERENCE(EV_DATA) TYPE  ZTRS_G13_OUT
*"----------------------------------------------------------------------DATA: LR_SENDER         TYPE REF TO ZTR_CO_SI_RTR_LYRPLAT_FEE_INFO,LS_OUTPUT         TYPE ZMT_LYRINFO_REQ,LS_MESSAGEOUT     TYPE ZDT_LYRINFO_REQ_IS_MESSAGE,LS_INPUT          TYPE ZMT_LYRINFO_RESP,LS_MESSAGEIN      TYPE ZDT_LYRINFO_RESP_ES_MESSAGE,LR_SYS_EXCEPTION  TYPE REF TO CX_AI_SYSTEM_FAULT,LV_DATA           TYPE STRING,LV_KEY64          TYPE STRING,LV_JAVA_TIMESTAMP TYPE STRING,LV_SIGNED_DATASTR TYPE STRING.DATA: LV_JSON   TYPE STRING,LV_TEXT   TYPE STRING,LV_DOCNO  TYPE STRING,LV_SERIAL TYPE STRING.DATA: LV_MSG             TYPE STRING,LR_CXSYS_EXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT,LR_CXAPP_FAULT     TYPE REF TO CX_AI_APPLICATION_FAULT.DATA: BEGIN OF LS_LIST,CASHAPPLYID	        TYPE STRING, "融资申请编号SEDCOMPANYNAME      TYPE STRING, "融资申请企业名称BOSCPAYAPPROVENO    TYPE STRING, "付款审批单编号PLATFEERATE	        TYPE STRING, "平台手续费率PLATFEE	            TYPE STRING, "平台手续费CASHPLATFEEMODE	    TYPE STRING, "平台服务费收取方式CASHPLATFEEPAYDATE  TYPE STRING, "平台服务费付费时间CASHPLATFEEPAYSTATE	TYPE STRING, "平台服务费支付状态END OF LS_LIST.DATA: BEGIN OF LS_DATA,MSG  TYPE STRING,CODE TYPE STRING,DATA LIKE TABLE OF LS_LIST,END OF LS_DATA.DATA: LS_DATA_LIST LIKE ZTRS_G13_LIST.DATA LS_3000 TYPE ZTRGYLT3000.DATA:L_TIME_STAMP  TYPE TIMESTAMPL,LS_TIME_STAMP TYPE CHAR100.DATA: L_GYLJKBM TYPE ZTR_GYLJKBM VALUE 'SFP0213'.DATA: L_DATUM1  TYPE DATUM,L_DATUM2  TYPE DATUM,LC_DATUM1 TYPE CHAR10,LC_DATUM2 TYPE CHAR10.CLEAR:  EV_DATA.L_DATUM1 = IV_DATUM1.L_DATUM2 = IV_DATUM2.IF L_DATUM1 IS INITIAL.L_DATUM1 = SY-DATUM.ENDIF.IF L_DATUM2 IS INITIAL.L_DATUM2 = L_DATUM1.ENDIF.LC_DATUM1 = L_DATUM1(4) && '-' && L_DATUM1+4(2) && '-' && L_DATUM1+6(2).LC_DATUM2 = L_DATUM2(4) && '-' && L_DATUM2+4(2) && '-' && L_DATUM2+6(2).GET TIME STAMP FIELD L_TIME_STAMP.LS_TIME_STAMP = L_TIME_STAMP.CONDENSE LS_TIME_STAMP  NO-GAPS.SELECT SINGLE * FROM ZTRGYLT3000 INTO LS_3000 WHERE PTBM = 'SFP02'.LV_SERIAL = 'PTFW' && LS_TIME_STAMP."LV_JSON = '{"beginPaymentTime":"' && LC_DATUM1 && '",' &&"放款日期起始时间'"endPaymentTime":"' && LC_DATUM2 && '"}'."放款日期截止时间*lv_docno = iv_docno.CALL FUNCTION 'ZFM_TR_GYLJY_LYR_ENCRYPT'EXPORTINGIV_DOCNO      = LV_DOCNOIV_SERIAL     = LV_SERIALIV_TEXT       = LV_JSONIV_3000       = LS_3000IMPORTINGEV_TEXT       = LV_DATAEV_KEY        = LV_KEY64EV_TIMESTAMPL = LV_JAVA_TIMESTAMPEV_SIGNATURE  = LV_SIGNED_DATASTR.LS_MESSAGEOUT-CHANNEL = LS_3000-APPKEY."'app'.LS_MESSAGEOUT-SERIAL_NO = LV_SERIAL.LS_MESSAGEOUT-DATA = LV_DATA.LS_MESSAGEOUT-KEY = LV_KEY64.LS_MESSAGEOUT-SIGNATURE = LV_SIGNED_DATASTR.LS_MESSAGEOUT-VERSION = LS_3000-VERSION."'1.0.0'.LS_MESSAGEOUT-TIMESTAMP = LV_JAVA_TIMESTAMP.LS_MESSAGEOUT-IS_PLAINTEXT = 'false'.LS_OUTPUT-MT_LYRINFO_REQ-IS_MESSAGE = LS_MESSAGEOUT.TRY.CREATE OBJECT LR_SENDER.CALL METHOD LR_SENDER->SI_RTR_LYRPLAT_FEE_INFO_OUT_SYEXPORTINGOUTPUT = LS_OUTPUTIMPORTINGINPUT  = LS_INPUT.CATCH CX_AI_SYSTEM_FAULT INTO LR_CXSYS_EXCEPTION.LV_MSG = LR_CXSYS_EXCEPTION->GET_TEXT( ).CATCH CX_AI_APPLICATION_FAULT INTO LR_CXAPP_FAULT.LV_MSG = LR_CXAPP_FAULT->GET_TEXT( ).ENDTRY.LS_MESSAGEIN = LS_INPUT-MT_LYRINFO_RESP-ES_MESSAGE.IF LS_MESSAGEIN IS NOT INITIAL.CALL FUNCTION 'ZFM_TR_GYLJY_LYR_DECRYPT'EXPORTINGIV_TEXT = LS_MESSAGEIN-DATAIV_KEY  = LS_MESSAGEIN-KEYIV_3000 = LS_3000IMPORTINGEV_MSG  = LV_MSGEV_TEXT = LV_TEXT.IF LV_TEXT IS NOT INITIAL./UI2/CL_JSON=>DESERIALIZE( EXPORTING JSON = LV_TEXT
*                                  pretty_name = /ui2/cl_json=>pretty_mode-camel_caseCHANGING DATA = LS_DATA ).EV_DATA-CODE = LS_DATA-CODE.EV_DATA-MSG = LS_DATA-MSG.LOOP AT LS_DATA-DATA INTO LS_LIST.LS_DATA_LIST-GYL_RZSQBH     = LS_LIST-CASHAPPLYID	        . "融资申请编号LS_DATA_LIST-GYL_RZSQMC     = LS_LIST-SEDCOMPANYNAME      . "融资申请企业名称LS_DATA_LIST-DOCNO          = LS_LIST-BOSCPAYAPPROVENO    . "付款审批单编号LS_DATA_LIST-ZPTFL          = LS_LIST-PLATFEERATE	        . "平台手续费率LS_DATA_LIST-ZPTFL = LS_DATA_LIST-ZPTFL * 100.LS_DATA_LIST-ZPTFY          = LS_LIST-PLATFEE	            . "平台手续费LS_DATA_LIST-GLY_SQFS       = LS_LIST-CASHPLATFEEMODE      . "平台服务费收取方式LS_DATA_LIST-GYL_ZFZT       = LS_LIST-CASHPLATFEEPAYSTATE  . "平台服务费支付状态LC_DATUM1 = LS_LIST-CASHPLATFEEPAYDATE  . "平台服务费付费时间YYYY-MMM-DDLS_DATA_LIST-GLY_FKDT       = LC_DATUM1(4) && LC_DATUM1+5(2) && LC_DATUM1+8(2).APPEND LS_DATA_LIST TO EV_DATA-LIST.ENDLOOP.ENDIF.ENDIF.*--------------------------------------------------------------------*
* 接口日志数据存表
*获取PO MESSAGE IDDATA: LV_PO_MSGID TYPE SXMSGUID.DATA: LR_PROTOCOL_MESSAGEID TYPE REF TO IF_WSPROTOCOL_MESSAGE_ID.DATA: LV_MSGID    TYPE ZIFT00090-MSGID,LV_T_SYSTEM TYPE C LENGTH 10 VALUE 'LYR'.   "接收系统DATA: LS_LOG TYPE ZTRT00010,LT_LOG TYPE TABLE OF ZTRT00010.TRY .LR_PROTOCOL_MESSAGEID ?= LR_SENDER->GET_PROTOCOL( IF_WSPROTOCOL=>MESSAGE_ID ).CATCH CX_AI_SYSTEM_FAULT INTO LR_SYS_EXCEPTION .ENDTRY.LV_PO_MSGID  = LR_PROTOCOL_MESSAGEID->GET_MESSAGE_ID( ).LS_LOG-MSGID          = LS_TIME_STAMP . " MSGIDLS_LOG-POMSGID        =  LV_PO_MSGID.                                              "POMSGIDLS_LOG-IFNUM          = L_GYLJKBM.                                             "接口编号LS_LOG-IFTYP          = 'PO'.                                                      "接口方式LS_LOG-IFDIR          = 'OUTBOUND' .                                               "接口方向LS_LOG-IFMODE         = 'S' .                                                      "接口模式LS_LOG-T_SYSTEM_CODE  = LV_T_SYSTEM .                                              "接收系统LS_LOG-RECVTIME = SY-DATUM && SY-UZEIT.                                            "返回时间LS_LOG-ZREDAT = SY-DATUM.LS_LOG-ZRETIM = SY-UZEIT.LS_LOG-ERNAM = SY-UNAME.LS_LOG-FILE_S = LV_JSON ."发出报文件LS_LOG-FILE_R = LV_TEXT ."收到报文LS_LOG-MESSAGE  = LV_MSG.LS_LOG-IS_ENCRY = 'X'."加密IF EV_DATA-CODE = '200'.LS_LOG-STATUS       = 'S'.           "接口状态LS_LOG-BSTATUS      = 'S'.     "业务处理状态ELSE.LS_LOG-STATUS       = 'E'.ENDIF.APPEND LS_LOG TO LT_LOG.*更新日志表IF LT_LOG[] IS NOT INITIAL.MODIFY ZTRT00010 FROM TABLE LT_LOG.IF SY-SUBRC = 0.COMMIT WORK AND WAIT.ELSE.ROLLBACK WORK.ENDIF.ENDIF.*--------------------------------------------------------------------*ENDFUNCTION.

2.显未来日志的处理程序,

*&*********************************************************************
*& PROGRAM NAME        : ZIFR00010
*& Module Name         :
*& Apply Author        : XXX
*& Author               :
*& Started on          :  %DATE%
*& Transaction         : ZIF00030
*& Program type        : Report
*& Program ID          : ZIFR00010
*& Program Description : PO接口日志以及重处理功能
*&*&*******************************************************************
*& REVISION LOG                                                       *
*&                                                                    *
*& LOG#    DATE       AUTHOR       DESCRIPTION                        *
*& ----    ----       ------       -----------                        *
*& 0001   XXXXXX  XXX     Initial Creation
*&*********************************************************************
REPORT ZTRE_GYLJR0010.TYPE-POOLS: SLIS.TABLES: ZIFT00010,ZSCUD_INFO.DATA: BEGIN OF GS_DATA.INCLUDE TYPE ZTRT00010.
DATA: BOX     TYPE C LENGTH 1,DURTM   TYPE ZIFS00010-DURTM,ZGYLJKT TYPE ZTR_GYLJKBMT,END OF GS_DATA,GT_DATA LIKE TABLE OF GS_DATA.*--------------------------------------------------------------------*
* SELECTION-SCREEN
*--------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_IFNUM FOR ZIFT00010-IFNUM,S_IFTYP FOR ZIFT00010-IFTYP NO INTERVALS NO-EXTENSION DEFAULT 'PO',S_IFDIR FOR ZIFT00010-IFDIR , "DEFAULT 'INBOUND',S_IFMODE FOR ZIFT00010-IFMODE,S_STATUS FOR ZIFT00010-STATUS,S_BSTATU FOR ZIFT00010-BSTATUS,S_RDATE  FOR ZSCUD_INFO-CDATE_CRE NO-EXTENSION OBLIGATORY,S_RTIME  FOR ZSCUD_INFO-CTIME_CRE NO-EXTENSION OBLIGATORY.PARAMETERS: P_XVALUE TYPE TEXT256.
SELECTION-SCREEN END OF BLOCK BLK1.*--------------------------------------------------------------------*
* INITIALIZATION
*--------------------------------------------------------------------*
INITIALIZATION.REFRESH S_RDATE.S_RDATE = 'IBT'.S_RDATE-LOW = SY-DATUM.S_RDATE-HIGH = SY-DATUM.APPEND S_RDATE.REFRESH S_RTIME.S_RTIME = 'IBT'.S_RTIME-LOW = '000000'.S_RTIME-HIGH = '235959'.APPEND S_RTIME.*--------------------------------------------------------------------*
* AT SELECTION-SCREEN
*--------------------------------------------------------------------*
*& 选择屏幕控制
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_IFNUM-LOW.PERFORM FRM_ZIFNUM_F4.AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_IFNUM-HIGH.PERFORM FRM_ZIFNUM_F4.AT SELECTION-SCREEN.IF P_XVALUE IS NOT INITIAL AND S_IFNUM IS INITIAL .MESSAGE E000(ZIF01) WITH TEXT-010.ENDIF.*--------------------------------------------------------------------*
* START-OF-SELECTION
*--------------------------------------------------------------------*
START-OF-SELECTION."GET DATAPERFORM FRM_GET_DATA."ALVPERFORM FRM_SHOW_ALV.*&---------------------------------------------------------------------*
*&      Form  FRM_GET_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_GET_DATA .DATA: LT_DATA LIKE TABLE OF GS_DATA.DATA: L_ZGYLJK TYPE	ZTR_GYLJKBM.RANGES: LR_TIME FOR ZIFT00010-RECVTIME.LR_TIME = 'IBT'.LR_TIME-LOW = S_RDATE-LOW && S_RTIME-LOW.LR_TIME-HIGH = S_RDATE-HIGH && S_RTIME-HIGH.APPEND LR_TIME.SELECT *INTO TABLE @DATA(LT_ZTRGYLT2001)FROM ZTRGYLT2001."get dataSELECT * FROM ZTRT00010INTO CORRESPONDING FIELDS OF TABLE GT_DATAWHERE IFNUM IN S_IFNUMAND IFTYP IN S_IFTYPAND IFDIR IN S_IFDIRAND IFMODE IN S_IFMODEAND STATUS IN S_STATUSAND BSTATUS IN S_BSTATUAND RECVTIME IN LR_TIME."如果要根据业务数据对消息进行过滤IF P_XVALUE IS NOT INITIAL.DATA: LS_VERS TYPE SXMSPVERS,LT_VERS LIKE TABLE OF LS_VERS.DATA(LO_PERSIST) = NEW CL_XMS_PERSIST( ).LOOP AT GT_DATA INTO GS_DATA.IF GS_DATA-IS_ENCRY = ''."报文不加密.CLEAR: LT_VERS."get all versionSELECT MSGGUID PID VERSFROM SXMSPVERSINTO CORRESPONDING FIELDS OF TABLE LT_VERSWHERE MSGGUID = GS_DATA-POMSGID.IF SY-SUBRC = 0.LOOP AT LT_VERS INTO LS_VERS."read messageLO_PERSIST->READ_MSG_ALL(EXPORTINGIM_MSGGUID = LS_VERS-MSGGUIDIM_PID     = LS_VERS-PIDIM_VERSION = LS_VERS-VERSIMPORTINGEX_MESSAGE = DATA(LO_XMS_MSG) ).LO_XMS_MSG->DELETEHEADERBYNAME(NSURI  = IF_XMS_RUN_TIME_ENV=>CO_NSURILCNAME = IF_XMS_RUN_TIME_ENV=>CO_LCNAME )."get payloadDATA(LT_PAYLOAD) = CAST CL_XMS_MESSAGE_XMB( LO_XMS_MSG )->IF_XMS_MESSAGE_XMB~GET_MAIN_PAYLOADS( ).READ TABLE LT_PAYLOAD INTO DATA(LS_PAYLOAD) INDEX 1.IF SY-SUBRC EQ 0.DATA(LV_PAYLOAD) = VALUE STRING( )."decode payloadCL_ABAP_CONV_IN_CE=>CREATE(INPUT = LS_PAYLOAD-MAINPAYLOAD->GETBINARYCONTENT( )IGNORE_CERR = ABAP_TRUEENDIAN = 'B'ENCODING = 'UTF-8' )->READ(IMPORTINGDATA = LV_PAYLOAD )."search data in payloadSEARCH LV_PAYLOAD FOR P_XVALUE.IF SY-SUBRC = 0.APPEND GS_DATA TO LT_DATA.EXIT.ENDIF.ENDIF.ENDLOOP.ENDIF.ELSEIF GS_DATA-IS_ENCRY = 'X'."报文加密.SEARCH GS_DATA-FILE_S FOR P_XVALUE.IF SY-SUBRC = 0.APPEND GS_DATA TO LT_DATA.CONTINUE.ENDIF.SEARCH GS_DATA-FILE_R FOR P_XVALUE.IF SY-SUBRC = 0.APPEND GS_DATA TO LT_DATA.CONTINUE.ENDIF.ENDIF.ENDLOOP.GT_DATA = LT_DATA.ENDIF.IF GT_DATA IS INITIAL.MESSAGE S000(ZIF01) WITH TEXT-011 DISPLAY LIKE 'E'.ENDIF.SORT GT_DATA BY RECVTIME DESCENDING.SORT LT_ZTRGYLT2001 BY ZGYLJK.LOOP AT GT_DATA ASSIGNING FIELD-SYMBOL(<LS_DATA>).IF  <LS_DATA>-STATUS = 'S' AND <LS_DATA>-SENDTIME IS NOT INITIAL AND <LS_DATA>-RECVTIME IS NOT INITIAL.DATA(LV_SDATE) = CONV D( <LS_DATA>-SENDTIME(8) ).DATA(LV_STIME) = CONV T( <LS_DATA>-SENDTIME+8(6) ).DATA(LV_RDATE) = CONV D( <LS_DATA>-RECVTIME(8) ).DATA(LV_RTIME) = CONV T( <LS_DATA>-RECVTIME+8(6) ).IF <LS_DATA>-IFDIR = 'INBOUND'.<LS_DATA>-DURTM = LV_STIME - LV_RTIME.ELSE.<LS_DATA>-DURTM = LV_RTIME - LV_STIME.ENDIF.IF <LS_DATA>-DURTM < 0.<LS_DATA>-DURTM = <LS_DATA>-DURTM + 86400.ENDIF.ENDIF.L_ZGYLJK = <LS_DATA>-IFNUM.READ TABLE LT_ZTRGYLT2001 INTO DATA(LS_ZTRGYLT2001) WITH KEY ZGYLJK = L_ZGYLJK.IF SY-SUBRC = 0.<LS_DATA>-ZGYLJKT = LS_ZTRGYLT2001-ZGYLJKT.ENDIF.ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  FRM_SHOW_ALV
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_SHOW_ALV .DATA: LS_LAYOUT   TYPE SLIS_LAYOUT_ALV,LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,LS_FIELDCAT LIKE LINE OF LT_FIELDCAT.CHECK GT_DATA IS NOT INITIAL.CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'EXPORTINGI_STRUCTURE_NAME       = 'ZTRS00010'CHANGINGCT_FIELDCAT            = LT_FIELDCATEXCEPTIONSINCONSISTENT_INTERFACE = 1PROGRAM_ERROR          = 2OTHERS                 = 3.IF SY-SUBRC <> 0.
* Implement suitable error handling hereENDIF.LOOP AT LT_FIELDCAT INTO LS_FIELDCAT.IF LS_FIELDCAT-FIELDNAME = 'NEWID'.LS_FIELDCAT-DDICTXT = 'New PO MSGID'.LS_FIELDCAT-SELTEXT_L = 'New PO MSGID'.LS_FIELDCAT-SELTEXT_M = 'New PO MSGID'.LS_FIELDCAT-SELTEXT_S = 'New PO MSGID'.ELSEIF LS_FIELDCAT-FIELDNAME = 'ZGYLJKT'.LS_FIELDCAT-COL_POS = 4.ENDIF.MODIFY LT_FIELDCAT FROM LS_FIELDCAT.ENDLOOP.LS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.LS_LAYOUT-BOX_FIELDNAME     = 'BOX'.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'EXPORTINGI_CALLBACK_PROGRAM       = SY-CPROGI_CALLBACK_PF_STATUS_SET = 'FRM_SET_STATUS'I_CALLBACK_USER_COMMAND  = 'FRM_USER_COMMAND'IT_FIELDCAT              = LT_FIELDCATIS_LAYOUT                = LS_LAYOUTI_SAVE                   = 'A'TABLEST_OUTTAB                 = GT_DATAEXCEPTIONSPROGRAM_ERROR            = 1OTHERS                   = 2.IF SY-SUBRC <> 0.MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNOWITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  frm_SET_STATUS
*&---------------------------------------------------------------------*
*       Set pf-status
*----------------------------------------------------------------------*
FORM FRM_SET_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.SET PF-STATUS 'STANDARD'.
ENDFORM.                    "frm_SET_STATUS
*&---------------------------------------------------------------------*
*&      Form  frm_USER_COMMAND
*&---------------------------------------------------------------------*
*       User command
*----------------------------------------------------------------------*
FORM FRM_USER_COMMAND USING R_UCOMM LIKE SY-UCOMMRS_SELFIELD TYPE SLIS_SELFIELD.CASE R_UCOMM.WHEN '&IC1'.  "Double clickREAD TABLE GT_DATA INTO GS_DATA INDEX RS_SELFIELD-TABINDEX.IF SY-SUBRC = 0.IF RS_SELFIELD-FIELDNAME = 'NEWID' AND  GS_DATA-NEWID IS NOT INITIAL.PERFORM FRM_DIS_MSG USING GS_DATA-NEWID  ''.ELSEIF  RS_SELFIELD-FIELDNAME = 'FILE_S' AND  GS_DATA-FILE_S IS NOT INITIAL.PERFORM PF_TEXT_DISPLAY USING GS_DATA-FILE_S.ELSEIF RS_SELFIELD-FIELDNAME = 'FILE_R' AND GS_DATA-FILE_R IS NOT INITIAL.PERFORM PF_TEXT_DISPLAY USING GS_DATA-FILE_R.ELSE."否则显示POMSGIDPERFORM FRM_DIS_MSG USING GS_DATA-POMSGID  ''.ENDIF.ENDIF.WHEN '&DIS_XML'. "显示XML消息"检查选中READ TABLE GT_DATA INTO GS_DATA WITH KEY BOX = 'X'.IF SY-SUBRC <> 0.MESSAGE E002(ZIF01).ENDIF.PERFORM FRM_DISPLAY_MESSAGES.WHEN '&RESEND'.  "重新下发"检查选中READ TABLE GT_DATA INTO GS_DATA WITH KEY BOX = 'X'.IF SY-SUBRC <> 0.MESSAGE E002(ZIF01).ENDIF."只能重发 异步下发的接口LOOP AT GT_DATA INTO GS_DATA WHERE BOX = 'X'.IF NOT ( GS_DATA-IFTYP = 'PO' AND GS_DATA-IFDIR = 'OUTBOUND' AND GS_DATA-IFMODE = 'A' ).MESSAGE E003(ZIF01).ENDIF.ENDLOOP."重发PERFORM FRM_RESEND_MESSAGES.RS_SELFIELD-REFRESH = 'X'.WHEN 'REFRESH'.  "REFRESHRS_SELFIELD-REFRESH = 'X'."Get data from log tablePERFORM FRM_GET_DATA.WHEN OTHERS.ENDCASE.
ENDFORM.                    "frm_USER_COMMAND
*&---------------------------------------------------------------------*
*&      Form  frm_DIS_MSG
*&---------------------------------------------------------------------*
*       DISPLAY MESSAGE
*----------------------------------------------------------------------*
*       -->P_MSG_ID       MSG ID
*       -->P_NEW_SESSION  '':Current session 'X':New session
*----------------------------------------------------------------------*
FORM FRM_DIS_MSG USING PV_MSGIDPV_NEW_SESSION.DATA: LV_MSGID TYPE SXMSMGUID.LV_MSGID = PV_MSGID.IF PV_NEW_SESSION = 'X'."新窗口CALL FUNCTION 'SXMB_DISPLAY_MESSAGE_MONITOR' STARTING NEW TASK 'XI'EXPORTINGIM_MESSAGE_ID     = LV_MSGIDEXCEPTIONSMESSAGE_NOT_FOUND = 1NOT_AUTHORIZED    = 2OTHERS            = 3.ELSE."当前窗口CALL FUNCTION 'SXMB_DISPLAY_MESSAGE_MONITOR'EXPORTINGIM_MESSAGE_ID     = LV_MSGIDEXCEPTIONSMESSAGE_NOT_FOUND = 1NOT_AUTHORIZED    = 2OTHERS            = 3.ENDIF.CASE SY-SUBRC.WHEN 0.WHEN 2.MESSAGE E082(XMS_ADM).WHEN OTHERS.MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNOWITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDCASE.
ENDFORM.                    " frm_DIS_MSG
*&---------------------------------------------------------------------*
*&      Form  frm_DISPLAY_MESSAGES
*&---------------------------------------------------------------------*
*       DISPLAY MESSAGES
*----------------------------------------------------------------------*
FORM FRM_DISPLAY_MESSAGES .LOOP AT GT_DATA INTO GS_DATA WHERE BOX = 'X' AND POMSGID IS NOT INITIAL.PERFORM FRM_DIS_MSG USING GS_DATA-POMSGID  'X'.ENDLOOP.IF SY-SUBRC <> 0.MESSAGE E110(ZIF01).ELSE.MESSAGE S583(SO) WITH TEXT-004.ENDIF.
ENDFORM.                    " frm_DISPLAY_MESSAGES
*&---------------------------------------------------------------------*
*&      Form  FRM_RESEND_MESSAGES
*&---------------------------------------------------------------------*
*       RESEND MESSAGES
*----------------------------------------------------------------------*
FORM FRM_RESEND_MESSAGES.DATA LV_NEWGUID TYPE SXMSGUID.DATA: LS_DATA      TYPE ZTRT00010,LT_DATA      TYPE TABLE OF ZTRT00010,L_TABIX      TYPE SY-TABIX,L_COUNT_SUCC TYPE I,L_COUNT_ERR  TYPE I,L_COUNT_ALL  TYPE I,L_ANSWER.CALL FUNCTION 'POPUP_TO_CONFIRM'EXPORTINGTITLEBAR              = TEXT-008TEXT_QUESTION         = TEXT-005TEXT_BUTTON_1         = TEXT-006ICON_BUTTON_1         = 'ICON_CHECKED'TEXT_BUTTON_2         = TEXT-007ICON_BUTTON_2         = 'ICON_INCOMPLETE'DEFAULT_BUTTON        = '2'DISPLAY_CANCEL_BUTTON = SPACEPOPUP_TYPE            = 'ICON_MESSAGE_WARNING'IMPORTINGANSWER                = L_ANSWEREXCEPTIONSTEXT_NOT_FOUND        = 1OTHERS                = 2.IF SY-SUBRC <> 0.MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNOWITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.IF L_ANSWER = '2'.MESSAGE S063(/SAPBOQ/SRVPACK).EXIT.ENDIF.LOOP AT GT_DATA INTO GS_DATA WHERE BOX = 'X'.L_TABIX = SY-TABIX.CLEAR: GS_DATA-MESSAGE.IF GS_DATA-POMSGID IS INITIAL.GS_DATA-MESSAGE = TEXT-009.L_COUNT_ERR = L_COUNT_ERR + 1.ELSE.GS_DATA-MESSAGE = TEXT-003.CLEAR: LV_NEWGUID.FREE MEMORY ID 'ZIFR00010'.SUBMIT ZRSXMB_SUPPORT_RESTART WITH PGUID = GS_DATA-POMSGID AND RETURN.IMPORT GUID = LV_NEWGUID FROM MEMORY ID 'ZIFR00010'.IF LV_NEWGUID IS NOT INITIAL.GS_DATA-NEWID = LV_NEWGUID.ENDIF.L_COUNT_SUCC = L_COUNT_SUCC + 1.ENDIF.MODIFY GT_DATA FROM GS_DATA INDEX L_TABIX.MOVE-CORRESPONDING GS_DATA TO LS_DATA.APPEND LS_DATA TO LT_DATA.ENDLOOP.IF LT_DATA IS NOT INITIAL.MODIFY ZTRT00010 FROM TABLE LT_DATA.COMMIT WORK.ENDIF.L_COUNT_ALL = L_COUNT_ERR + L_COUNT_SUCC.MESSAGE S043(ZIF01) WITH L_COUNT_ALL L_COUNT_SUCC L_COUNT_ERR.
ENDFORM.                    " frm_RESEND_MESSAGES
*&---------------------------------------------------------------------*
*&      Form  FRM_ZIFNUM_F4
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_ZIFNUM_F4 .DATA: BEGIN OF HELPROW,IFNUM TYPE ZTRT00010-IFNUM,ZGYLJKT TYPE ZTR_GYLJKBMT,END OF HELPROW.DATA FIELD_TAB LIKE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.DATA HELP_TAB LIKE STANDARD TABLE OF HELPROW WITH HEADER LINE.*  SELECT DISTINCT IFNUM
*    INTO CORRESPONDING FIELDS OF TABLE HELP_TAB
*    FROM ZTRT00010.SELECT ZGYLJK ZGYLJKTINTO TABLE HELP_TABFROM ZTRGYLT2001.SORT HELP_TAB BY IFNUM.CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'EXPORTING
*     DDIC_STRUCTURE  = ' 'RETFIELD        = 'IFNUM'
*     PVALKEY         = ' 'DYNPPROG        = SY-REPIDDYNPNR          = SY-DYNNRDYNPROFIELD     = 'S_IFNUM'VALUE_ORG       = 'S'TABLESVALUE_TAB       = HELP_TABEXCEPTIONSPARAMETER_ERROR = 1NO_VALUES_FOUND = 2OTHERS          = 3.IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ENDIF.
ENDFORM.*----------------------------------------------------------------------*
FORM XML_DISPLAY  USING    P_XML_STR.DATA: L_XML TYPE REF TO CL_XML_DOCUMENT .CREATE OBJECT L_XML.CALL METHOD L_XML->PARSE_STRINGEXPORTINGSTREAM = P_XML_STR. "xml_out is the variable which is holding the xml stringCALL METHOD L_XML->DISPLAY.
ENDFORM.FORM PF_TEXT_DISPLAY  USING    P_CFILE .DATA: RESULT_TAB TYPE MATCH_RESULT_TAB WITH HEADER LINE.DATA: L_CFILE TYPE STRING .L_CFILE = P_CFILE.."当包含%+字母(数字)时,认为是进行了URL编码。FIND ALL OCCURRENCES OF REGEX  '(%\w)' IN L_CFILE RESULTS RESULT_TAB[].IF SY-SUBRC  =  0 .
*URL解码。L_CFILE = CL_HTTP_UTILITY=>UNESCAPE_URL( L_CFILE ).ENDIF.CALL METHOD CL_DEMO_OUTPUT=>DISPLAY_TEXTEXPORTINGTEXT = L_CFILE.ENDFORM.

程序GUI 状态:STANDARD

  • &DIS_XML 显示XML消息
  • &RESEND 重新下发
  • REFRESH 刷新

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/392718.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

使用 MinIO、Langchain 和 Ray Data 构建分布式嵌入式子系统

嵌入子系统是实现检索增强生成所需的四个子系统之一。它将您的自定义语料库转换为可以搜索语义含义的向量数据库。其他子系统是用于创建自定义语料库的数据管道&#xff0c;用于查询向量数据库以向用户查询添加更多上下文的检索器&#xff0c;最后是托管大型语言模型 &#xff…

ES6中的Promise、async、await,超详细讲解!

Promise是es6引入的异步编程新解决方案&#xff0c;Promise实例和原型上有reject、resolve、all、then、catch、finally等多个方法&#xff0c;语法上promise就是一个构造函数&#xff0c;用来封装异步操作并可以获取其成功或失败的结果&#xff0c;本篇文章主要介绍了ES6中的P…

(免费领源码)java#SSM#MYSQL私家车位共享APP 51842-计算机毕业设计项目选题推荐

目 录 摘要 1 绪论 1.1 课题的研究背景 1.2研究内容与研究目标 1.3ssm框架 1.4论文结构与章节安排 2 2 私家车位共享APP系统分析 2.1 可行性分析 2.2 系统流程分析 2.2.1 数据增加流程 2.2.2 数据修改流程 2.2.3数据删除流程 2.3 系统功能分析 2.3.1功能性分析 2…

原型图绘制技巧

针对于 Axure RP绘图软件。 1、拉辅助线 目的&#xff0c;确定画布大小尺寸从上面和左面的刻度尺上&#xff0c;点击鼠标&#xff0c;拖动&#xff0c;就可以拉出一条线。 2、画布底模设为组件 右键转换为母版&#xff0c;方便后续其他页面使用 3、按钮 按钮字体不要太大&am…

【嵌入式】STM3212864点阵屏使用SimpleGUI单色屏接口库——(2)精简字库

一 开源库简介与移植 最近一个项目需要用12864屏幕呈现一组较为复杂的菜单界面&#xff0c;本着不重复造轮子的原则找到了SimpleGUI开源库。 开源地址&#xff1a;SimpleGUI: 一个面向单色显示屏的开源GUI接口库。 SimpleGUI是一款针对单色显示屏设计的接口库。相比于传统的GUI…

SpringBoot集成阿里百炼大模型(初始demo) 原子的学习日记Day01

文章目录 概要下一章SpringBoot集成阿里百炼大模型&#xff08;多轮对话&#xff09; 原子的学习日记Day02 整体架构流程技术名词解释集成步骤1&#xff0c;选择大模型以及获取自己的api-key&#xff08;前面还有一步开通服务就没有展示啦&#xff01;&#xff09;2&#xff0c…

CSS学习 02 利用鼠标悬停制造按钮边框的渐变方向变化

效果 页面背景为深灰色&#xff0c;使用Karla字体。容器内的按钮居中显示&#xff0c;按钮有一个彩色渐变的边框。按钮的背景为黑色&#xff0c;文字为浅灰色。当鼠标悬停在按钮边框上时&#xff0c;边框的渐变方向变化&#xff0c;按钮文字变为白色&#xff0c;并且按钮内边距…

简单猜谜小程序开发

了解小程序的结构 项目根目录 包含小程序的配置文件和其他资源。 页面目录 每个页面都有独立的目录&#xff0c;通常包含 .json、.wxml、.wxss、.js 文件&#xff1a; .json&#xff1a;页面配置文件&#xff0c;用于配置页面的窗口表现等。 .wxml&#xff1a;页面的布局文件…

JS等待所有方法执行完成在执行下一个方法,promise All

在工作中会遇到这样一个场景&#xff0c;前端需要拿到不同接口返回的结果在执行某个逻辑&#xff0c;当使用链式那样的方式去请求&#xff0c;等一个接口响应完在请求下一个接口&#xff0c;这种方法就会导致请求时间特别长。这个时候就可以使用promise all&#xff0c;同时请求…

Python酷库之旅-第三方库Pandas(067)

目录 一、用法精讲 266、pandas.Series.dt.second属性 266-1、语法 266-2、参数 266-3、功能 266-4、返回值 266-5、说明 266-6、用法 266-6-1、数据准备 266-6-2、代码示例 266-6-3、结果输出 267、pandas.Series.dt.microsecond属性 267-1、语法 267-2、参数 …

IDEA如何去掉编辑框右侧的竖线

打开 IntelliJ Idea 软件 依次找到 File—>Settings—>Editor—>General—>Appearance 去掉勾选 Show hard wrap and visual guides (configured in Code Style options)

PHP海报在线制作系统小程序源码

创意无限&#xff0c;设计零门槛&#xff01; &#x1f3a8; 一键解锁设计大师潜能 你还在为找不到合适的设计师制作海报而烦恼吗&#xff1f;告别繁琐沟通&#xff0c;拥抱“海报在线制作系统”&#xff01;这个神奇的平台&#xff0c;让你无需任何设计基础&#xff0c;也能…

后台弱口令部署war包 漏洞复现

1.搭建好环境打开页面---点击右方的manager app 默认账号密码为tomcat 2.登录完成后滑到下面点击浏览 3.将你生成的jsp木马压缩为zip格式并将后缀名改为war 4.提交此war压缩包然后在目录中点击 5.点击完后在后面加lkj.jsp&#xff0c;访问成功证明注入成功 5.打开哥斯拉连接…

js获取近30天近60天时间区间

1.从今天往前推30天 handleSetTime(value) {//value传入自定义时间 30/60/90//因为这里要加上今天时间,所以开始时间-1const value1 value - 1const date new Date()const startTimestamp date.getTime() - value1 * (24 * 60 * 60 * 1000 * 1)const sDate new Date(startTi…

Unity实现屏幕黑边--游戏画面和UI异形屏处理(安全区渲染)

在手机上&#xff0c;如果想以黑边形式显示游戏画面&#xff0c;比如显示区域避开异形屏、水滴屏那一行。有很多种思路&#xff0c;最后觉得下面这种方法比较简单合适&#xff0c;下面分享一下。 方法&#xff1a;需要分别处理&#xff0c;游戏画面黑边、UI黑边&#xff1a; …

帮助网站提升用户参与度的5个WordPress插件

仅靠编写精彩的内容、设计精美的图像和创建简化的客户旅程不足以提高网站参与度。您需要让用户在首次访问后继续与您的网站互动并成为回访者&#xff0c;才能真正吸引您所追求的兴趣。 幸运的是&#xff0c;对于 WordPress 用户来说&#xff0c;有数百种工具可用于提高用户参与…

html实现好看的塔罗牌、十二星座运势网站源码

文章目录 1.设计来源1.1 十二星座1.2 所有界面效果图 2.效果和源码2.1 动态效果2.2 源代码 源码下载万套模板&#xff0c;程序开发&#xff0c;在线开发&#xff0c;在线沟通 作者&#xff1a;xcLeigh 文章地址&#xff1a;https://blog.csdn.net/weixin_43151418/article/deta…

java网络爬虫

前言 单一个项目的功能需要测试的时候&#xff0c;就需要使用大量的假数据做测试&#xff0c;但是这些数据又不能太假&#xff0c;必须合乎常理。于是我们需要爬虫爬取一些网站的一些允许爬取的数据&#xff0c;来做项目功能测试。 一.确认爬取目标 现在爬取下面三个网站的数据…

常用的GPIO的配置(基于STM32F103C8xx)

绿色&#xff1a;注释 紫色&#xff1a;实际使用代码 //开启GPIOB的时钟 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); ①可选输入值&#xff1a;RCC_APB2Periph_GPIOA 或者 RCC_APB2Periph_GPIOB 或者 RCC_APB2Periph_ALL ②可选输入值&a…

【云原生】恰当运用kubernetes中三种探针,确保应用程序在Kubernetes集群中保持健康、可用和可靠

✨✨ 欢迎大家来到景天科技苑✨✨ &#x1f388;&#x1f388; 养成好习惯&#xff0c;先赞后看哦~&#x1f388;&#x1f388; &#x1f3c6; 作者简介&#xff1a;景天科技苑 &#x1f3c6;《头衔》&#xff1a;大厂架构师&#xff0c;华为云开发者社区专家博主&#xff0c;…