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: 

Calculation rule

Former Member
0 Kudos

Hello,

first I have posted this in forum SD as well, because I don't know where it fits best. Sorry for that!

Problem description:

I have created a statistical condition ZBPR within my pricing procedure.

This condition ZBPR has a calculation rule as follows:

FORM FRM_KONDI_WERT_940.

   data: i_kwert like xkomv-kwert.

   if komp-kposn ne 0.

     i_kwert = komp-brtwr.

     if komp-rke_ww021 = 'foc'.

       xkwert = i_kwert.

     else.

       xkwert = 0.

     endif.

   endif.

ENDFORM.

I now realized that when I step into item conditions value in ZBPR is fine.

When I go back and step into header conditions the calculation rule (FRM_KONDI_WERT_940) is called one more time.

Now in FRM_KONDI_WERT_940  kposn is '00010', but komp-rke_ww021 is initial. This will result in that ZBPR is set to 0 !!!

Is there a way to check within FRM_KONDI_WERT_940 whether system is on item conditions or header conditions, because I just want to execute the calculation rule on item conditions ?

Thanks for your responses

Wolf.

1 ACCEPTED SOLUTION

Sijin_Chandran
Active Contributor
0 Kudos

Hi Wolfgang ,

Either You check for KOMK structure there

or

Maintain that Condition type Line Item Specific

Changes which can be made  tab in v/06


2 REPLIES 2

Sijin_Chandran
Active Contributor
0 Kudos

Hi Wolfgang ,

Either You check for KOMK structure there

or

Maintain that Condition type Line Item Specific

Changes which can be made  tab in v/06


0 Kudos

Checked everything you mentioned. Was setup identical.

Problem was that field komp-rke_ww021 is initial when moving to header conditions.

Maybe something wrong in SAP standard?

I took another field from struct komp and now it works fine!

Thanks a lot!!!