Coding in new BADI approach
hi all,
i have the following classical badi code working fine with latest enhancement spot and implementation.
tables: spfli.
data: wa_spfli type spfli,
it_spfli type table of spfli with key carrid connid.
*Initialise the object of the interface.
data: exit_ref type ref to ZCL_EX_BADI_SPFLI,
exit_ref1 type ref to ZIF_EX_BADI_SPFLI.
selection-screen begin of block b1.
select-options: s_carr for spfli-carrid.
selection-screen end of block b1.
start-of-selection.
select * from spfli into corresponding fields of table it_spfli
where carrid in s_carr.
end-of-selection.
loop at it_spfli into wa_spfli.
write:/ wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-deptime,
wa_spfli-arrtime.
hide: wa_spfli-carrid, wa_spfli-connid.
endloop.
at line-selection.
check not wa_spfli-carrid is initial.
create object exit_ref.
exit_ref1 = exit_ref.
call method exit_ref1->lineselection
EXPORTING
i_carrid = wa_spfli-carrid
i_connid = wa_spfli-connid.
clear wa_spfli.
When i change the above code to new BADI call, error message "BD" is not a valid badi-handler.
p.s. badi definition and implementation done in latest enhancement framework for both the code.
Please advise where is going wrong. Thank you.
data: wa_spfli type spfli,
it_spfli type table of spfli with key carrid connid.
*Initialise the object of the interface.
data bd type ref to ZCL_EX_BADI_SPFLI.
selection-screen begin of block b1.
select-options: s_carr for spfli-carrid.
selection-screen end of block b1.
start-of-selection.
select * from spfli into corresponding fields of table it_spfli
where carrid in s_carr.
end-of-selection.
loop at it_spfli into wa_spfli.
write:/ wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-deptime,
wa_spfli-arrtime.
hide: wa_spfli-carrid, wa_spfli-connid.
endloop.
at line-selection.
check not wa_spfli-carrid is initial.
get badi bd.
call badi bd->lineselection
EXPORTING
i_carrid = wa_spfli-carrid
i_connid = wa_spfli-connid.
clear wa_spfli.
hi all,
problem has been resolved by changing the
data bd type ref to ZCL_EX_BADI_SPFLI
to
data bd type ref to badi_name (badi definition name, not the class name).
thanks.
Similar Messages
-
New BADI concept in ECC 6.0
I am trying to gain an understanding of how I would implement one of the new BADIs in ECC 6.0 (badis implmented through and enhancement spot , get badi, call badi concept).
I am not looking for information on how to implement a classic badi through se18/se19.
I have also ready through the SAP help on the new badis and it is still not clear to me. So, please do not provide links to the standard SAP help. I have that.
I am wondering if anybody has a whitepaper, example, etc. that explains the details of how to implement, use, trigger the new badis linked to an enhancement spot.Hi J.J,
enhancement spot
A repository object for the administration of explicitly created enhancement options. Enhancement spots are components of a tree structure hierarchy, of which the branches represent composite enhancement spots and the leaves are simple enhancement spots. Implicitly available enhancement options do not have any enhancement spots.
composite enhancement spot
Semantic combination of simple and other composite enhancement spots with the aim of providing structure.
simple enhancement spot
Reference to a set of enhancement spot element definitions. A simple enhancement spot can occur independently or as a component of a composite enhancement spot.
ENHANCEMENT-POINT
Defines a position in an ABAP program as an enhancement option,
at which one or more source code plug-ins can be inserted.
the syntax will be like
ENHANCEMENT-POINT enh_id SPOTS spot1 spot2 ...
STATIC
INCLUDE BOUND.
Enhancement Options
Definition
Enhancement options are positions in Repository objects where enhancements can be made. These options are either explicitly defined (by the developer) or exist implicitly. Explicit enhancement options are generally defined in a central initial system. Enhancements are made in follow-on systems.
Use
Explicit enhancement options can currently be defined by:
1. Explicitly flagging source code points or sections in ABAP programs. For an enhancement, these can be enhanced or replaced by source code plug-ins.
2. Including Business Add-Ins (BAdIs) in ABAP programs. These programs are then enhanced by object plug-ins with predefined interfaces.
Explicit enhancement options are managed by enhancement spots and enhanced by enhancement implementations.
Currently, implicit enhancement options are:
1. Specific options in ABAP programs such as the end of the program which can be enhanced by source code plug-ins.
2. Parameter interfaces of function modules, which can be enhanced with parameters.
3. Attributes and parameter interfaces of global classes, which can be enhanced with attributes or parameters.
Implicit enhancement options always exist and do not require enhancement spots. They are also enhanced by enhancement implementations.
BAdIs Embedded in the Enhancement Concept
Use
The definition of BAdIs is managed by enhancement spots. A simple enhancement spot for BAdIs can contain several BAdI definitions as enhancement spot element definitions. BAdIs that would otherwise be spread out in the system can be grouped together semantically.
This structuring is mirrored on the implementation side through the enhancement implementations. A BAdI can be implemented by several BAdI implementations that are managed by enhancement implementations. A simple enhancement implementation for object plug-ins can contain several BAdI implementations of an enhancement spot as enhancement implementation elements and can implement a BAdI multiple times. Therefore, several enhancement implementations can be assigned to one enhancement spot.
A BAdI is always assigned to the same package, like the enhancement spot, to which it belongs.
Example
The structuring features of BAdIs in enhancement spots can be of a technical or a subject nature.
If, in the definition of several BAdIs, you have the provision that they are to be used in the same context (this is a feature known only by the person who defines the BAdIs), they must be used by the same simple enhancement spot.
From a subject point of view, all BAdIs must then be grouped together by affiliation to functional units for example, payroll in combined enhancement spots.
Thanks and regards
suma sailaja pvn -
Creation of "New Badi" with Multiple Use
Hi,
I am trying to create New badi within enhancement spot which is multiple use, problem here is the badi interface method has got some exporting parameters.
when i try to activate badi definition it is showing the error this type of interface which is having exporting or returning parameters cannot be used, however if i remove export parameters in the interface method, then i am able to activate the BADI definition.
Please suggest me, is it not possible to have badi interface method with exporting or returning parameters if it is Multiple Use Badi???
Thanks,
Kranthi.Answered my self.
it is the restriction. below is SAP documentations that explains the same
http://help.sap.com/saphelp_nw70/helpdata/en/e4/5c3642eca5033be10000000a1550b0/frameset.htm -
Cant run Native SQL from the New BADI enhancements
I m trying to execute a Native SQL statement from the new BADI enhancement in ECC 6.0. Its very simple piece of code
data: v_count type i.
EXEC SQL.
SELECT zvbeln
INTO :v_count
FROM zvi2d
WHERE zvbeln = :'0000010476'.
ENDEXEC.
It compiles and runs perfectly fine in a regular program but in the BADI it keeps giving compile error "Field specification missing" on the SELECT zvbeln line.
In general things dont seem to work right at all in this BADI I dont understand what the problem is. This BADI is being used to populate the EDI Segments and gets called asynchronously
Thanks for readingwhy would you want to use Native SQL for this, why not just do this:
SELECT zvbeln
INTO v_count
FROM zvi2d
WHERE zvbeln = '0000010476'.
result will be the same. -
ECC 6.0 new BADI,BAPI
Hi,
I am a functional consultant and would like to know the new BAPI,BADI available when my system is upgraded from R/3 4.7V to ECC 6.0Kindly provide me also the functionality achieved by using the new BADI,BAPI in ECC 6.0
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Mar 16, 2011 3:44 PM1070629 FAQs: New general ledger migration
1113189 FAQ: Euro changeover in Slovakia
1539473 LCC optimization - General questions/answers (FAQ) -
Migration of Standard Classic Badi to New Badi
hi,
Is it mandatory to migrate all standard classic badi's to New badi's in ECC6.0. I have read in the documentation only custom BADi's should be migrated.
Can we migrate Standard Classic badi's to New badi's, please provide the procedure for this.
when i am trying to do this in one way it is not allowing me to use the same class as classic badi used, so i have created custom class for this. Is it going to effect.Hi Phanindra,
Calling New badi's is much faster than calling clasic badi's. SAP never recommends to convert all classic Badi's to New Badi's rather you convert your own Badi's to New Badi's. You cant convert SAP classical BADI to New Badi. if you want to convert custom Badi, then please go through this below link
http://help.sap.com/saphelp_nw70/helpdata/EN/0e/4d3e42fc94aa04e10000000a1550b0/content.htm
Thanks,
Bishnu Dash -
Hi All,
I have a requirement where i need to deactivate the standard implementation for the New BADI 'ES_FIN_EBPP_MAIL_PUT_DATA'
and activate my Z-Implementation. I have been able to activate the Z-implementation (i.e. by checking the checkbox Default implementation it allows me to activate the Z-implementation).
Also, the BADI ES_FIN_EBPP_MAIL_PUT_DATA is a single use BADI, so technically multiple implementations should not be possible. bus somehow it has allowed me to activate my Z-Implementation along with the standard implementation being active.
But the problem is although the Z-implementation is active, as the standard implementation is also active, the standard implementation overwrites the Z-implementation, therefore my code is never executed.
Please advise on how to deactivate the standard implementation and implement the Z-Implementation.
Thanks!cl_def_im_address_subscreen is only a sap default class that you can use for creating your own implementation. If you want to see the existing implementations, transaction SE18, enter Classic BAdI ADDRESS_SUBSCREEN and click menu enhancement implementation, overview. Check if the existing implementation corresponds to a custom implementation (then you can modify it), or to a sap or partner product (then you can't modify it, or you can use the enhancement framework to enhance it).
-
Hello,
I need help with implementations for new BADIs. I'm trying to implement BADI PT_ABS_REQ which has about 15 methods. I want my custom logic called for only one of these methods and want SAP standard logic to be called for all other methods. Is this possible? Any help is greatly appreciated.
Thanks
KishoreHi,
Steps:
1. Execute Business Add-In(BADI) transaction SE18
2. Enter BADI name i.e. PT_ABS_REQ and press the display
button
3. Select menu option Implementation->Create
4. Give implementation a name such as Z_PT_ABS_REQ
5. You can now make any changes you require to the BADI within this
implementation, for example choose the Interface tab
6. Double click on the method you want to change, you can now enter
any code you require.
7. Please note to find out what import and export parameters a
method has got return the original BADI definition
(i.e. PT_ABS_REQ) and double click on the method name
for example within PT_ABS_REQ contract is a method
8. When changes have been made activate the implementation
YOu can go through these links...
http://esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
http://esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
http://esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
http://esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
http://esnips.com/doc/365d4c4d-9fcb-4189-85fd-866b7bf25257/customer-exits--badi.zip
http://esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt
<b>Reward points</b>
Regards -
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.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 -
Find new BAdIs (Kernel-based)
Hi experts,
since many options (CL_EXITHANDLER=> GET_INSTANCE; sxv_get_clif_by_name) to retrieve BAdIs are for the classic ones, I was wondering if there is any method to get the new BAdIs (kernel-based) as well.
Thanks in advance.Hi Simobi,
In addition to my reply you can also refer to the following links for any additional information.
How to search for (new) BAdIs?
http://sapignite.com/how-to-find-badi-kernel-badi-or-user-exit-for-a-particular-transaction-code-or-program/
Hope it helps.
Thanks and regards
Preeti Viswanath -
Hi,
Could anyone post solution for making out that a classic BADI is preferred or a new BADI.
This's not an interview question. I just want to make it out for my requirement.
Could anyone post the exact real time differences between a classic BADi and a new BADI.Hi,
Use new BAdI over classical BAdI, as performance of new BAdI is better.
Incase of new BAdI you have to create an Enhancement Spot and create BAdI definition under it, and subsequently implement the BAdI. In the code use
GET BADI badi_name to generate BAdI handle, and
CALL BADI badi_name->method.... to call BAdI methods.
Incase of Classical BAdIs adapter class are created in the runtime of the application program.
Check the following link:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/ee/6f3b42ea85b26be10000000a155106/frameset.htm
Regards,
George
Edited by: George Biswal on May 26, 2009 3:04 PM -
Whats is the diff. btw classic badi and new badi
Hi guy,
I just found out that there is classic and new badi implementation in SE19, I would like to check out with u guys on what is the diff btw the two?
thanks.<b>Differences Between Classic and New BAdIs</b>
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,
Vibha
*Please mark all the helpful answers -
How to search for (new) BAdIs?
Hi,
I found some forum threads, blogs, and wikis in sdn about "How to search for BAdIs".
Here the list I found:
1. SE18 u2013 BADI Definition
2. SE81 u2013 Application Hierarchy
3. SPRO u2013 SAP IMG Reference
4. SE84 u2013 Object Navigator u2013 Repository Information System
5. SPAU_ENH (ECC6.0) u2013 Enhancements -> Simple or Composite (spots, implementations, sections, upgrades)
6. ST05 u2013 SQL Trace -> Buffer Trace
7. SE24 -> CL_EXITHANDLER -> Breakpoint at Method GET_INSTANCE -> Run Transaction -> Exit_name -> BADI name
The fastest ways are ST05 and SE24, I think. Are there such effective ways for the new, kernel based BAdIs? ST05 and CL_EXITHANDLER with debugger donu2019t work.
thanks in adavance,
MichaelHi,
Missed one more method
The below steps should enable you to find any BADI related to any transaction in a matter of minutes.
Go to the transaction SE37 to find your function module.
Locate the function SXV_GET_CLIF_BY_NAME.
Put a breakpoint there.
Now open a new session.
Go to your transaction.
Goto the screen where you want to find any BADI available, it will stop in this function.
Double click on the function field EXIT_NAME.
That will give you name of the BADI that is provided in your transaction.
Again execute and it stop again and fill with new BADI name if any
Repeat the same step and you come to know how many BADI exist
Regards
Bala Krishna -
Hello, gurus!
How i can find where implemented new badi's?
Classic badi's i can find by setting breakpoint on method GET_INSTANCE for CL_EXITHANDLER.
But new badi's i don't use yet.
P.S. Sorry for my bad English.Hello!
For new BADIs you can setup a break point at "GET BADI"
Best Regards -
Issue with New BADI activation
Hi,
I am working with BADI BADI_HRTMC_DR_FIELDS. I need to create a new implementation with filter value 'SAP_BP'. Already a standard implementation HRTMC_IM_DR_FIELDS_BUS_PARTNER exists with same filter value, but I dont want it to get executed. When I tried to activate my new implementation, I get error saying another implementation exists with same filter value. I am not seeing any options for deactivating the standard implementation. Please suggest how I can make my new implementation run instead of the standard.
Thanks,
MaheshDone through IMG settings for this BADI.
Maybe you are looking for
-
Table for Stock Requirement List related information
Dear Sir, We have make-to-order scenario , on receiving the Order from Customer we first create a Sale-Order for the Ordered Item . Subsequently in MD04 , we find a requirement getting reflected for the Customer Order . For example say the Sale-Ord
-
How to upload and download a files into AL11 directory in ABAP
Hi, How to upload and download a files into AL11 directory in ABAP thanks Moderator message: please search for available information/documentation. Edited by: Thomas Zloch on Mar 21, 2011 9:18 AM
-
I am in the early stages of learning DW CS5. I'm learning how to create a new CSS rule/class. But after I've set up my new rule/class in the CSS Panel, I go to the Property Panel to enable the new rule, but it is grayed out. It is inactive. I can't d
-
My iphone is'nt show in itunes
i restore my iphone 4 from itunes and aftre 2 min he give me a errore message and then in screen iphone is to conect iphone with itunes but when i put is doesnt show in itunes
-
E-mail and missing attachments
have a weird one for you. A friend from a neighboring state (who used to be a Mac user) owns an el Cheapo PC. He used to use AOL for his ISP, but he switched to Adelphia. I've been sending him e-mails lately, and he says the ones I send to him with J