Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Routine for Update Pricing Condition ( Insert )

Hello Gurus,

While creating Sales order in VA01,

we are maintaining 2 pricing conditions in the pricing procedure for interdivision transaction.

1 - for debiting the customer - PR00 and another ZAVL for debiting Excise duty.

Most of the time user change PR00 condtion and skiped for updating ZAVL .

I need write a routine such that when pricing condition ZAVL is maintain in VK11 it takes the value of ZAVL from there.

If ZAVL is not maintained in VK11, ZAVL condition should be inserted in the conditions table and it should copy the values

of pricing condition PR00.

For this purpose i have written a routine in VOFM -> Formulas -> Condition Values.

In this routine im inserting the pricing condition ZAVL in XKOMV by using APPEND.

After APPEND the condition get inserted in XKOMV ,but as soon as my routine is over the inserted record get refreshed.

FORM FRM_KONDI_WERT_799.

*{ INSERT

DATA: SKWERT LIKE XKWERT,

ZKWERT LIKE XKWERT,

ZKOMV LIKE KOMV,

TKOMV LIKE KOMV,

RKOMV LIKE KOMV.

CLEAR: SKWERT.

READ TABLE XKOMV into zkomv WITH KEY KSCHL = 'ZAVL'.

IF SY-SUBRC <> 0.

READ TABLE XKOMV into TKOMV WITH KEY KSCHL = 'PR00'.

SKWERT = TKOMV-KWERT.

ZKWERT = TKOMV-KBETR.

RKOMV-KSCHL = 'ZAVL'.

RKOMV-KWERT = SKWERT.

READ TABLE XKOMV INTO zkomv WITH KEY KSCHL = 'ZAVL'.

IF SY-SUBRC <> 0.

APPEND RKOMV TO XKOMV.

CLEAR RKOMV.

ENDIF.

ENDIF.

CLEAR SKWERT.

*} INSERT

ENDFORM.

Thanks In advance please reply soon because this is very urgent to solve......

Thanks,

Mahesh

Former Member
Not what you were looking for? View more on this topic or Ask a question