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

How to find if the PO Change Badi is called for the first time for a PO

Hi Experts,

We have a scenario wherein we need to set a default value in PO only incase the PO-CHange Badi is called very first time, so as to pass SCs value into PO.
After that a separate logic will be used to default incase again the PO change BAdi is called next time.

Please suggest if their is any way we can find if the PO has just been created out of SC fo rthe first itme.

Thanks in advance.

With Regards,

Gaurav Gupta

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Nov 14, 2012 at 04:00 PM

    Hi,

    If you want to know if the badi is called the first time check the parameter IV_MODE. If the value of this parameter is C then is the first time, the next times the badi is called the value changes to U, even if you are in creation mode and the PO doesn't exit in the database.

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Ricardo,
      It's working great.

      Thanks for sharing this info. This resolved my issue as I required to set few values in PO incase the it has been just created or one can say incase the PO Change Badi is called the very first time.

      Thanks a lot... 😊
      Regards,

      Gaurav

  • author's profile photo Former Member
    Former Member
    Posted on Nov 14, 2012 at 01:24 PM

    Hi Gaurav,

    You can use the following logic.

    Use FM BBP_PD_PO_GETDETAIL. Then provide the PO number/GUID as an import parameter and under E_HEADER (export parameter), get the value of VERSION_NO. If VERSION_NO = '1', it would imply that the PO has just been created from the SC.

    Cheers,

    Nikhil

    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.