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.
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/20042.html