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: 

Creating counter inside badi.

Former Member
0 Kudos

Hi All,

I am using the badi BADI_MATERIAL_REF for defaulting material master. In this i need to make the value blank of the fields

standard price and moving price in veiw Accounting 1 while creating the material in mm01 by using referece material (copying).

In this process the standard price and moving price get copied from reference material.

So i wrote the code to make these two fields blank but this badi gets triggered on each and every veiw. so my problem is that

in the very first time my badi is reseting the value of standard price and moving price. But when the user enters the price and switch to other veiw or save the material, again my badi gets triggered and make the fields value blank.

My system is ECC5.0, So i cant create enhancement point for global counter to put the condition such that my code should get triggered only first time.

Can anyone suggest me for this? Is there any global variable for badi which counts its occurance?

Thanks,

Rudhir Bhaskar.

2 REPLIES 2

Former Member
0 Kudos

Hi,

Use statics (Static Variable).

Statics : s_counter type i value '0'.

if s_counter eq 0.
   clear price.
   s_counter = 1.
end if.

Regards,

Jovito

Former Member
0 Kudos

this was solved by import export functionality.

Regards,

Rudhir