SD--关于SD业务几个TCODE操作的SAP表跟踪

本文介绍了四个SAP事务代码的应用场景及对应的SAP表和程序实现:VL01A用于处理销售订单到期,VL06G用于发货的外向交货清单,VF04用于维护发票到期清单,VFX3用于列出冻结的出具发票凭证清单。
摘要由CSDN通过智能技术生成

1、VL01A(交货的销售订单到期)

该TCODE对应的读取数据程序:/1SAP1/%LE_SHP%_VEPVG99A004

 

操作的SAP表:vepvg

对应代码程序:

SELECT * INTO  TABLE cx_sd_order-vepvg
         FROM  vepvg
         WHERE
*        VEPVG-Selektionskriterien
    vstel in ix_select_options-vstel
AND auart in ix_select_options-auart
AND autlf in ix_select_options-autlf
AND kunnr in ix_select_options-kunnr
AND kunwe in ix_select_options-kunwe
AND ledat in ix_select_options-ledat
AND lifsp in ix_select_options-lifsp
AND lprio in ix_select_options-lprio
AND route in ix_select_options-route
AND spart in ix_select_options-spart
AND spdnr in ix_select_options-spdnr
AND vbeln in ix_select_options-vbeln
AND vkbur in ix_select_options-vkbur
AND vkgrp in ix_select_options-vkgrp
AND vkorg in ix_select_options-vkorg
AND vtweg in ix_select_options-vtweg
AND wadat in ix_select_options-wadat
           .

2、VL06G(发货的外向交货清单)

该TCODE对应的读取数据程序为函数:WS_LM_DATA_SELECTION_DUE

 

操作的SAP表:shp_idx_gdsi

对应代码程序:

         select vbeln from shp_idx_gdsi                      "470
               appending corresponding fields of table et_postab
                     where vstel in lt_vstel
                     and   wadat in lt_wadat
                     and   route in lt_route
                     and   lstel in lt_lstel
                     and   lddat in lt_lddat
                     and   tddat in lt_tddat
                     and   lfdat in lt_lfdat
                     and   kodat in lt_kodat
                     and   kostk in lt_kostk
                     and   lvstk in lt_lvstk
                     and   kunnr in lt_kunwe
                     and   vbeln in lt_vbeln.

 

3、VF04(维护发票到期清单)

该TCODE操作对应的程序为:SDBLBDDL;

操作的SAP表:VKDFS

对应代码程序:LV05HFDL

FORM READ_VKDFS_VKDFI_VF_01.
  RCODE = 4.
  REFRESH LVKDFI .
  CLEAR LVKDFI .
  SELECT *
    INTO TABLE XVKDFS
    FROM VKDFS
    WHERE ( FKTYP IN (VBCO7-ALLEF,VBCO7-ALLEL,VBCO7-ALLEA,
                      VBCO7-ALLEI,VBCO7-ALLEB) )
    AND   VKORG IN R_VKORG
    AND   FKDAT IN R_FKDAT
    AND   KUNNR IN S_KUNNR
    AND   FKART IN S_FKART
    AND   LLAND IN S_LLAND
    AND   VBELN IN S_VBELN
    AND   VBTYP IN R_VBTYP
    AND   SORTKRI IN S_SORTKRI
    AND   VTWEG   IN S_VTWEG
    AND   SPART   IN S_SPART
    AND   VSTEL   IN S_VSTEL
    ORDER BY PRIMARY KEY.
    IF NOT NO_BILLING_BLOCK IS INITIAL.
       PERFORM AUSDUENNEN_XVKDFS.
    ENDIF.
  IF NOT VBCO7-PDSTK IS INITIAL.
    LOOP AT XVKDFS WHERE PDSTK CA 'AB'.
      DELETE XVKDFS.
    ENDLOOP.
  ENDIF.
   LOOP AT XVKDFS.
     MOVE: XVKDFS TO VKDFS.
     PERFORM MOVE_VKDFS_TO_LVKDFI.
     APPEND LVKDFI.
   ENDLOOP.

ENDFORM.

 

4、VFX3(列出冻结的出具发票凭证清单)

该TCODE操作对应的程序为:SDBLBDDL;

操作的SAP表:VBRK

对应代码程序

FORM TAB_FUELLEN.

  DATA : BEGIN OF XM_VMCRA OCCURS 50.
           INCLUDE STRUCTURE M_VMCRA.
  DATA : END OF XM_VMCRA.

  SELECT * FROM M_VMCFA INTO TABLE GT_VMCFA
    WHERE VKORG = VKORG
    AND   KUNRG IN KUNNR
    AND   ERNAM IN ERNAM
    AND   ERDAT IN ERDAT
    AND   VBELN IN VBELN
    AND   FKTYP IN FKTYP
    AND   FKART IN FKART
    AND   ( RFBSK IN (ALLES,ALLEA,ALLEB,ALLEF,ALLEG,ALLEK,ALLEN) ).
  SELECT * FROM M_VMCRA INTO TABLE XM_VMCRA
    WHERE VKORG = VKORG
    AND   KUNRG IN KUNNR
    AND   ERNAM IN ERNAM
    AND   ERDAT IN ERDAT
    AND   VBELN IN VBELN
    AND   FKART_RL IN FKART.
  CLEAR GT_VMCFA.
  LOOP AT XM_VMCRA.
    MOVE-CORRESPONDING XM_VMCRA TO GT_VMCFA.
    MOVE XM_VMCRA-FKDAT_RL TO GT_VMCFA-FKDAT.
    MOVE XM_VMCRA-FKART_RL TO GT_VMCFA-FKART.
    MOVE 'R' TO GT_VMCFA-FKTYP.
    APPEND GT_VMCFA.
  ENDLOOP.
  CLEAR GT_VMCFA.
  LOOP AT GT_VMCFA.
    PERFORM FAKTURATYP_ERMITTELN.
    PERFORM FAKTURAART_ERMITTELN.
    PERFORM NAME_ERMITTELN USING GT_VMCFA-KUNRG GT_VMCFA-NAME1.
    PERFORM NAME_ERMITTELN USING GT_VMCFA-KUNAG GT_VMCFA-NAME2.
    MODIFY GT_VMCFA.
  ENDLOOP.
  SORT GT_VMCFA BY ERDAT VBELN.
  loop at gt_vmcfa.
    case gt_vmcfa-rfbsk.
      when ' '.
        gt_vmcfa-vfuvgr = text-ug0. "FI/CO 接口冻结
      when 'A'.
        gt_vmcfa-vfuvgr = text-uga. ”会计冻结
      when 'B'.
        gt_vmcfa-vfuvgr = text-ugb.”科目确定错误
      when 'F'.
        gt_vmcfa-vfuvgr = text-ugf.”定价错误
      when 'G'.
        gt_vmcfa-vfuvgr = text-ugg.”外贸数据
      when 'K'.
        gt_vmcfa-vfuvgr = text-ugk.”授权时出错
      when 'N'.
        gt_vmcfa-vfuvgr = text-ug0.
    endcase.
    modify gt_vmcfa.
  endloop.
ENDFORM.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15232446/viewspace-557657/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15232446/viewspace-557657/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值