<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic badi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496885#M841106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to create custom badi?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Mar 2008 10:25:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-09T10:25:46Z</dc:date>
    <item>
      <title>badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496885#M841106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to create custom badi?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Mar 2008 10:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496885#M841106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-09T10:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496886#M841107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Add-Ins&lt;/P&gt;&lt;P&gt;Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.&lt;/P&gt;&lt;P&gt;As with customer exits (SMOD/CMOD [Page 40]), two different views are available:&lt;/P&gt;&lt;P&gt;&amp;#149; In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.&lt;/P&gt;&lt;P&gt;&amp;#149; In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.&lt;/P&gt;&lt;P&gt;In contrast to customer exits, Business Add-Ins no longer assume a two-system infrastructure (SAP and customers), but instead allow for multiple levels of software development (by SAP, partners, and customers, and as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.&lt;/P&gt;&lt;P&gt;SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.&lt;/P&gt;&lt;P&gt;The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time.&lt;/P&gt;&lt;P&gt;In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example). All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard.&lt;/P&gt;&lt;P&gt;A single Business Add-In contains all of the interfaces necessary to implement a specific task. In Release 4.6A, program and menu enhancements can be made with Business Add-Ins. The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINING THE BADI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) execute Tcode SE18.&lt;/P&gt;&lt;P&gt;2) Specify a definition Name : ZBADI_SPFLI&lt;/P&gt;&lt;P&gt;3) Press create&lt;/P&gt;&lt;P&gt;4) Choose the attribute tab. Specify short desc for badi.. and specify the type : &lt;/P&gt;&lt;P&gt;multiple use.&lt;/P&gt;&lt;P&gt;5) Choose the interface tab&lt;/P&gt;&lt;P&gt;6) Specify interface name: ZIF_EX_BADI_SPFLI and save.&lt;/P&gt;&lt;P&gt;7) Dbl clk on interface name to start class builder . specify a method name (name, &lt;/P&gt;&lt;P&gt;level, desc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method level desc&lt;/P&gt;&lt;P&gt;Linese;ection instance methos some desc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; place the cursor on the method name desc its parameters to define the interface.&lt;/P&gt;&lt;P&gt;Parameter type refe field desc&lt;/P&gt;&lt;P&gt;I_carrid import spfli-carrid some&lt;/P&gt;&lt;P&gt;I_connid import spefi-connid some&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9) save , check and activate&amp;#133;adapter class proposed by system is &lt;/P&gt;&lt;P&gt;ZCL_IM_IM_LINESEL is genereated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPLEMENTATION OF BADI DEFINITION &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.&lt;/P&gt;&lt;P&gt;2) Specify aname for implementation ZIM_LINESEL&lt;/P&gt;&lt;P&gt;3) Specify short desc.&lt;/P&gt;&lt;P&gt;4) Choose interface tab. System proposes a name fo the implementation class. &lt;/P&gt;&lt;P&gt;ZCL_IM_IMLINESEL which is already generarted.&lt;/P&gt;&lt;P&gt;5) Specify short desc for method&lt;/P&gt;&lt;P&gt;6) Dbl clk on method to insert code..(check the code in &amp;#147;AAA&amp;#148;).&lt;/P&gt;&lt;P&gt;7) Save , check and activate the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some useful URL&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt" target="test_blank"&gt;http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf" target="test_blank"&gt;http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc" target="test_blank"&gt;http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc" target="test_blank"&gt;http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf" target="test_blank"&gt;www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now write a sample program to use this badi method..&lt;/P&gt;&lt;P&gt;Look for &amp;#147;BBB&amp;#148; sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#147;AAA&amp;#148;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : wa_flights type sflight,&lt;/P&gt;&lt;P&gt;it_flights type table of sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format color col_heading.&lt;/P&gt;&lt;P&gt;write:/ 'Flight info of:', i_carrid, i_connid.&lt;/P&gt;&lt;P&gt;format color col_normal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from sflight&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_flights&lt;/P&gt;&lt;P&gt;where carrid = i_carrid&lt;/P&gt;&lt;P&gt;and connid = i_connid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_flights into wa_flights.&lt;/P&gt;&lt;P&gt;write:/ wa_flights-fldate,&lt;/P&gt;&lt;P&gt;wa_flights-planetype,&lt;/P&gt;&lt;P&gt;wa_flights-price currency wa_flights-currency,&lt;/P&gt;&lt;P&gt;wa_flights-seatsmax,&lt;/P&gt;&lt;P&gt;wa_flights-seatsocc.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#147;BBB&amp;#148;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report ZBADI_TEST *&lt;/P&gt;&lt;P&gt;*&amp;amp; *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZBADI_TEST .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_spfli type spfli,&lt;/P&gt;&lt;P&gt;it_spfli type table of spfli with key carrid connid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Initialise the object of the interface.&lt;/P&gt;&lt;P&gt;data: exit_ref type ref to ZCL_IM_IM_LINESEL,&lt;/P&gt;&lt;P&gt;exit_ref1 type ref to ZIF_EX_BADISPFLI1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1.&lt;/P&gt;&lt;P&gt;select-options: s_carr for spfli-carrid.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;select * from spfli into corresponding fields of table it_spfli&lt;/P&gt;&lt;P&gt;where carrid in s_carr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;loop at it_spfli into wa_spfli.&lt;/P&gt;&lt;P&gt;write:/ wa_spfli-carrid,&lt;/P&gt;&lt;P&gt;wa_spfli-connid,&lt;/P&gt;&lt;P&gt;wa_spfli-cityfrom,&lt;/P&gt;&lt;P&gt;wa_spfli-deptime,&lt;/P&gt;&lt;P&gt;wa_spfli-arrtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hide: wa_spfli-carrid, wa_spfli-connid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at line-selection.&lt;/P&gt;&lt;P&gt;check not wa_spfli-carrid is initial.&lt;/P&gt;&lt;P&gt;create object exit_ref.&lt;/P&gt;&lt;P&gt;exit_ref1 = exit_ref.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method exit_ref1-&amp;gt;lineselection&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_carrid = wa_spfli-carrid&lt;/P&gt;&lt;P&gt;i_connid = wa_spfli-connid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_spfli. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Z_BADI_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;test call Badi from standard abap. (Only from rel 6.40 and above)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do the following&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1) define the Badi (SE18). For Abap call test uncheck multiple use&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and filter boxes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2) Implement the badi (SE19). Add any methods here in the implemntation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;3) activate&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;4) define the standard class exithandler to the abap. This class is the "Badi caller&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;"&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;5) define an exit variable referring to your Badi Implementation interface&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this interface will normally be something like ZIF_EX***************&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You will see this in SE18/SE19.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;6) Instantiate your instance of the badi (method call get_instance)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;7) Now call any method(s) in the Badi.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class cl_exithandler definition load. "Declaration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data exit type ref to zif_ex__jimbotest. "Interface reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data yes type c.&lt;/P&gt;&lt;P&gt;data: v_knvv type knvv. "Used in Fmod call in Badi methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;yes = ' '.&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1.&lt;/P&gt;&lt;P&gt;parameters: r1 radiobutton group rad1,&lt;/P&gt;&lt;P&gt;r2 radiobutton group rad1,&lt;/P&gt;&lt;P&gt;r3 radiobutton group rad1.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_kunnr type knvv-kunnr.&lt;/P&gt;&lt;P&gt;select single * into v_knvv&lt;/P&gt;&lt;P&gt;from knvv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where kunnr eq p_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;export v_knvv to memory id 'CUST6A'. "Save customer data for the function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_exithandler=&amp;gt;get_instance "Factory method call&lt;/P&gt;&lt;P&gt;exporting "Method&lt;/P&gt;&lt;P&gt;exit_name = 'Z_JIMBOTEST' "Name of your BADI&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;null_instance_accepted = yes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;changing instance = exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not exit is initial.&lt;/P&gt;&lt;P&gt;break-point 1.&lt;/P&gt;&lt;P&gt;if r1 = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method exit-&amp;gt;dispord . "Add-In call&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;changing testparm1 = word.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if r2 = 'X'.&lt;/P&gt;&lt;P&gt;call method exit-&amp;gt;dispfakt.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if r3 = 'X'.&lt;/P&gt;&lt;P&gt;call method exit-&amp;gt;dispmat.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the badi methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;/P&gt;&lt;P&gt;method ZIF_EX__JIMBOTEST~DISPORD.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'Z_DISPLAY_CUST'.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;method ZIF_EX__JIMBOTEST~DISPFAKT.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'Z_DISPLAY_FAKT'.&lt;/P&gt;&lt;P&gt;endmethod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) &lt;/P&gt;&lt;P&gt;method ZIF_EX__JIMBOTEST~DISPMAT.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'Z_DISPLAY_CUST'.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy via SE 41 the status SALV_STANDARD from standard SAP program SALV_DEMO_METADATA into the main program where you've created the 3 function modules below (SAP______TOP) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Global Data for the three function modules I'm calling&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION-POOL Z_BADI_KNVV. "MESSAGE-ID ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include &amp;lt;color&amp;gt;.&lt;/P&gt;&lt;P&gt;include &amp;lt;icon&amp;gt;.&lt;/P&gt;&lt;P&gt;include &amp;lt;symbol&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: zknvv.&lt;/P&gt;&lt;P&gt;data: v_zzkvgr6 TYPE KNVV-ZZKVGR6.&lt;/P&gt;&lt;P&gt;data: choice1 type c.&lt;/P&gt;&lt;P&gt;data: choice2 type c.&lt;/P&gt;&lt;P&gt;data: choice3 type c.&lt;/P&gt;&lt;P&gt;data: choice4 Type c.&lt;/P&gt;&lt;P&gt;data: ok-code(5) type c.&lt;/P&gt;&lt;P&gt;data: answer type string.&lt;/P&gt;&lt;P&gt;data: value1 type SPOP-VARVALUE1.&lt;/P&gt;&lt;P&gt;data: answer1 type string.&lt;/P&gt;&lt;P&gt;tables: vbak, vbap, vakpa, vbrk, vrkpa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lr_functions type ref to cl_salv_functions_list.&lt;/P&gt;&lt;P&gt;constants: gc_true type sap_bool value 'X',&lt;/P&gt;&lt;P&gt;gc_false type sap_bool value space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;add for colour displays&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ls_color type lvc_s_colo.&lt;/P&gt;&lt;P&gt;DATA : LV_SALV_COLUMNS_TABLE TYPE REF TO CL_SALV_COLUMNS_TABLE.&lt;/P&gt;&lt;P&gt;data: lr_columns type ref to cl_salv_columns_table,&lt;/P&gt;&lt;P&gt;lr_column type ref to cl_salv_column_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_table TYPE REF TO cl_salv_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: z_datum type sy-datum.&lt;/P&gt;&lt;P&gt;data: v_knvv type knvv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of s_vbak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vkorg type vakpa-vkorg,&lt;/P&gt;&lt;P&gt;vkgrp type vakpa-vkgrp,&lt;/P&gt;&lt;P&gt;vtweg type vakpa-vtweg,&lt;/P&gt;&lt;P&gt;spart type vakpa-spart,&lt;/P&gt;&lt;P&gt;auart type vakpa-auart,&lt;/P&gt;&lt;P&gt;vbeln type vakpa-vbeln,&lt;/P&gt;&lt;P&gt;bstnk type vakpa-bstnk,&lt;/P&gt;&lt;P&gt;audat type vakpa-audat,&lt;/P&gt;&lt;P&gt;netwr type vbak-netwr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of s_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of s_vbrk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vbeln type vrkpa-vbeln,&lt;/P&gt;&lt;P&gt;vkorg type vrkpa-vkorg,&lt;/P&gt;&lt;P&gt;fkart type vrkpa-fkart,&lt;/P&gt;&lt;P&gt;fkdat type vrkpa-fkdat,&lt;/P&gt;&lt;P&gt;netwr type vbrk-netwr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of s_vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of s_vbap,&lt;/P&gt;&lt;P&gt;matnr type vbap-matnr,&lt;/P&gt;&lt;P&gt;arktx type vbap-arktx,&lt;/P&gt;&lt;P&gt;netwr type vbap-netwr,&lt;/P&gt;&lt;P&gt;kwmeng type vbap-kwmeng,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of s_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_vbap like table of s_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_vbak&lt;/P&gt;&lt;P&gt;like table of s_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_vbrk&lt;/P&gt;&lt;P&gt;like table of s_vbrk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: s_name type tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gr_selections type ref to cl_salv_selections.&lt;/P&gt;&lt;P&gt;data: gr_events type ref to cl_salv_events_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source code of the function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_DISPLAY_CUST.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Lokale interface:&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;s_name = 'S_VBAK'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;orders in last 6 months&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;z_datum = sy-datum - 180.&lt;/P&gt;&lt;P&gt;import v_knvv from memory id 'CUST6A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;vkorg a&lt;/SUB&gt;audat a&lt;SUB&gt;vkgrp a&lt;/SUB&gt;vtweg a&lt;SUB&gt;spart a&lt;/SUB&gt;auart a&lt;SUB&gt;bstnk a&lt;/SUB&gt;vbeln b~netwr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of table t_vbak&lt;/P&gt;&lt;P&gt;up to 100 rows&lt;/P&gt;&lt;P&gt;from ( vakpa as a&lt;/P&gt;&lt;P&gt;inner join vbak as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;vbeln eq b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where a~kunde eq v_knvv-kunnr&lt;/P&gt;&lt;P&gt;and a~parvw eq 'AG'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and a~vkorg eq 'EN01'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and a~trvog eq '0'&lt;/P&gt;&lt;P&gt;and a~audat gt z_datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_vbak by audat descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data: gt_hyperlink type standard table of g_type_s_hyperlink.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Instead of if_salv_c_bool_sap=&amp;gt;false, you can pass the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;value if_salv_c_bool_sap=&amp;gt;true to this method to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;see your ALV as a list.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display data in Grid / List&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_salv_table=&amp;gt;factory&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;list_display = if_salv_c_bool_sap=&amp;gt;false&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;r_salv_table = gr_table&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;t_table = t_vbak.&lt;/P&gt;&lt;P&gt;CATCH cx_salv_msg.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;LV_SALV_COLUMNS_TABLE = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'NETWR' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_color-col = col_negative.&lt;/P&gt;&lt;P&gt;ls_color-int = 0.&lt;/P&gt;&lt;P&gt;ls_color-inv = 0.&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_color( ls_color ).&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'VBELN' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_color-col = col_negative.&lt;/P&gt;&lt;P&gt;ls_color-int = 1.&lt;/P&gt;&lt;P&gt;ls_color-inv = 1.&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_color( ls_color ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LV_SALV_COLUMNS_TABLE = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'NETWR' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_short_text( 'Short' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_medium_text( 'Medium' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_long_text( 'Net Value' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'URL' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_table-&amp;gt;set_screen_status( pfstatus = 'SALV_STANDARD'&lt;/P&gt;&lt;P&gt;report = sy-repid&lt;/P&gt;&lt;P&gt;set_functions = gr_table-&amp;gt;c_functions_all ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this statement actually does the display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gr_table-&amp;gt;display( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_DISPLAY_FAKT.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Lokale interface:&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_name = 'S_VBRK'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;invoices in last 6 months&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;z_datum = sy-datum - 180.&lt;/P&gt;&lt;P&gt;import v_knvv from memory id 'CUST6A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;vbeln a&lt;/SUB&gt;fkart a&lt;SUB&gt;vkorg a&lt;/SUB&gt;fkdat&lt;/P&gt;&lt;P&gt;b~netwr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of table t_vbrk&lt;/P&gt;&lt;P&gt;up to 100 rows&lt;/P&gt;&lt;P&gt;from ( vrkpa as a&lt;/P&gt;&lt;P&gt;inner join vbrk as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;vbeln eq b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where a~kunde eq v_knvv-kunnr&lt;/P&gt;&lt;P&gt;and a~parvw eq 'RG'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and a~vkorg eq 'EN01'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and a~vbtyp eq 'M'&lt;/P&gt;&lt;P&gt;and a~fkdat gt z_datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort t_vbrk by fkdat descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data: gt_hyperlink type standard table of g_type_s_hyperlink.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Instead of if_salv_c_bool_sap=&amp;gt;false, you can pass the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;value if_salv_c_bool_sap=&amp;gt;true to this method to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;see your ALV as a list.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display data in Grid / List&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_salv_table=&amp;gt;factory&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;list_display = if_salv_c_bool_sap=&amp;gt;false&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;r_salv_table = gr_table&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;t_table = t_vbrk.&lt;/P&gt;&lt;P&gt;CATCH cx_salv_msg.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;LV_SALV_COLUMNS_TABLE = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'NETWR' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_color-col = col_negative.&lt;/P&gt;&lt;P&gt;ls_color-int = 0.&lt;/P&gt;&lt;P&gt;ls_color-inv = 0.&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_color( ls_color ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'VBELN' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_color-col = col_negative.&lt;/P&gt;&lt;P&gt;ls_color-int = 1.&lt;/P&gt;&lt;P&gt;ls_color-inv = 1.&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_color( ls_color ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;*LV_SALV_COLUMNS_TABLE = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'NETWR' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_short_text( 'Short' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_medium_text( 'Medium' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_long_text( 'Net Value' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'URL' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_table-&amp;gt;set_screen_status( pfstatus = 'SALV_STANDARD'&lt;/P&gt;&lt;P&gt;report = sy-repid&lt;/P&gt;&lt;P&gt;set_functions = gr_table-&amp;gt;c_functions_all ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this statement actually does the display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gr_table-&amp;gt;display( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_DISPLAY_MATERIAL.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Lokale interface:&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_name = 'S_VBAP'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;invoicesrs in last 6 months&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;z_datum = sy-datum - 180.&lt;/P&gt;&lt;P&gt;import v_knvv from memory id 'CUST6A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;vbeln b&lt;/SUB&gt;matnr b&lt;SUB&gt;arktx b&lt;/SUB&gt;netwr b~kwmeng&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of table t_vbap&lt;/P&gt;&lt;P&gt;up to 100 rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ( vakpa as a&lt;/P&gt;&lt;P&gt;inner join vbap as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;vbeln eq b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where a~kunde eq v_knvv-kunnr&lt;/P&gt;&lt;P&gt;and a~parvw eq 'AG'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and a~vkorg eq 'EN01'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and a~trvog eq '0'&lt;/P&gt;&lt;P&gt;and a~audat gt z_datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;CALL METHOD cl_salv_table=&amp;gt;factory&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;list_display = if_salv_c_bool_sap=&amp;gt;false&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;r_salv_table = gr_table&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;t_table = t_vbap.&lt;/P&gt;&lt;P&gt;CATCH cx_salv_msg.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;LV_SALV_COLUMNS_TABLE = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'NETWR' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_color-col = col_negative.&lt;/P&gt;&lt;P&gt;ls_color-int = 0.&lt;/P&gt;&lt;P&gt;ls_color-inv = 0.&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_color( ls_color ).&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'ARKTX' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_color-col = col_negative.&lt;/P&gt;&lt;P&gt;ls_color-int = 1.&lt;/P&gt;&lt;P&gt;ls_color-inv = 1.&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_color( ls_color ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LV_SALV_COLUMNS_TABLE = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'NETWR' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_short_text( 'Short' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_medium_text( 'Medium' ).&lt;/P&gt;&lt;P&gt;lr_column-&amp;gt;set_long_text( 'Net Value' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*lr_column ?= LV_SALV_COLUMNS_TABLE-&amp;gt;get_column( 'URL' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_table-&amp;gt;set_screen_status( pfstatus = 'SALV_STANDARD'&lt;/P&gt;&lt;P&gt;report = sy-repid&lt;/P&gt;&lt;P&gt;set_functions = gr_table-&amp;gt;c_functions_all ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this statement actually does the display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gr_table-&amp;gt;display( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can find BADI's in different ways...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;gt;First go to any transaction-&amp;gt;iN THE menu bar SYSTEM-&amp;gt;STATUS-&amp;gt;Get the program name -&amp;gt;double click-&amp;gt;u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2&amp;gt;Goto SE24-&amp;gt;Give class name as CL_EXITHANDLER-&amp;gt;Display-&amp;gt;double click on get_instance mathod-&amp;gt;Now u will go inside the method-&amp;gt;Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple ways of searching for BADI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using CL_EXITHANDLER=&amp;gt;GET_INSTANCE&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using SQL Trace (TCODE-ST05).&lt;/P&gt;&lt;P&gt;&amp;#149; Finding BADI Using Repository Information System (TCODE- SE84).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System-&amp;gt;Status. Double click on the program name. Once inside the program search for &amp;#145;CL_EXITHANDLER=&amp;gt;GET_INSTANCE&amp;#146;.&lt;/P&gt;&lt;P&gt;Make sure the radio button &amp;#147;In main program&amp;#148; is checked. A list of all the programs with call to the BADI&amp;#146;s will be listed.&lt;/P&gt;&lt;P&gt;The export parameter &amp;#145;EXIT_NAME&amp;#146; for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter &amp;#145;INSTANCE&amp;#146; will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Start transaction ST05 (Performance Analysis).&lt;/P&gt;&lt;P&gt;Set flag field "Buffer trace" &lt;/P&gt;&lt;P&gt;Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)&lt;/P&gt;&lt;P&gt;Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session. &lt;/P&gt;&lt;P&gt;Push the button "Deactivate Trace".&lt;/P&gt;&lt;P&gt;Push the button "Display Trace".&lt;/P&gt;&lt;P&gt;The popup screen "Set Restrictions for Displaying Trace" appears.&lt;/P&gt;&lt;P&gt;Now, filter the trace on Objects: &lt;/P&gt;&lt;P&gt;&amp;#149; V_EXT_IMP &lt;/P&gt;&lt;P&gt;&amp;#149; V_EXT_ACT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Push button "Multiple selections" button behind field Objects &lt;/P&gt;&lt;P&gt;Fill: V_EXT_IMP and V_EXT_ACT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.&lt;/P&gt;&lt;P&gt;So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Go to &amp;#147;Maintain Transaction&amp;#148; (TCODE- SE93).&lt;/P&gt;&lt;P&gt;Enter the Transaction VD02 for which you want to find BADI.&lt;/P&gt;&lt;P&gt;Click on the Display push buttons.&lt;/P&gt;&lt;P&gt;Get the Package Name. (Package VS in this case)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to TCode: SE84-&amp;gt;Enhancements-&amp;gt;Business Add-inns-&amp;gt;Definition&lt;/P&gt;&lt;P&gt;Enter the Package Name and Execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you get a list of all the Enhancement BADI&amp;#146;s for the given package MB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The simplese way for finding BADI is &lt;/P&gt;&lt;P&gt;1. chooes Tcode Program &amp;amp; package for that Tcode.&lt;/P&gt;&lt;P&gt;2. Go to Tcode se18&lt;/P&gt;&lt;P&gt;3. Press F4&lt;/P&gt;&lt;P&gt;4. search by package or by program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 04:02:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496886#M841107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T04:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496887#M841108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create BADI Steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to SE18. Enter the definition name. Click on Create.&lt;/P&gt;&lt;P&gt;In attributes, Enter short description for BADI and click on checkbox Multiple Use.&lt;/P&gt;&lt;P&gt;Go to Interface tab. Double-click on Interface name which will take you to class builder screen.&lt;/P&gt;&lt;P&gt;Enter Name of Method, Level and Description.&lt;/P&gt;&lt;P&gt;Define Parameters for the method.&lt;/P&gt;&lt;P&gt;Save, Check and Activate. Adapter class proposed by system, ZCL_IM_IM_LINESEL, is generated.&lt;/P&gt;&lt;P&gt;Go to SE18. Enter the Definition name. Go to Implementation -&amp;gt; Create.&lt;/P&gt;&lt;P&gt;Enter Implementation Name.&lt;/P&gt;&lt;P&gt;Enter Implementation short text.&lt;/P&gt;&lt;P&gt;In Interface tab, Double click on Method Name to insert implementation code.&lt;/P&gt;&lt;P&gt;Enter code between Method and Endmethod statements. &lt;/P&gt;&lt;P&gt;Check and Activate.&lt;/P&gt;&lt;P&gt;Go to SE38. Create report to use created BADI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create badi-&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implementing Business Add-Ins (BADI) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of object orientated code within SAP has lead to new method of enhancing standard SAP code called &lt;/P&gt;&lt;P&gt;Business Add-Ins or BADI's for short. Although the implementation concept is based on classes, methods and &lt;/P&gt;&lt;P&gt;inheritance you do not really have to understand this fully to implement a BADI. Simply think of methods &lt;/P&gt;&lt;P&gt;as a function module with the same import and export parameters and follow the simple instructions below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps:&lt;/P&gt;&lt;P&gt;1. Execute Business Add-In(BADI) transaction SE18&lt;/P&gt;&lt;P&gt;2. Enter BADI name i.e. HRPBSGB_HESA_NISR and press the display &lt;/P&gt;&lt;P&gt;button &lt;/P&gt;&lt;P&gt;3. Select menu option Implementation-&amp;gt;Create&lt;/P&gt;&lt;P&gt;4. Give implementation a name such as Z_HRPBSGB_HESA_NISR&lt;/P&gt;&lt;P&gt;5. You can now make any changes you require to the BADI within this &lt;/P&gt;&lt;P&gt;implementation, for example choose the Interface tab&lt;/P&gt;&lt;P&gt;6. Double click on the method you want to change, you can now enter &lt;/P&gt;&lt;P&gt;any code you require.&lt;/P&gt;&lt;P&gt;7. Please note to find out what import and export parameters a &lt;/P&gt;&lt;P&gt;method has got return the original BADI definition &lt;/P&gt;&lt;P&gt;(i.e. HRPBSGB_HESA_NISR) and double click on the method name &lt;/P&gt;&lt;P&gt;for example within HRPBSGB_HESA_NISR contract is a method&lt;/P&gt;&lt;P&gt;8. When changes have been made activate the implementation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/enhancements" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/enhancements&lt;/A&gt;&lt;EM&gt;and&lt;/EM&gt;Modifications&lt;EM&gt;-&lt;/EM&gt;BADI,&lt;EM&gt;Enhancement&lt;/EM&gt;Framework,&lt;EM&gt;User&lt;/EM&gt;Exits&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through this above link also.&lt;/P&gt;&lt;P&gt;these r excellent websites which give a step-by-step solution along with screen shots which solves u'r problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How To Define a New BAdI Within the Enhancement Framework (Some Basics About the BAdI,BAdI Commands in ABAP,&lt;/P&gt;&lt;P&gt;When to Use a BAdI?)&lt;/P&gt;&lt;P&gt;/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to implement a BAdI And How to Use a Filter &lt;/P&gt;&lt;P&gt;/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Introducing Business Add-Ins&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f3202186-0601-0010-6591-b832b1a0d0de" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f3202186-0601-0010-6591-b832b1a0d0de&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to implement BAdi in Enhancement Framework&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Add-Ins &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/ee/a1d548892b11d295d60000e82de14a/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/ee/a1d548892b11d295d60000e82de14a/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAdI: Customer-Defined Functions in the Formula Builder &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference Between BADI and User Exits &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Use BADI - Business Add In you need to Understand ABAP OO Interface Concept &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm" target="test_blank"&gt;http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapmaterial.com/badi.html" target="test_blank"&gt;http://www.sapmaterial.com/badi.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap.com/ecosystem/partners/partnerwithsap/icc/scenarios/pdf/ICC_INTEGRATION_GUIDE_22.pdf" target="test_blank"&gt;http://www.sap.com/ecosystem/partners/partnerwithsap/icc/scenarios/pdf/ICC_INTEGRATION_GUIDE_22.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some useful URL&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt" target="test_blank"&gt;http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf" target="test_blank"&gt;http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc" target="test_blank"&gt;http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc" target="test_blank"&gt;http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf" target="test_blank"&gt;www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 05:08:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496887#M841108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T05:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496888#M841109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creation of Custom BAdi:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAdi Definition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choose Tools -&amp;gt;ABAP Workbench -&amp;gt; Utilities -&amp;gt; Business Add-Ins (transaction SE18) from the SAP menu&lt;/P&gt;&lt;P&gt;Create a new Business Add-In containing a maximum of 20 characters and move to Interface Tab&lt;/P&gt;&lt;P&gt;Name of the interface is proposed by the system but may be changed &lt;/P&gt;&lt;P&gt;Save and double-click on the interface name to add a method&lt;/P&gt;&lt;P&gt;System branches to the Class Builder&lt;/P&gt;&lt;P&gt;Assign a method to the interface (default is Instance Method)&lt;/P&gt;&lt;P&gt;Add a parameter&lt;/P&gt;&lt;P&gt;Save and Activate&lt;/P&gt;&lt;P&gt;Definition screen(SE18) will now contain the method assigned to the interface&lt;/P&gt;&lt;P&gt;Documentation may be created to describe the intended functionality of this Add-Ins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAdi Implimentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Workbench -&amp;gt;Utilities -&amp;gt; Business Add-Ins (transaction SE19) &lt;/P&gt;&lt;P&gt;Find the suitable Business Add-Ins present in system (Use IMG or Component hierarchy)&lt;/P&gt;&lt;P&gt;Use Add-Ins Documentation to understand functionality &amp;amp; to decide&lt;/P&gt;&lt;P&gt;Implement the Add-Ins &lt;/P&gt;&lt;P&gt;a class is created with the same interface &lt;/P&gt;&lt;P&gt;Finalize coding for the method&lt;/P&gt;&lt;P&gt;Implementations are discrete transport objects and lie within the namespace of the person or organization implementing them&lt;/P&gt;&lt;P&gt;Work on Simple Badi project &amp;#150; Continued&amp;#133;&lt;/P&gt;&lt;P&gt;Already structure of the interface defined &lt;/P&gt;&lt;P&gt;In order to create an implementation for the text conversion example, the add-in (in this case, the interface's method) needs to be filled with logic that converts the string. This logic will be run through every time the add-in is called from the application program&lt;/P&gt;&lt;P&gt;Choose ABAP Workbench -&amp;gt;Utilities -&amp;gt; Business Add-Ins (transaction SE19) &lt;/P&gt;&lt;P&gt;Create a new implementation and select the appropriate definition in the dialog box&lt;/P&gt;&lt;P&gt;Add a short text and move to Interface tab&lt;/P&gt;&lt;P&gt;Save&lt;/P&gt;&lt;P&gt;Double-click the method name when the system will take you to the code window for the method&lt;/P&gt;&lt;P&gt;Insert the desired source code for the implementation between the method if_ex_businessaddin~method. and endmethod. statements automatically provided to you by the system. &lt;/P&gt;&lt;P&gt;Save and return to the Change Implementation screen&lt;/P&gt;&lt;P&gt;On Activation, this implementation may be executed from the application program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if_ex_businessaddin~method.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  TRANSLATE parameter TO UPPER CASE.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;Endmethod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling Add-In from Program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code to call Add-In from ABAP Program&lt;/P&gt;&lt;P&gt;To call static method of a global class directly, class &amp;#133; definition load statement is needed&lt;/P&gt;&lt;P&gt;Instance of the Adapter class is created and its method is executed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report businessaddin.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;class cl_exithandler definition load.          &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;interface reference&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data exit type ref to if_ex_businessaddin. &lt;/P&gt;&lt;P&gt;data word(15) type c value 'Business Add-in'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;factory method call&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_exithandler=&amp;gt;get_instance&lt;/P&gt;&lt;P&gt;           changing instance = exit.               &lt;/P&gt;&lt;P&gt;  write:/'Please click here'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at line-selection.&lt;/P&gt;&lt;P&gt;  write:/ 'Original word: ',word.&lt;/P&gt;&lt;P&gt;  call method exit-&amp;gt;method    "add-in call&lt;/P&gt;&lt;P&gt;           changing parameter = word.&lt;/P&gt;&lt;P&gt;  write:/ 'Changed word: ',word.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 06:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496888#M841109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T06:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496889#M841110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi          &lt;STRONG&gt;Balu&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;these r excellent websites which give a step-by-step solution along with screen shots which solves u'r problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How To Define a New BAdI Within the Enhancement Framework (Some Basics About the BAdI,BAdI Commands in ABAP,&lt;/P&gt;&lt;P&gt;When to Use a BAdI?)&lt;/P&gt;&lt;P&gt;/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to implement a BAdI And How to Use a Filter &lt;/P&gt;&lt;P&gt;/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Introducing Business Add-Ins&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f3202186-0601-0010-6591-b832b1a0d0de" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f3202186-0601-0010-6591-b832b1a0d0de&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to implement BAdi in Enhancement Framework&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Add-Ins &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/ee/a1d548892b11d295d60000e82de14a/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/ee/a1d548892b11d295d60000e82de14a/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAdI: Customer-Defined Functions in the Formula Builder &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference Between BADI and User Exits &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Use BADI - Business Add In you need to Understand ABAP OO Interface Concept &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm" target="test_blank"&gt;http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If Found helpfull.&lt;/P&gt;&lt;P&gt;cheers!&lt;/P&gt;&lt;P&gt;Eshwar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 07:17:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badi/m-p/3496889#M841110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T07:17:37Z</dc:date>
    </item>
  </channel>
</rss>

