2.将条件类型加入到定价过程
2-2. 【小计】:填写9
2-3. 【条件金额备选计算例程】:填上911,这个例程需要提前创建好,例程号码可以900-999都行。
创建计算税额的例程(事务码:VOFM),具体可按如下步骤操作。
应用程序填写M,表示采购定价例程。
然后在如下界面增加计算程序(如下图)
最后激活此例程即可。
FORM FRM_KONDI_WERT_911.
*{ INSERT S4HK919394 1
DATA: l_kbetr LIKE konp-kbetr. "Tax Rate
DATA: l_krech LIKE t685a-krech. "Inclusive or Exclusive
DATA: l_knumh LIKE a003-knumh. "Condition Record Number
DATA: l_kschl LIKE a003-kschl. "Condition Type
DATA: l_kappl(2) TYPE c VALUE 'TX'. "Application
* Get condition type and condition record
SELECT SINGLE knumh kschl
FROM a003
INTO (l_knumh,l_kschl)
WHERE kappl = l_kappl
AND aland = komk-aland
AND mwskz = komp-mwskz.
IF sy-subrc = 0.
* Get condition record value
SELECT SINGLE kbetr
INTO l_kbetr
FROM konp
WHERE knumh = l_knumh.
IF sy-subrc = 0.
SELECT SINGLE krech
INTO l_krech
FROM t685a
WHERE kschl = l_kschl.
* Set Condition Value
IF sy-subrc = 0.
IF l_krech = 'A'. "Tax Excluded
xkwert = -1 * xkomv-kawrt * l_kbetr / ( 100000 + l_kbetr ).
ELSEIF l_krech = 'I'. "Tax Included
xkwert = -1 * xkomv-kawrt * l_kbetr / 100000.
ENDIF.
ENDIF.
l_kschl = xkomv-kschl.
* Set Condition Amount
LOOP AT xkomv WHERE kschl = l_kschl.
xkomv-kbetr = l_kbetr * -1.
ENDLOOP.
ELSE.
* Set Condition Value
xkwert = 0.
l_kschl = xkomv-kschl.
* Set Condition Amount
LOOP AT xkomv WHERE kschl = l_kschl.
xkomv-kbetr = 0.
ENDLOOP.
ENDIF.
ENDIF.
*} INSERT
ENDFORM.
联系客服