CN25网络中的完成确认(BDC实现)详解编程语言

CN25 网络完成确认操作路径如下:

CN25网络中的完成确认(BDC实现)详解编程语言

CN25网络中的完成确认(BDC实现)详解编程语言

    DATA: 
      "bdc 执行内表 
      lt_bdcdata TYPE TABLE OF bdcdata, 
      "bdc 返回信息表 
      lt_msgtab  TYPE TABLE OF bdcmsgcoll, 
      lv_str     TYPE string, 
      lv_message TYPE string. 
 
      lt_bdcdata = VALUE #( ( program = 'SAPLCORU' dynpro  = '2000' dynbegin = 'X' ) 
                            (  fnam = 'BDC_CURSOR' fval = 'CORUF-VORNR' ) 
                            (  fnam = 'BDC_OKCODE' fval = '=ENTR' ) 
                            (  fnam = 'CORUF-AUFNR' fval = ls_act-network ) 
                            (  fnam = 'CORUF-VORNR' fval = ls_act-activity ) 
 
                            ( program = 'SAPLCORU' dynpro  = '2200' dynbegin = 'X' ) 
                            (  fnam = 'BDC_CURSOR' fval = 'AFRUD-IEDD' ) 
                            (  fnam = 'BDC_OKCODE' fval = '=BU' ) 
                            (  fnam = 'AFRUD-ISDD' fval = iv_isdd ) 
                            (  fnam = 'AFRUD-IEDD' fval = iv_iedd ) ). 
 
      CALL TRANSACTION 'CN25' USING lt_bdcdata 
                              MODE gv_mode 
                              MESSAGES INTO lt_msgtab 
                              UPDATE 'S'. 
 
      CLEAR: lv_str,lv_message. 
      LOOP AT lt_msgtab INTO DATA(ls_msgtab) WHERE msgtyp CA 'AEX'. 
        CALL FUNCTION 'MESSAGE_TEXT_BUILD' 
          EXPORTING 
            msgid               = ls_msgtab-msgid 
            msgnr               = ls_msgtab-msgnr 
            msgv1               = ls_msgtab-msgv1 
            msgv2               = ls_msgtab-msgv2 
            msgv3               = ls_msgtab-msgv3 
            msgv4               = ls_msgtab-msgv4 
          IMPORTING 
            message_text_output = lv_str. 
        IF lv_message IS INITIAL. 
          lv_message = lv_str. 
        ELSE. 
          lv_message = |{ lv_message }/{ lv_str }|. 
        ENDIF. 
      ENDLOOP. 
 
      IF lv_message IS NOT INITIAL. 
        "失败 
      ELSE. 
        "成功 
      ENDIF.

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/17902.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论