Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Change the Pricing Type maintained in copy control table TVCPF

Former Member
0 Kudos

Hi All,

I have a requirment as follows, when the billing is carried out (i.e Invoice created ), the pricing type maintained in the TVCPF table (<b>TVCPF-KNPRS</b> ) needs to be changed dynamically based on fulfilment of a certain condition, thus the pricing will then be carried out based on the new pricing type.

I have implemented the corrections mentioned in note <b>24832</b> which states to use program <b>RV61AFZ</b> <b>(userexit_pricing_rule)</b> where I have created my own pricing types X,Y,Z.

Next we tried using the user exit to set the pricing type if certain condition is met. The user exit for this is "<b>userexit_new_pricing_vbkd CHANGING new_pricing</b>" in program "<b>MV45AFZB</b>" , but apparantly found out that it is changing the pricing type on the sales order and not while creating the invoice. So this doesn't meet the requirment.

Then we tried using the userexit <b>USEREXIT_CHANGE_PRICING_RULE (module pool SAPMV61A, program MV61AFZA)</b> which states that :

You can use this user exit to change the pricing type that has been predefined in the copying control table in billing.

But unfortunately this code is not at all getting triggered while creating the invoice.

Can someone please help me urgently if you have any solution for this ?

Regards

Advait.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Wolfgang,

Thanks for your reply, I did debug the user exit mentioned by you (USEREXIT_FILL_VBRK_VBRP in RV60AFZC), seems it would solve my problem as I changed the TVCPF-KNPRS at runtime there and it did re-determine the prices.

But as you said "try to solve the problem in user exit in program RV61AFZA" what I observed is that the user exit (userexit_pricing_rule) is also called while creating the sales order. Thus we are using that user exit only to create the new pricing rules X,Y, and Z and appending it to the steu internal table.

Could you please let me know if there is any thing more that needs to be taken care of.

Regards,

Advait.

4 REPLIES 4

Former Member
0 Kudos

Hello,

a 'brut force' solution could be using the exit USEREXIT_FILL_VBRK_VBRP in RV60AFZC. You could change there the current TCVPF-entry - since it's an old exit, it's possible.

But it could be better trying to solve the problem with the exit's in RV61AFZA - if it's possible.

Remember: all exit's beginning with MV45 are order-related, the invoice-related exit's are beginning with RV60 or RV61..

Regards Wolfgang

Former Member
0 Kudos

Hello Wolfgang,

Thanks for your reply, I did debug the user exit mentioned by you (USEREXIT_FILL_VBRK_VBRP in RV60AFZC), seems it would solve my problem as I changed the TVCPF-KNPRS at runtime there and it did re-determine the prices.

But as you said "try to solve the problem in user exit in program RV61AFZA" what I observed is that the user exit (userexit_pricing_rule) is also called while creating the sales order. Thus we are using that user exit only to create the new pricing rules X,Y, and Z and appending it to the steu internal table.

Could you please let me know if there is any thing more that needs to be taken care of.

Regards,

Advait.

0 Kudos

Hello Advait,

you're right, the exit USEREXIT_PRICING_RULE is used by SAPLV61A - and that are the pricing functions in general (order and invoice ).

But wouldn't it be possible to solve your problem with USEREXIT_PRICING_COPY in RV61AFZA: there you could handle pricing on a condition type - level. Yust not to change the whole pricing rule.

Regards Wolfgang

kngupta141
Participant
0 Kudos

Hi Advait,

I need to redetermine the price as well but what ever the input i am going it is not working. Is it possible for you to help me.

Regards,

Gupta