cancel
Showing results for 
Search instead for 
Did you mean: 

Routine for Update Pricing Condition ( Insert )

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

In addition to the routine Try using any of the below User exit.

USEREXIT_XKOMV_BEWERTEN_END (SAPLV61A RV61AFZB)

Within a loop for the price components during pricing, specific values can be transferred into the communication structures in pricing to be further processed.

USEREXIT_XKOMV_FUELLEN (SAPLV61A RV61AFZB)

This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record.

USEREXIT_XKOMV_FUELLEN_O_KONP (SAPLV61A RV61AFZB) This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record. This may include subtotals, manually entered conditions or conditions that have been calculated with a formula.

Regards,

Saju.S

gomatheeswaran_palaniappa
Active Contributor
0 Kudos

Hi,

I couldnt understand your entire code as I'm a functional guy. I have a suggestion for your problem, but.

Please store the value of PR00 in a subtotal and take the value through condition value routine KZWI1 for subtotal 1 and KZWI2 for subtotal 2 etc.

For example,

If xkomv-kwert is INITIAL (Pl correct if I'm wrong.. I mean to say if there is no value for the condition type, take from the subtotal 4 assigned to PR00)

xkomv-kwert = komp-kzwi4.

xkwert = xkomv-kwert..

Regards,

P Gomatheeswaran