Chinaunix首页 | 论坛 | 博客
  • 博客访问: 392548
  • 博文数量: 66
  • 博客积分: 1235
  • 博客等级: 少尉
  • 技术积分: 694
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-05 12:24
文章分类

全部博文(66)

文章存档

2010年(66)

分类:

2010-08-13 10:31:08

FUNCTION ZFUN_UDP_AC_DOC_ZUONR.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(BUKRS) TYPE  BUKRS OPTIONAL
*"     VALUE(GJAHR) TYPE  GJAHR OPTIONAL
*"     VALUE(BELNR) TYPE  BELNR_D OPTIONAL
*"     VALUE(XREF1_HD) TYPE  XREF1_HD OPTIONAL
*"----------------------------------------------------------------------
*       Global data declarations
SELECT SINGLE * FROM BSEG WHERE BUKRS = BUKRS
                           AND  GJAHR = GJAHR
                           AND  BELNR = BELNR.
IF SY-SUBRC = 0 .
  SELECT *
     FROM BKPF
     INTO CORRESPONDING FIELDS OF TABLE T_BKPF
    WHERE BUKRS = BUKRS
      AND GJAHR = GJAHR
      AND BELNR = BELNR.
  IF SY-SUBRC NE 0 .
    EXIT.
  ENDIF.
  SELECT *
    FROM BSEG
    INTO CORRESPONDING FIELDS OF TABLE T_BSEG
     FOR ALL ENTRIES IN T_BKPF
   WHERE BELNR = T_BKPF-BELNR
     AND BUKRS = T_BKPF-BUKRS
     AND GJAHR = T_BKPF-GJAHR.
  LOOP AT T_BKPF.
    T_BKPF-XREF1_HD = XREF1_HD.
    MODIFY T_BKPF TRANSPORTING XREF1_HD .
  ENDLOOP.

  CALL FUNCTION 'CHANGE_DOCUMENT'
    TABLES
      T_BKDF = T_BKDF
      T_BKPF = T_BKPF
      T_BSEC = T_BSEC
      T_BSED = T_BSED
      T_BSEG = T_BSEG
      T_BSET = T_BSET.
ENDIF.
ENDFUNCTION.
阅读(1178) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~