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: 

VA01/VA02 User Exit to change the Condition Pricing Date and Pricing amount

Former Member
0 Kudos

Hi Experts,

In my requirement, I need the condition pricing date to be dynamic while creating/changing a sales order. I have changed the field KDATU in XKOMV in the user exit USEREXIT_PRICING_PREPARE_TKOMP of MV45AFZZ.

    

I am able to change the condition pricing date(KDATU) as required. But, the amount is not considered for this date. It is, by default, calculating the amount on Pricing date but not on condition pricing date.

For Example: Pricing date (Header level) - 01.01.2015

                       By default, Condition pricing date = Pricing Date = 01.01.2015

                       Requirement: Condition Pricing date = Service Rendered Date = 02.02.2015

                       To achieve this, I made: XKOMV-KDATU =   VBKD-FBUDA.

                       Now, Condition Pricing Date is changed in the item level as 02.02.2015( Item -> Condition type -> Condition Pricing date).

                       But, the amount is calculated on 01.01.2015 but not on 02.02.2015.

Should I write the code somewhere else than in the above User Exit?

Also, I used several FM like PRICING, SD_COND_ACCESS etc. to update the amount as per the new condition pricing date but, unable to get the correct value.

Finally, I calculated the price manually and assigned the field XKOMV-KBETR with it....I hope this is not the correct solution

Please help me!

                               

1 ACCEPTED SOLUTION

Lakshmipathi
Active Contributor
Requirement: Condition Pricing date = Service Rendered Date = 02.02.2015



It is really very unfortunate fact that in many SAP projects, there is no coordination between functional consultants and technical consultants and the best example is your post. 


When there is a possibility of addressing it via standard configuration, why you were trying with ABAP coding.  Not only in your current project but also ensure that in all your future projects, if you are a technical consultant, before implementing any coding, better discuss with your functional consultant and see that there is any chance to address the requirement via standard configuration.


Now coming to your requirement, go to V/06, select that condition type and execute.  There you can see a field "Pricing Date" where you have to set "A".



G. Lakshmipathi


2 REPLIES 2

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

After passing the values to internal table,  call FM and check.

FORM USEREXIT_PRICING_PREPARE_TKOMP.

CALL FUNCTION 'PRICING'

       EXPORTING

         comm_head_i      = tkomk

         comm_item_i      = tkomp

         calculation_type = 'A'

       IMPORTING

         comm_head_e      = tkomk

         comm_item_e      = tkomp

       TABLES

         tkomv            = xkomv

         svbap            = uvbap.

ENDFORM.

Hope it helpful,

Regards,

Venkat.

Lakshmipathi
Active Contributor
Requirement: Condition Pricing date = Service Rendered Date = 02.02.2015



It is really very unfortunate fact that in many SAP projects, there is no coordination between functional consultants and technical consultants and the best example is your post. 


When there is a possibility of addressing it via standard configuration, why you were trying with ABAP coding.  Not only in your current project but also ensure that in all your future projects, if you are a technical consultant, before implementing any coding, better discuss with your functional consultant and see that there is any chance to address the requirement via standard configuration.


Now coming to your requirement, go to V/06, select that condition type and execute.  There you can see a field "Pricing Date" where you have to set "A".



G. Lakshmipathi