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

Queries on BADI Business Add In

I am working onn WOROKORDER_UPDATE BADI for Production Order for Process Industries. Following are my queries:

1. Is there a sequence in which the methods fire for example Interface method IF_EX_WORKORDER_UPDATEAT_SAVE is fired say before or after method IF_EX_WORKORDER_UPDATEBEFORE_UPDATE. This is for WORKORDER_UPDATE BADI.

2. Does each method get fired in same instance of same Implementation Class or in a separate instance.

3. If the methods are fired in separate instances how to share data across the separate instances in a OO approved manner other than SET/GET or EXPORT/IMPORT traditional mechanisms.

4. How to debug in ABAP debugger, seting breakpoints and watchpoints in method implementation code. Without having to wade through huge amounts of caller transaction code.

5. How to use BADI method for validation passing back a eror message to calling transaction say COR1 without raising exception and system message. Specifically I wish to use IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE for custom Validation.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 28, 2005 at 09:46 PM

    Hi Jayantha

    <b>> 1. Is there a sequence in which the methods fire for

    > example Interface method

    > IF_EX_WORKORDER_UPDATE~AT_SAVE is fired say before or

    > after method IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE.

    > This is for WORKORDER_UPDATE BADI.</b>

    Each method of a BAdI is triggerred at a defined point during the program flow. So this means that there is a order.

    <b>> 2. Does each method get fired in same instance of

    > same Implementation Class or in a separate instance.</b>

    Each method seems to be triggered in the same instance however, BAdI methods can only deal with its own variables and the data passed through its interface. So, it depends on the design of the interface and the encapsulation level how much you can interfere in the program flow.

    <b>> 3. If the methods are fired in separate instances how

    > to share data across the separate instances in a OO

    > approved manner other than SET/GET or EXPORT/IMPORT

    > traditional mechanisms.</b>

    BAdIs are more or less restricted interferences to the program flow. Having variables of more visibility or data sharing may have adverse effects. So, try to be contented with the given interface.

    <b>> 4. How to debug in ABAP debugger, seting breakpoints

    > and watchpoints in method implementation code.

    > Without having to wade through huge amounts of caller

    > transaction code.</b>

    It restricts debugging at some parts, do not know why. If you set break-points, you can get nonsense error messages. However, you can still debug some parts.

    <b>> 5. How to use BADI method for validation passing back

    > a eror message to calling transaction say COR1

    > without raising exception and system message.

    > Specifically I wish to use

    > IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE for custom

    > Validation.</b>

    It may prevent you to leave the current screen (especially at before_update methods) for ensuring encapsulation I believe.

    Hope this much helps...

    *--Serdar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2005 at 12:21 PM

    Hi Jayantha,

    I'm also using this BADI and got some experience:

    2) At least before_update / in_update don't have access to common data (I tried own class attribute).

    3) I'm making some tests in before_update (because of status table) and updating a field in in_update. I forwad my information with EXPORT to shared buffer.

    4) Debugging behaves normal - only methods in update tasks are difficult to get, just like any other update task debugging.

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2005 at 06:02 PM

    Thanks for all the info.

    Two important issues remain:

    1. WORKORDER_UPDATE BADi would have been far more useful if the sequence if method invocation was "logical". It seems reasonable to call BEFORE_UPDATE before AT_SAVE. Or at least pas IT_ITEM to AT_SAVE!

    2. Each method should have exception ERROR_WITH_MESSAGE. AT_SAVE has but BEFORE_UPDATE does not.

    Any clarifications why the current design of WORKORDER_UPDATE BAdi is OK would be very enlightening.

    Regards & thanks

    -jnc

    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.