關於SD業務幾個TCODE操作的SAP表跟蹤

harson發表於2009-07-08
[@more@]

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/195776/viewspace-1023901/,如需轉載,請註明出處,否則將追究法律責任。

相關文章