Classic BAdi and New BAdi

Former Member

Classic BAdi and New BAdi ...

Hi all,

I have a question regarding the new BAdi concept using enhancement spots.

With the classic BAdi's once we create an implementation it will call up our implementation when the BADI class is been called.

But with the new concept we have to explicitly call the BAdi we created right ? doesn't this mean modifiying the standard code ( If there's no ehancement section or point )?

Can someone tell me whether there is another way to call our implementation by using GET BADI and CALL BADI statement without modifying standard code ( by creating an explicit enhancement).

Cheers,

D.

 

2条回复

 
 
  • author's profile photo
    Former Member
    2007年04月27日 04:52
    1

    hi,

    Classic and new BAdIs differ in a number of features that are important for migration:

    1. BAdI object

    a. With classic BAdIs, a BAdI object is created by calling a factory method, and referenced via a reference variable of the type of the BAdI interface.

    b. With new BAdIs, a BAdI object is created via the ABAP statement GET BADIas a handle for the calls of BAdI methods, and referenced via a reference variable of the type of the BAdI. A BAdI object is an instance of an internal BAdI class, which otherwise is invisible to the outside.

    2. Passing comparison values for the filter

    a. With the classical BAdIs, the filter values are stored in a structure and passed with the call of the BAdI methods.

    b. With the new BAdIs, the comparison values for the filters used to search for implementations are passed when the BAdI object is created with the GET BADIstatement.

    There is no way of migrating the call of the factory method one-to-one into the ABAP statement, because GET BADI can also return an existing BAdI object, which is not possible with the factory method.

    3. Calling BAdI methods

    Passing comparison values for the filter

    a. A classic BAdI can be called only once and the call positions are registered centrally.

    b. With new BAdIs, multiple calls are possible and the call positions are not registered centrally.

    For the above reasons, an automatic call migration is not possible.

    Have a look at below link.

    http://help.sap.com/saphelp_nw2004s/helpdata/en/ee/6f3b42ea85b26be10000000a155106/content.htm

    http://help.sap.com/saphelp_nw2004s/helpdata/en/0e/4d3e42fc94aa04e10000000a1550b0/content.htm

    I hope it helps.

    Best Regards,

    Reshma

    4 Comments
      •  
          Michael Acker   Former Member

        Hi,

        If the BAdI is not a migrated BAdI but a new BAdI, it cannot be called via the

        CL_EXITHANDLER. It need to be called via the ABAP commands GET BADI and CALL BADI.

        A call to CL_EXITHANDLER will result in an error. If this coding, is deliverd from SAP and again the BAdI is not an migrated BADI you should create a problem message.

        Regrads

        Michael

     
     
  • author's profile photo
    Former Member
    2007年10月12日 02:57
    0

    Hi Dhanushka ,

    I have the same issue like yours. But I still don't understand how your issue is solved by the answers given above. Can you please give more specific answer?

    where to write the GET BADI and CALL BADI commands if there are no Enhancement Spot ? Is it correct to do it in implicit enhancement ?

猜你喜欢

转载自www.cnblogs.com/rainysblog/p/12057402.html