RFC的远程调用-异步

RFC的远程调用-异步
强烈推介IDEA2021.1.3破解激活,IntelliJ IDEA 注册码,2021.1.3IDEA 激活码  

大家好,我是架构君,一个会写代码吟诗的架构师。今天说一说RFC的远程调用-异步,希望能够帮助大家进步!!!

接上篇RFC的远程调用-同步(https://www.cnblogs.com/BruceKing/p/11169930.html)。

TABLES:USR21.
DATA:A  TYPE USR21-PERSNUMBER,
     B  TYPE SY-SYSID,
     C1 LIKE TABLE OF USR21 WITH HEADER LINE.
DATA:MSG_TEXT(100) TYPE C.
CALL FUNCTION 'ZTESTRFCKING001' DESTINATION 'QAS600'
STARTING NEW TASK 'B1' "使用call function starting new task destination&&单独调试这一步时会进入目标系统的函数调式界面
  PERFORMING RETURN_USER ON END OF TASK"当目标系统调试完后会进入此子例程,子例程里不能有subimt,commit work等
  EXPORTING
    ZBNAME                = '0201010001'
  EXCEPTIONS
    COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
    SYSTEM_FAILURE        = 2 MESSAGE MSG_TEXT.
IF SY-SUBRC = 0.
  WRITE:'wait'.
ELSE.
  WRITE MSG_TEXT.
ENDIF.
IF C1 IS INITIAL.
  WRITE:'请等待'.
ELSE.
  WRITE:'CONNECTION IS READY'.
ENDIF.

AT USER-COMMAND."由于回调子程序不会自动运行,设置对话步骤让其进入
  IF SY-UCOMM = 'OKCD'.
    IF MSG_TEXT IS INITIAL.
      WRITE:A, B.
      LOOP AT C1.
        WRITE:C1-PERSNUMBER.
      ENDLOOP.
    ELSE.
      WRITE:MSG_TEXT.
    ENDIF.
  ENDIF.
FORM RETURN_USER USING TASKNAME.
  RECEIVE RESULTS FROM FUNCTION ' ZTESTRFCKING001'
  IMPORTING
   ZPERSON_NUMBER        = A
   SYSTEMID              = B
    TABLES
      OUTPUT                = C1
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
    SYSTEM_FAILURE        = 2 MESSAGE MSG_TEXT.
  SET USER-COMMAND 'OKCD'.
ENDFORM.     "返还消息

RFC的远程调用-异步

点击后退显示主程序的

RFC的远程调用-异步

 

转载于:https://www.cnblogs.com/BruceKing/p/11170773.html

本文来源weixin_30595035,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/29678

发表评论