<?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: Function Modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872559#M673992</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;I have given differnet types to find out FM's .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go to se80&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go to Enviromment -&amp;gt; Repository Info System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expand Program Library Folder -&amp;gt; Function MOdules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Double click on Function Modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in Function MOdule Field put * and then execute.list of all function modules will appear. No of fiunction modules which appear on screen can be changed can be changed by changigng number of hits, by default it is 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Go to System -&amp;gt; List -&amp;gt; Save and save to local file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can go to t/code BAPI to browse all BAPI available by modules or alphabetical orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can check this links for list function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/functions.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/functions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/fmodules/fmssap.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/fmodules/fmssap.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;Table Name : TFDIR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filed Name : FUNCNAME&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;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  ZDEMO_ALVGRID                                               *&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;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp; Example of a simple ALV Grid Report                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp; ...................................                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp; The basic requirement for this demo is to display a number of       *&lt;/P&gt;&lt;P&gt;*&amp;amp; fields from the TFDIR table.                                         *&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  zdemo_alvgrid                 .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TABLES:     TFDIR.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;type-pools: slis.                                 "ALV Declarations&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;TYPES: BEGIN OF t_TFDIR .&lt;/P&gt;&lt;P&gt; include  structure   TFDIR .&lt;/P&gt;&lt;P&gt;types  : END OF t_TFDIR.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: it_TFDIR TYPE STANDARD TABLE OF t_TFDIR INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_TFDIR TYPE t_TFDIR.&lt;/P&gt;&lt;P&gt;select-options  :  s_FUN  for TFDIR-FUNCNAME.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*ALV data declarations&lt;/P&gt;&lt;P&gt;data: fieldcatalog type slis_t_fieldcat_alv with header line,&lt;/P&gt;&lt;P&gt;      gd_tab_group type slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;      gd_layout    type slis_layout_alv,&lt;/P&gt;&lt;P&gt;      gd_repid     like sy-repid.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*Start-of-selection.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;perform data_retrieval.&lt;/P&gt;&lt;P&gt;perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;*perform build_layout.&lt;/P&gt;&lt;P&gt;perform display_alv_report.&lt;/P&gt;&lt;P&gt; &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;      Form  BUILD_FIELDCATALOG&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build Fieldcatalog for ALV Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'FUNCNAME'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Purchase Order'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 0.&lt;/P&gt;&lt;P&gt;  fieldcatalog-outputlen   = 10.&lt;/P&gt;&lt;P&gt;  fieldcatalog-emphasize   = 'X'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-do_sum      = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-no_zero     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'PNAME'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'PO Item'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 1.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'INCLUDE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Status'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 2.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'FREEDATE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Item change date'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 3.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'APPL'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Material Number'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 4.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'MAND'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'PO quantity'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 5.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'FMODE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Order Unit'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 6.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'HOST'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Net Price'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 7.&lt;/P&gt;&lt;P&gt;  fieldcatalog-outputlen   = 15.&lt;/P&gt;&lt;P&gt;  fieldcatalog-do_sum      = 'X'.        "Display column total&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'UTASK'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Price Unit'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 8.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt; &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;      Form  BUILD_LAYOUT&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build layout for ALV grid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&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;      Form  DISPLAY_ALV_REPORT&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display report using ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display_alv_report.&lt;/P&gt;&lt;P&gt;  gd_repid = sy-repid.&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_callback_program      = gd_repid&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_grid_title           = outtext&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            is_layout               = gd_layout&lt;/P&gt;&lt;P&gt;            it_fieldcat             = fieldcatalog[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_special_groups       = gd_tabgroup&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           IT_EVENTS                = GT_XEVENTS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            i_save                  = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           is_variant              = z_template&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab                = it_TFDIR&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            program_error           = 1&lt;/P&gt;&lt;P&gt;            others                  = 2.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt; &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;      Form  DATA_RETRIEVAL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Retrieve data form EKPO table and populate itab it_TFDIR&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form data_retrieval.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;  from  TFDIR&lt;/P&gt;&lt;P&gt;  into table it_TFDIR  where  FUNCNAME  in s_FUN.&lt;/P&gt;&lt;P&gt;endform.                    " DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2007 14:20:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-19T14:20:43Z</dc:date>
    <item>
      <title>Function Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872557#M673990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone, &lt;/P&gt;&lt;P&gt;I have a curiosity. Is there a way we can get a list for all the existing function modules in a system? Please advise. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 14:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872557#M673990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T14:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872558#M673991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the tables &amp;lt;b&amp;gt;TFDIR&amp;lt;/b&amp;gt;  &amp;lt;b&amp;gt;TFTIT&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 14:20:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872558#M673991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T14:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872559#M673992</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;I have given differnet types to find out FM's .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go to se80&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go to Enviromment -&amp;gt; Repository Info System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expand Program Library Folder -&amp;gt; Function MOdules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Double click on Function Modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in Function MOdule Field put * and then execute.list of all function modules will appear. No of fiunction modules which appear on screen can be changed can be changed by changigng number of hits, by default it is 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Go to System -&amp;gt; List -&amp;gt; Save and save to local file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can go to t/code BAPI to browse all BAPI available by modules or alphabetical orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can check this links for list function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/functions.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/functions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/fmodules/fmssap.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/fmodules/fmssap.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;Table Name : TFDIR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filed Name : FUNCNAME&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;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  ZDEMO_ALVGRID                                               *&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;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp; Example of a simple ALV Grid Report                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp; ...................................                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp; The basic requirement for this demo is to display a number of       *&lt;/P&gt;&lt;P&gt;*&amp;amp; fields from the TFDIR table.                                         *&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  zdemo_alvgrid                 .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TABLES:     TFDIR.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;type-pools: slis.                                 "ALV Declarations&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;TYPES: BEGIN OF t_TFDIR .&lt;/P&gt;&lt;P&gt; include  structure   TFDIR .&lt;/P&gt;&lt;P&gt;types  : END OF t_TFDIR.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: it_TFDIR TYPE STANDARD TABLE OF t_TFDIR INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_TFDIR TYPE t_TFDIR.&lt;/P&gt;&lt;P&gt;select-options  :  s_FUN  for TFDIR-FUNCNAME.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*ALV data declarations&lt;/P&gt;&lt;P&gt;data: fieldcatalog type slis_t_fieldcat_alv with header line,&lt;/P&gt;&lt;P&gt;      gd_tab_group type slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;      gd_layout    type slis_layout_alv,&lt;/P&gt;&lt;P&gt;      gd_repid     like sy-repid.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*Start-of-selection.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;perform data_retrieval.&lt;/P&gt;&lt;P&gt;perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;*perform build_layout.&lt;/P&gt;&lt;P&gt;perform display_alv_report.&lt;/P&gt;&lt;P&gt; &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;      Form  BUILD_FIELDCATALOG&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build Fieldcatalog for ALV Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'FUNCNAME'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Purchase Order'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 0.&lt;/P&gt;&lt;P&gt;  fieldcatalog-outputlen   = 10.&lt;/P&gt;&lt;P&gt;  fieldcatalog-emphasize   = 'X'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-do_sum      = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-no_zero     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'PNAME'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'PO Item'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 1.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'INCLUDE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Status'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 2.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'FREEDATE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Item change date'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 3.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'APPL'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Material Number'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 4.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'MAND'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'PO quantity'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 5.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'FMODE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Order Unit'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 6.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'HOST'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Net Price'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 7.&lt;/P&gt;&lt;P&gt;  fieldcatalog-outputlen   = 15.&lt;/P&gt;&lt;P&gt;  fieldcatalog-do_sum      = 'X'.        "Display column total&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'UTASK'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Price Unit'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 8.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt; &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;      Form  BUILD_LAYOUT&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build layout for ALV grid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&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;      Form  DISPLAY_ALV_REPORT&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display report using ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display_alv_report.&lt;/P&gt;&lt;P&gt;  gd_repid = sy-repid.&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_callback_program      = gd_repid&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_grid_title           = outtext&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            is_layout               = gd_layout&lt;/P&gt;&lt;P&gt;            it_fieldcat             = fieldcatalog[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_special_groups       = gd_tabgroup&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           IT_EVENTS                = GT_XEVENTS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            i_save                  = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           is_variant              = z_template&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab                = it_TFDIR&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            program_error           = 1&lt;/P&gt;&lt;P&gt;            others                  = 2.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt; &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;      Form  DATA_RETRIEVAL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Retrieve data form EKPO table and populate itab it_TFDIR&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form data_retrieval.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;  from  TFDIR&lt;/P&gt;&lt;P&gt;  into table it_TFDIR  where  FUNCNAME  in s_FUN.&lt;/P&gt;&lt;P&gt;endform.                    " DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 14:20:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules/m-p/2872559#M673992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T14:20:43Z</dc:date>
    </item>
  </channel>
</rss>

