欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

CN25网络中的完成确认(BDC实现)

程序员文章站 2024-02-24 10:28:46
...

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.

 

 

 

 

 

 

相关标签: PS CN25