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

Pricing Function Module calculates wrong net value

Former Member
0 Likes
1,070

Hello all,

We are using Function module PRICING for generating pricing and the new value it returns is diffrent then when you simulate.

The net value that returns wrong is ep_netwr = fs_komp-kzwi1.

Code below:

*Pricing başlık bilgileri

   PERFORM fill_pricing_header USING is_matpr.

*Pricing kalem bilgileri

   PERFORM fill_pricing_item   USING is_matpr.

   REFRESH : ft_komv.

  CALL FUNCTION 'PRICING'

     EXPORTING

       calculation_type = 'B'        "Carry out new Pricing

       comm_head_i      = fs_komk

       comm_item_i      = fs_komp

     IMPORTING

       comm_head_e      = fs_komk

       comm_item_e      = fs_komp

     TABLES

       tkomv            = ft_komv

     EXCEPTIONS

       OTHERS           = 0.

   DELETE ft_komv

    WHERE kinak NE space.

   CLEAR:ep_netwr, ep_indtut.

   ep_netwr = fs_komp-kzwi1.

7 REPLIES 7
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
915

Did you check in debugging for both the scenarios in parallel...?

Read only

0 Likes
915

Yes i debugged the code Nabheet

and what i found is SAp finds a discount code when users come via internet

and discounts that as well which leads to the wrong value

But when you create via R3 it doesnt apply that web discount.

So it works correct actually but how can we change this that it knows its not coming from web?

what do you suggest ?

Read only

0 Likes
915

Can you please point the code in PRICING.. We will have to check at what place it determines the same. Please provide that subroutine details

Read only

0 Likes
915

Nabheet hello

The code PRICING is called inside a Z function

And it returns the table

ft_komv inside this table we looked and saw the extra discount which doesnt exist

in normal transaction and that was for web discount

I havent debugged inside the Pricing Function module

I talked with customers and they say they will be using this via web so for now

it seems we are on hold.

CALL FUNCTION 'PRICING'

     EXPORTING

       calculation_type = 'B'        "Carry out new Pricing

       comm_head_i      = fs_komk

       comm_item_i      = fs_komp

     IMPORTING

       comm_head_e      = fs_komk

       comm_item_e      = fs_komp

     TABLES

       tkomv            = ft_komv

     EXCEPTIONS

       OTHERS           = 0.

Read only

0 Likes
915

Thanks Nabheet for your help

Read only

0 Likes
915

Is your pricing is for Free goods,

Please give parameter as A then check once ..

Read only

0 Likes
915

good..Otherwise we debug more and find the root cause:)