Application Development and Automation 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: 
Read only

Triggering pricing procedure for different fields

former_member1716
Active Contributor
0 Likes
1,760

Hello All Experts,

I have the following requirement,

In sales documents under line items, whenever there is a change in the Target-quantity field (Screen field-VBAP-ZMENG) a pricing prodecure gets triggered and the value of Net quantity(Screen field-VBAP-NETWR) is recalculated. This is like standard behaviour, Now for my requirement

I have a particular subroutine procedure which needs to get triggered whenever i change the values in following fields and hit enter, the fields are

Plant                         (Screen field-  VBAP-WERKS)

Pricing date               (Screen field-VBKD-PRSDT)

material Pricing group (Screen field-VBAP-MATKL)

Price list category      (Screen field-VBKD-PLTYP)

Material main item

Document Currency    (Screen field-VBAK-WAERK)

Could You please suggest me the user exits where i can code to trigger my Subroutine whenever there is change in these fields.

Am very thankful for your help

Thanks and regards,

Satish

1 ACCEPTED SOLUTION
Read only

eduardo_hinojosa
Active Contributor
0 Likes
1,322

Hi

Include MV45AFZB, subroutines USEREXIT_NEW_PRICING_VBAP and USEREXIT_NEW_PRICING_VBKD.

See also SAP Note 24832 - Pricing rules / TVCPF

Regards

Eduardo

6 REPLIES 6
Read only

eduardo_hinojosa
Active Contributor
0 Likes
1,323

Hi

Include MV45AFZB, subroutines USEREXIT_NEW_PRICING_VBAP and USEREXIT_NEW_PRICING_VBKD.

See also SAP Note 24832 - Pricing rules / TVCPF

Regards

Eduardo

Read only

0 Likes
1,322

Hi eduardo,

Thanks for the reply

Can you please review my Code below,

For example take in case of document currency, Can i code like this below,

if VBAK-WAERK ne *VBAK-WAERK.

new_pricing = 'B'.

endif.

If yes can i proceed with the same approach for all fields, also can you please  explain how this code will retrigger the pricing procedure because here no where am mentioning about the subroutine details.

Thanks,

Satish

Read only

0 Likes
1,322

Hi

There isn't an userexit for changed data in VBAK, but in the note mentioned, see the example 5, maybe with implicit enhancement you could do it.

Regards

Eduardo

Read only

0 Likes
1,322

Hi Eduardo,

I have gone through the example 5, there it is dealing about triggering new pricing. But my requirment is different.

My requirement is for all the above mentioned fields when i change the value and click on the update button the pricing procedure B is getting triggerred, but i want this same procedure B to get triggerred when i change the values and press enter

Hope you are clear. Can you please help on how to achieve this

regards,

Satish

Read only

0 Likes
1,322

Hi Eduardo,

I have acheived the requirement by coding the following code in include MV45AFZB.

IF vbkd-konda NE *vbkd-konda.
  new_pricing = 'B'.
ENDIF.

Similarly for all the six fields i have coded the same.

Now one issue from this is whenever i make a change in VK12 with the condition record, the changes are is directly reflecting in VA02 which should not happen, even though in deugging mode this include is not at all called when i make changes in VK12.

But the strange thing is if i comment my code lines and do the changes in VK12 then my changes are not reflecting in VA02.

Please help me in rectifying this issue.

Thanks and regards,

Satish

Read only

0 Likes
1,322

Hi

If you change the value of KONDA in VA02, then re-determination type 'B' happens (according recommendation is the mentioned note). If you comment, you need trigger the re-determination with pushing the button for re-determination in VA02.

I hope this helps you

Regards

Eduardo