含稅的定價程序與訂金
Step | Cntr | CTyp | Description | From | To | Man. | Mdt | Stat | SubTo | Reqt | AltCTy | AltCBV | ActKy | Accrls | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | ZPR0 | Price | X | X | X | 2 | |||||||||
13 | ZPB0 | Price (Gross) | X | X | X | ||||||||||
14 | ZENZ | Price | X | X | X | ||||||||||
100 | Gross Value | X | X | 1 | |||||||||||
105 | NETW | Value of Goods | X | 2 | 902 | ERL | |||||||||
500 | Z001 | Down Payment | X | X | 2 | Z3 | |||||||||
510 | DiscountAmount | 500 | 3 | ||||||||||||
800 | Net Value | 4 | 902 | ||||||||||||
900 | MWST | Tax | X | S | 10 | 19 | MWS | ||||||||
930 | Total | 800 | 910 | A | 4 | ||||||||||
940 | ZPRS | Standard Cost | X | B | 4 | ||||||||||
950 | VPRS | Cost | X | B | 4 | ||||||||||
970 | Profit segment | 11 |
Formula 902
*&---------------------------------------------------------------------*
*& Form FRM_KONDI_WERT_902
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM frm_kondi_wert_902.
DATA: lv_subrc LIKE sy-subrc,
lv_kwert LIKE xkwert,
lv_mwst LIKE xkwert.
CLEAR: lv_subrc, lv_kwert, lv_mwst.
IF xkomv-kschl = 'NETW'.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1
arithmetic_errors = 5.
lv_kwert = komp-kzwi1 * 100 / 105 + komp-kzwi3.
lv_kwert = lv_kwert + lv_kwert / 20.
* Tax Diff
lv_mwst = lv_kwert - komp-kzwi1.
xkwert = komp-kzwi1 * 100 / 105 - lv_mwst.
ENDCATCH.
lv_subrc = sy-subrc.
ELSE. " Net Value
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1
arithmetic_errors = 5.
xkwert = komp-kzwi2 + komp-kzwi3. " Net Value
ENDCATCH.
lv_subrc = sy-subrc.
ENDIF.
IF sy-subrc = 1 OR sy-subrc = 5.
MESSAGE s802.
xkomv-kinak = 'X'.
xkwert = 0.
xkomv-kwert = 0.
xkomv-fxmsg = '802'.
komp-fxmsg = '802'.
ENDIF.
ENDFORM. "FRM_KONDI_WERT_902
User Exit: RV61AFZB
*---------------------------------------------------------------------*
* FORM USEREXIT_XKOMV_BEWERTEN_END *
*---------------------------------------------------------------------*
FORM userexit_xkomv_bewerten_end.
IF komk-kalsm = 'ZRA01Z'.
DATA: lv_kwert LIKE xkwert,
lv_mwst LIKE xkwert,
lv_adjed LIKE xkwert,
lw_xkomv LIKE xkomv.
CLEAR: lv_kwert, lv_mwst, lw_xkomv.
CLEAR: lv_kwert, lv_mwst, lw_xkomv.
LOOP AT xkomv WHERE kschl = 'MWST'.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1
arithmetic_errors = 5.
xkomv-kawrt = komp-kzwi1 * 100 / 105 + komp-kzwi3.
lv_kwert = xkomv-kawrt.
lv_adjed = xkomv-kawrt / 20.
lv_kwert = lv_kwert + lv_adjed.
lv_mwst = lv_kwert - komp-kzwi1.
IF lv_mwst NE 0 AND xkomv-kwert NE lv_adjed.
xkomv-kwert = xkomv-kwert + lv_mwst.
xkomv-kherk = 'I'.
MODIFY xkomv.
ENDIF.
ENDCATCH.
ENDLOOP.
LOOP AT xkomv WHERE kschl = 'NETW'.
READ TABLE xkomv WITH KEY kschl = 'MWST'
INTO lw_xkomv.
IF lw_xkomv-kherk EQ 'I' AND
xkomv-kherk NE 'I'.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1
arithmetic_errors = 5.
* NETW + MWST + down payment
lv_kwert = xkomv-kwert + lw_xkomv-kwert + komp-kzwi3.
* NETW Diff
lv_mwst = lv_kwert - komp-kzwi1.
IF lv_mwst NE 0.
xkomv-kwert = xkomv-kwert - lv_mwst + xkomv-kdiff.
xkomv-kdiff = lv_mwst - xkomv-kdiff.
xkomv-kherk = 'I'.
MODIFY xkomv.
ENDIF.
ENDCATCH.
ENDIF.
ENDLOOP.
* Net Value
READ TABLE xkomv WITH KEY kschl = 'NETW'
INTO lw_xkomv.
IF lw_xkomv-kherk = 'I'.
LOOP AT xkomv WHERE stunr = '800'.
xkomv-kwert = komp-kzwi2 + komp-kzwi3.
MODIFY xkomv.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. "USEREXIT_XKOMV_BEWERTEN_END
沒有留言:
張貼留言