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 FM std variable xkomv-kawrt issue

Former Member
0 Likes
3,687

Dear All,

My requirement is to call single subroutine of Pricing FM - xkomv_bewertenthrough Z report program to calculate net price of a material. For that, I am passing material quantity as 1 to KOMP-MGAME as below:

  DATA: c_1 TYPE komp-mgame VALUE 1.

  komp-mgame = c_1.

Along with other field-values of KOMP variable and other required variables, I am calling PERFORM xkomv_bewerten from my Z program. All these structures / variables are declared in Std. SAP Top Include "lv61atop". I have included that top-include in my Z program.

In debug, I found this issue:

1. Go to Include "LV61AA74" (Form konditionsbasis_ermitteln) and put a breakpoint at line no. 141 as shown below:

2. Go to VA01. Provide basic details - Order type, sales org, dist channel, division, sold-to, ship-to, material, quantity as 1, and press enter. It will start the debugger and set below values for variables:

3. While from my Z program, if I set KOMP-MGAME = 1, and then call PERFORM xkomv_bewerten, it will set variables as below in debug mode at the same code location:

4. Error is: XKOMV-KAWRT is set to 1.00 (Hex Value 100C)while calling from Z program. It should be set to 10.00 (Hex Value 1000C) as per VA01 runtime values.

Observation / Analysis:

  1. All the relevant variables for this issue are declared in Std. SAP code (top – include). I have included the same in my Z program. So declaration could not be the reason for this error.
  2. After setting initial values, the program flow executes std. SAP code with no enhancement / exits implemented. So enhancements / exits cannot be a reason for this error.
  3. Error giving statement: “xkomv-kawrt = arbfeld_dec.” is a simple assignment statement from std. SAP code. It converts 1.000 (type p decimals 3 ) to 10.00 (type WERTV8 <decimals 2>) because of variables’ nature of definition.

Please suggest if you have any clue about the solution.

Thanks in advance,

Birwa

1 ACCEPTED SOLUTION
Read only

Maciej_DomagaBa
Contributor
0 Likes
2,807

See SE80: function group V61A properties:

Note the option highlighted above and set it the same way in your Z-program (SE80-> Goto-> Properties).

regards

Dear All,

My requirement is to call single subroutine of Pricing FM - xkomv_bewertenthrough Z report program to calculate net price of a material. For that, I am passing material quantity as 1 to KOMP-MGAME as below:

  DATA: c_1 TYPE komp-mgame VALUE 1.

  komp-mgame = c_1.

Along with other field-values of KOMP variable and other required variables, I am calling PERFORM xkomv_bewerten from my Z program. All these structures / variables are declared in Std. SAP Top Include "lv61atop". I have included that top-include in my Z program.

In debug, I found this issue:

1. Go to Include "LV61AA74" (Form konditionsbasis_ermitteln) and put a breakpoint at line no. 141 as shown below:

2. Go to VA01. Provide basic details - Order type, sales org, dist channel, division, sold-to, ship-to, material, quantity as 1, and press enter. It will start the debugger and set below values for variables:

3. While from my Z program, if I set KOMP-MGAME = 1, and then call PERFORM xkomv_bewerten, it will set variables as below in debug mode at the same code location:

4. Error is: XKOMV-KAWRT is set to 1.00 (Hex Value 100C)while calling from Z program. It should be set to 10.00 (Hex Value 1000C) as per VA01 runtime values.

Observation / Analysis:

  1. All the relevant variables for this issue are declared in Std. SAP code (top – include). I have included the same in my Z program. So declaration could not be the reason for this error.
  2. After setting initial values, the program flow executes std. SAP code with no enhancement / exits implemented. So enhancements / exits cannot be a reason for this error.
  3. Error giving statement: “xkomv-kawrt = arbfeld_dec.” is a simple assignment statement from std. SAP code. It converts 1.000 (type p decimals 3 ) to 10.00 (type WERTV8 <decimals 2>) because of variables’ nature of definition.

Please suggest if you have any clue about the solution.

Thanks in advance,

Birwa

5 REPLIES 5
Read only

vamsixk
Active Participant
0 Likes
2,807

Hi Birwa, 

I had faced a similar Issue while trying to load pricing condition values for contracts.

According to my analysis based on the condition type -calculation type, a division by 10 is carried out.(refer to attached screenshot)

Am not sure functionality wise why this happens, but i have only analyzed it technically. Please check for yourselves. hope the screenshot helps.

Regards

Vamsi

Read only

Former Member
0 Likes
2,807

Hi Vamsi,

Thanks for your reply. I have checked the code you attached and tried to put a breakpoint in it to analyze in detail, but VA01 / Pricing FM did not call this functionality at all. Can you please share how this screen shot-code is related to VA01 pricing calculations?

Thanks again,

Birwa

Read only

Former Member
0 Likes
2,807

The problem is due to fixed point arithmethic.

The main program for RV64* does not has this active try removing it fromyour program too..

Or find an FM that can return the value for you.

For more details refer to my blog.

Read only

Maciej_DomagaBa
Contributor
0 Likes
2,808

See SE80: function group V61A properties:

Note the option highlighted above and set it the same way in your Z-program (SE80-> Goto-> Properties).

regards

Read only

0 Likes
2,807

Hey Maciej,

Thanks, it solved my issue. I was stuck at this place since long. Thanks a lot!

Regards,

Birwa