SD提取订单的定价过程的各类折扣的报表样例.docx
- 文档编号:6459069
- 上传时间:2023-01-06
- 格式:DOCX
- 页数:15
- 大小:18.45KB
SD提取订单的定价过程的各类折扣的报表样例.docx
《SD提取订单的定价过程的各类折扣的报表样例.docx》由会员分享,可在线阅读,更多相关《SD提取订单的定价过程的各类折扣的报表样例.docx(15页珍藏版)》请在冰豆网上搜索。
SD提取订单的定价过程的各类折扣的报表样例
SD--提取订单的定价过程的各类折扣的报表样例
REPORTz_sales_discount.
TYPES:
BEGINOFs_all,
vkorgTYPEvkorg, "salesorganization
fkartTYPEfkart, "billingtype
fkdatTYPEfkdat, "billingdate
b_vbelnTYPEvbeln_vf, "billingdocument
kunagTYPEkunag, "sold-toparty
spartTYPEspart, "division
gsberTYPEgsber, "businessarea
bstnkTYPEbstnk, "pomunber
aubelTYPEvbeln_va, "salesdocument
matnrTYPEmatnr, "materialnumber
kwertTYPEkwert, "grossvalue
kbetrTYPEkbetr, "rate(conditionamountorpercentage)
knumvTYPEknumv, "numberofdocumentcondition
kposnTYPEkposn, "conditionitemnumber
kschlTYPEkscha, "conditiontype
b_posnrTYPEposnr_vf, "billingitem
waerkTYPEwaerk, "sddocumentcurrency
kurrfTYPEkurrf, "exchangerate_accntg
name1TYPEname1_gp, "name1
kunnrTYPEname1, "customername1
arktxTYPEarktx, "shorttextforsalesorderitem
fkimgTYPEfkimg, "actualbilledquantity
vrkmeTYPEvrkme, "salesunit
netwrTYPEnetwr_fp, "netvalueofthebillingitemindocumentcurrency
s_vbelnTYPEvbeln_va, "salesdocument
ra01_discountTYPEkbetr, "ra01%discount
ra01_dis_amt TYPEkwert, "ra01discountamount
ra00_discountTYPEkbetr, "ra00%discount
ra00_dis_amt TYPEkwert, "ra00discountamount
s_kwmengTYPEkwmeng, "salesordertotalquantity
s_kwert TYPEkwert, "salesordertotalgrossvalue
ENDOFs_all.
TYPES:
BEGINOFs_konv,
kwertTYPEkwert, "grossvalue
kbetrTYPEkbetr, "rate(conditionamountorpercentage)
knumvTYPEknumv, "numberofdocumentcondition
kposnTYPEkposn, "conditionitemnumber
kschlTYPEkscha, "conditiontype
ENDOFs_konv.
TYPES:
BEGINOFs_kna1,
name1TYPEname1_gp, "name1
kunnrTYPEname1, "customername1
kunagTYPEkunag, "sold-toparty
ENDOFs_kna1.
TYPES:
BEGINOFs_vbap,
kwmengTYPEkwmeng, "cumulativeorderquantityinsalesunits
abgru TYPEabgru_va, "reasonforrejectionofquotationsandsalesorders
s_vbeln TYPEvbeln_va, "salesdocument
ENDOFs_vbap.
TYPE-POOLS:
slis. "ALVDeclarations
TYPES:
t_allTYPESTANDARDTABLEOFs_all,
t_konvTYPESTANDARDTABLEOFs_konv,
t_kna1TYPESTANDARDTABLEOFs_kna1,
t_vbapTYPESTANDARDTABLEOFs_vbap.
DATA:
it_allTYPEt_all,
it_konvTYPEt_konv,
it_kna1TYPEt_kna1,
it_vbapTYPEt_vbap,
it_totalTYPEt_all,
it_total_outTYPEt_all.
DATA:
wa_allTYPELINEOFt_all,
wa_konvTYPELINEOFt_konv,
wa_kna1TYPELINEOFt_kna1,
wa_vbapTYPELINEOFt_vbap,
wa_totalTYPELINEOFt_all,
wa_total_outTYPELINEOFt_all.
DATA:
fieldcatalogTYPEslis_t_fieldcat_alvWITHHEADERLINE,
gd_repid LIKEsy-repid.
SELECTION-SCREENBEGINOFBLOCKb1WITHFRAMETITLEtext-000.
SELECT-OPTIONS:
x_vkorgFORwa_all-vkorg, "salesorganization
x_fkartFORwa_all-fkartMATCHCODEOBJECTh_tvfk, "billingtype
x_fkdatFORwa_all-fkdat, "billingdate
x_vbelnFORwa_all-b_vbelnMATCHCODEOBJECTf4_vbrk, "billingdocument
x_kunagFORwa_all-kunagMATCHCODEOBJECTdebi. "sold-toparty
SELECTION-SCREENSKIP.
SELECTION-SCREENBEGINOFBLOCKb2WITHFRAMETITLEtext-001.
PARAMETERSx_checkASCHECKBOX.
SELECT-OPTIONS:
x_spartFORwa_all-spart, "division
x_gsberFORwa_all-gsberMATCHCODEOBJECTh_tgsb, "businessarea
x_matnrFORwa_all-matnr, "material
x_bstnkFORwa_all-bstnk, "pomunber
x_aubelFORwa_all-aubel. "salesdocument
SELECTION-SCREENENDOFBLOCKb2.
SELECTION-SCREENENDOFBLOCKb1.
START-OF-SELECTION.
PERFORMdata_select.
PERFORMdata_processing.
END-OF-SELECTION.
PERFORMdata_display.
*&---------------------------------------------------------------------*
*& Form data_select
*&---------------------------------------------------------------------*
* performdataselecting
*----------------------------------------------------------------------*
FORMdata_select.
PERFORMselect_from_vbrk_vbrp_vbak.
PERFORMselect_from_konv.
PERFORMselect_from_kna1.
PERFORMselect_from_vbap.
ENDFORM. "data_select
*&---------------------------------------------------------------------*
*& Form data_processing
*&---------------------------------------------------------------------*
* performdataprocessing
*----------------------------------------------------------------------*
FORMdata_processing.
PERFORMget_gross_dis_amt.
PERFORMget_total_gross.
PERFORMget_total.
ENDFORM. "data_processing
*&---------------------------------------------------------------------*
*& Form data_display
*&---------------------------------------------------------------------*
* performdatadisplaying
*----------------------------------------------------------------------*
FORMdata_display.
IFx_check='X'.
PERFORMbuild_fieldcatalog.
PERFORMdisplay_alv_reportUSINGit_all.
ELSE.
PERFORMbuild_fieldcatalog.
PERFORMdisplay_alv_reportUSINGit_total_out.
ENDIF.
ENDFORM. "data_display
*&---------------------------------------------------------------------*
*& Form select_from_vbrk_vbrp_vbak
*&---------------------------------------------------------------------*
* 1~selectdatafromtablevbrk/vbrp/vbakintoit_all.
* 2~whenbillingtypeis's1',addnegativetonetvalue
*----------------------------------------------------------------------*
FORMselect_from_vbrk_vbrp_vbak.
SELECTvbrk~vkorg
vbrk~fkart
vbrk~fkdat
vbrk~vbelnASb_vbeln
vbrk~kunag
vbrp~spart
vbrp~matnr
vbrp~gsber
vbrp~aubel
vbak~bstnk
vbrk~knumv
vbrp~posnrASb_posnr
vbrk~waerk
vbrk~kurrf
vbrp~matnr
vbrp~arktx
vbrp~fkimg
vbrp~vrkme
vbrp~netwr
INTOCORRESPONDINGFIELDSOFTABLEit_all
FROMvbrp
JOINvbakONvbak~vbeln=vbrp~aubel
JOINvbrkONvbrk~vbeln=vbrp~vbeln
WHEREvbrk~vkorgINx_vkorg
AND vbrk~vkorgNOTIN('4802','4803') "SaleOrganization
AND vbrk~fkartINx_fkart
AND vbrk~fkartNOTIN('ZMF8','ZPF8')
AND vbrk~fkdatINx_fkdat
AND vbrk~vbelnINx_vbeln
AND vbrk~kunagINx_kunag
AND vbrp~spartINx_spart
AND vbrp~matnrINx_matnr
AND vbrp~gsberINx_gsber
AND vbrp~aubelINx_aubel.
SORTit_allBYb_vbelnkunag.
IFsy-subrc<>0.
MESSAGEi001(zjenni_msg).
ENDIF.
LOOPATit_allINTOwa_all.
IFwa_all-fkart='S1'.
wa_all-netwr=-1*wa_all-netwr.
MODIFYit_allFROMwa_allTRANSPORTINGnetwr.
ENDIF.
ENDLOOP.
CLEARwa_all.
ENDFORM. "select_from_vbrk_vbrp_vbak
*&---------------------------------------------------------------------*
*& Form select_from_konv
*&---------------------------------------------------------------------*
* selectdatafromtablekonvintoit_konv
*----------------------------------------------------------------------*
FORMselect_from_konv.
IFit_all[]ISNOTINITIAL.
SELECTkwert
kbetr
knumv
kposn
kschl
FROMkonv
INTOCORRESPONDINGFIELDSOFTABLEit_konv
FORALLENTRIESINit_all
WHEREknumv=it_all-knumv
AND kposn=it_all-b_posnr
AND kschlIN('PR00','RA00','RA01').
ENDIF.
SORTit_konvBYknumvkposn.
IFsy-subrc<>0.
MESSAGEi001(zjenni_msg).
ENDIF.
ENDFORM. "select_from_konv
*&---------------------------------------------------------------------*
*& Form select_from_kna1
*&---------------------------------------------------------------------*
* selectdatafromtablekna1intoit_all
*----------------------------------------------------------------------*
FORMselect_from_kna1.
IFit_all[]ISNOTINITIAL.
SELECTname1
kunnr
FROMkna1
INTOCORRESPONDINGFIELDSOFTABLEit_kna1
FORALLENTRIESINit_all
WHEREkunnr=it_all-kunag.
ENDIF.
SORTit_kna1BYkunnr.
IFsy-subrc<>0.
MESSAGEi001(zjenni_msg).
ENDIF.
LOOPATit_allINTOwa_all.
READTABLEit_kna1INTOwa_kna1
WITHKEYkunnr=wa_all-kunagBINARYSEARCH.
wa_all-name1=wa_kna1-name1.
MODIFYit_all FROMwa_allTRANSPORTINGname1.
ENDLOOP.
CLEARwa_all.
ENDFORM. "select_from_kna1
*&---------------------------------------------------------------------*
*& Form select_from_vbap
*&---------------------------------------------------------------------*
* 1~selectdatafromtablevbap
*
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SD 提取 订单 定价 过程 各类 折扣 报表