Skip to Content
author's profile photo Former Member
Former Member

Creating counter inside badi.

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2011 at 09:40 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 20, 2011 at 07:36 PM

    this was solved by import export functionality.

    Regards,

    Rudhir

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.