码迷,mamicode.com
首页 > 其他好文 > 详细

会计凭证修改函数的使用

时间:2018-01-18 14:13:02      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:ons   div   from   init   like   append   tpi   col   change   

 

修改会计凭证的参考代码2的值。

-------------------------------------------------------------------*
TYPE-POOLS tpit.
DATA: ls_bseg TYPE bseg,
      lt_bseg TYPE TABLE OF bseg,
      lt_buztab TYPE tpit_t_buztab,
      ls_buztab LIKE LINE OF lt_buztab,
      lt_fldtab TYPE tpit_t_fname,
      ls_fldtab LIKE LINE OF lt_fldtab.

SELECT * INTO TABLE lt_bseg FROM bseg
  WHERE bukrs = lv_bukrs
  AND   belnr = lv_belnr
  AND   gjahr = lv_gjahrs.


*READ TABLE lt_bseg INTO ls_bseg WITH KEY  buzid = ‘W‘.
  CHECK sy-subrc = 0.
LOOP AT lt_bseg INTO lS_bseg WHERE  buzid = M.

SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE lt_buztab
 WHERE bukrs EQ ls_bseg-bukrs
   AND gjahr EQ ls_bseg-gjahr
   AND belnr EQ ls_bseg-belnr
   AND buzei EQ ls_bseg-buzei.

IF lt_buztab[] IS INITIAL.
  SELECT * FROM bsas INTO CORRESPONDING FIELDS OF TABLE lt_buztab
   WHERE bukrs EQ ls_bseg-bukrs
    AND gjahr EQ ls_bseg-gjahr
    AND belnr EQ ls_bseg-belnr
    AND buzei EQ ls_bseg-buzei.
ENDIF.


CLEAR ls_bseg.


ls_bseg-xref2 = YSTEST.
ls_fldtab-fname = XREF2.
ls_fldtab-aenkz = X.
APPEND ls_fldtab TO lt_fldtab.

CALL FUNCTION FI_ITEMS_MASS_CHANGE
  EXPORTING
    s_bseg           = ls_bseg
* IMPORTING
*   ERRTAB           =
  TABLES
    it_buztab        = lt_buztab
    it_fldtab        = lt_fldtab
* EXCEPTIONS
*   BDC_ERRORS       = 1
*   OTHERS           = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDLOOP.

 

会计凭证修改函数的使用

标签:ons   div   from   init   like   append   tpi   col   change   

原文地址:https://www.cnblogs.com/caizjian/p/8309780.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!