ABAP清账例子2

  • 2
  • 548 views
  • A+
所属分类:Notes

 

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:2   其中:访客  2   博主  0

    • ag

      *宏.
      DEFINE populate_ftclear.
      it_ftclear-agkoa = ‘D’. “科目类型,D为客户.
      it_ftclear-agbuk = lv_ftclear_agbuk. “公司代码.
      it_ftclear-selfd = ‘BELNR’. “凭证索引中的字段名.
      it_ftclear-xnops = ‘X’. “只选择不是特定总帐的未清项目.
      it_ftclear-selvon = &1. “会计凭证抬头参考号(BKPF-AWKEY).
      append it_ftclear.
      END-OF-DEFINITION.

      DEFINE populate_ftpost.
      it_ftpost-stype = &1. “K为header,P为item.
      it_ftpost-count = &2. “凭证抬头或行项目的计数器(记帐界面).
      it_ftpost-fnam = &3. “BDC 字段名.
      it_ftpost-fval = &4. “BDC 字段值.
      append it_ftpost.
      END-OF-DEFINITION.

        • ag

          @ag CALL FUNCTION ‘POSTING_INTERFACE_START’
          EXPORTING
          i_function = ‘C’ “B= BDC, C= Call Trans.
          i_mode = ‘N’ “N表示BDC执行于后台.
          i_update = ‘S’ “S: 数据更新完成后执行下一个操作
          i_keep = ‘X’ “用于已处理会话的队列删除标志.
          EXCEPTIONS
          client_incorrect = 1
          function_invalid = 2
          group_name_missing = 3
          mode_invalid = 4
          update_invalid = 5
          OTHERS = 6.
          IF sy-subrc 0.
          * Implement suitable error handling here
          ENDIF.