<?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 Re: badis in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306450#M791848</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 the example.&lt;/P&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;P&gt;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Feb 2008 04:25:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-04T04:25:13Z</dc:date>
    <item>
      <title>badis</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306447#M791845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello folks,&lt;/P&gt;&lt;P&gt;i have update a ztable of vendor invoice by using the badis so that the transactions miro mrrl should be triggered.just provide some example code . i am new to badis.&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;&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;Thanks&amp;amp;Regards.&lt;/P&gt;&lt;P&gt;suresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2008 12:50:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306447#M791845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-02T12:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: badis</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306448#M791846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;can u explain ur requirement.so that i can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Feb 2008 15:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306448#M791846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-02T15:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: badis</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306449#M791847</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 the example.&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;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 04:23:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306449#M791847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T04:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: badis</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306450#M791848</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 the example.&lt;/P&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;P&gt;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 04:25:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306450#M791848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T04:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: badis</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306451#M791849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the BADIs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MB_DOCUMENT_BADI&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MB_MIGO_BADI&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward poins if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 04:46:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/badis/m-p/3306451#M791849</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T04:46:34Z</dc:date>
    </item>
  </channel>
</rss>

