SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Macro mac_output_ioper accumulating values

Former Member
0 Kudos
606

Hi,

     We have developed a custom variant which does some calculations and returns outputs.

     To fill values to the output operands, we are using the macro ' mac_output_ioper '.

   

     But the macro adds the previously calculated values to the current values before returning the output. This is resulting in incorrect values.

     i.e. If the previous value calculated for the operand ZOP1 is 10 and the current value is 5, we are getting an output of 15 instead of 5.

     Can someone let us know what is going wrong here.

     Also, we do not have any variant control which regulates whether the values are overwritten or added.

Regards,

Joshua.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
526

Hi Joshua,

Can you provide more details as in which Variant you are trying to modify?

Cheers

View solution in original post

4 REPLIES 4
Read only

Former Member
0 Kudos
527

Hi Joshua,

Can you provide more details as in which Variant you are trying to modify?

Cheers

Read only

0 Kudos
526

Hi Sudeep,

We have developed a custom variant.

There are no inputs to the variants, but it calculates and returns four factors.

The values in these four factors get accumulated.

I tried using

     mac_init_output '02' x_op-o1

     mac_init_output '02' x_op-o2

     mac_init_output '02' x_op-o3

     mac_init_output '02' x_op-o4


The above logic did not work as expected.

Between the two calls to the variants, the operands are being used for calculations.

But the above logic clears the operand values and the calculations become incorrect.

    

Regards,

Joshua.

Read only

0 Kudos
526

Hi Joshua,

When you create a custom Variant, generally its a copy of standard variants over which you make modifications.

If you are creating from scratch then add variant control in Tcode EA99.

Choose the variant control in the rate step "Values Overwritten during Update".

Use Macro ' mac_output_ioper ' OR  mac_facts_write(if you are writing in the installation facts and choose update type as '4' for the output operand).

Let me know if it is helpful.

Cheers,

Sudeep

Read only

0 Kudos
526

Hi Sudeep,

Thanks for your inputs.

Regards,

Joshua.