CONVERT_BDCMSGCOLL_TO_BAPIRET2 - BDC消息转BAPIRET2消息

FORM bdc_transaction USING tcode ctumode.
  DATA: _ret TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.

  REFRESH messtab.
  CALL TRANSACTION tcode USING bdcdata
        MODE   ctumode"A:调试 N:不显示 E:错误时调试
        UPDATE 'A'"A:异步 B:同步 L:本地更新
        MESSAGES INTO messtab.

  LOOP AT messtab.
    IF messtab-msgtyp = 'S' AND ( messtab-msgv1 = '内向交货'
                                OR messtab-msgv1 = '已保存'  ).
      gs_do_header-vbeln = messtab-msgv2.
      EXIT.
    ENDIF.
  ENDLOOP.

  CALL FUNCTION 'CONVERT_BDCMSGCOLL_TO_BAPIRET2'
    TABLES
      imt_bdcmsgcoll = messtab
      ext_return     = _ret.

* PERFORM deal_bapi_ret TABLES _ret USING 1 CHANGING g_err_flag.

  REFRESH bdcdata.

ENDFORM.

上一篇:ABAP-自定义表配置体系


下一篇:学习技能第五弹---SAP各种冲销