<?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: ALV First Program! Help Reqd in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887434#M52749</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;In PBO it's enough to write the following line for your previous code. &lt;/P&gt;&lt;P&gt;Module PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your problem is solved,close this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jayanthi Jayaraman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jun 2005 08:04:23 GMT</pubDate>
    <dc:creator>jayanthi_jayaraman</dc:creator>
    <dc:date>2005-06-08T08:04:23Z</dc:date>
    <item>
      <title>ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887426#M52741</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;This is sachin, New in ABAP and thus writing on this forum for some help/guidence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to generate a ALV. Fetch some data from MARA and display it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is syntactically correct and program runs. Not a dump but no data is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code goes as follows. Seems like a minor mistake but I am not getting a way out of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===============CODE==========================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;                                                 *&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;&amp;amp; EG using customer control   field *catalog                           *&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;REPORT  Zsach_ALV3                               .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Global data definitions for ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- ALV Grid instance reference&lt;/P&gt;&lt;P&gt;DATA GRID1 TYPE REF TO cl_gui_alv_grid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Name of the custom control added on the screen&lt;/P&gt;&lt;P&gt;DATA G_CONTROL TYPE scrfname VALUE 'B1' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Custom container instance reference&lt;/P&gt;&lt;P&gt;DATA G_CUSTOM_CONTAINER TYPE REF TO cl_gui_custom_container .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Field catalog table&lt;/P&gt;&lt;P&gt;DATA gt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Layout structure&lt;/P&gt;&lt;P&gt;DATA gs_layout TYPE lvc_s_layo .&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*--- Internal table holding list data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF gt_MARA OCCURS 0 ,&lt;/P&gt;&lt;P&gt;MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;MBRSH LIKE MARA-MBRSH,&lt;/P&gt;&lt;P&gt;MTART LIKE MARA-MTART,&lt;/P&gt;&lt;P&gt;END OF gt_MARA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT MATNR MBRSH MTART up to 10 rows FROM MARA into TABLE GT_MARA.&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 SCREEN 0100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      MODULE PBO *OUTPUT                                             *&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;HR originaltext="--------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;MODULE PBO OUTPUT.&lt;/P&gt;&lt;P&gt;*MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  IF G_CUSTOM_CONTAINER IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   OBJECT TO REPRESENT CONTAINER I.E CUSTOMER CONTROL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT G_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;           EXPORTING CONTAINER_NAME = G_CONTROL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   OBJECT FOR GRID TO BE PLACED IN CONTAINER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CREATE OBJECT GRID1&lt;/P&gt;&lt;P&gt;           EXPORTING I_PARENT = G_CUSTOM_CONTAINER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Preparing field catalog.&lt;/P&gt;&lt;P&gt;PERFORM prepare_field_catalog CHANGING gt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Preparing layout structure&lt;/P&gt;&lt;P&gt;PERFORM prepare_layout CHANGING gs_layout .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD GRID1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;is_layout = gs_layout&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = gt_MARA[]&lt;/P&gt;&lt;P&gt;it_fieldcatalog = gt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD grid1-&amp;gt;refresh_table_display .&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;DATA : LS_FCAT  type lvc_s_fcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'MATNR' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '18' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'MATERIAL NO' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'MATNR#' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR LS_FCAT.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'MBRSH' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '10' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'MBRSH' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'MBRSH ' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR LS_FCAT.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'MTART' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '10' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'MTART' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'MTART' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.&lt;/P&gt;&lt;P&gt;ps_layout-zebra = 'X' .&lt;/P&gt;&lt;P&gt;ps_layout-grid_title = 'MATERIALS' .&lt;/P&gt;&lt;P&gt;ps_layout-smalltitle = 'X' .&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 06:37:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887426#M52741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T06:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887427#M52742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In ur code Pls call ALV function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this sample program&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvlist_code.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvlist_code.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 06:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887427#M52742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T06:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887428#M52743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Module PBO output is not called from the screen and therefore nothng is displayed.&lt;/P&gt;&lt;P&gt;Replace the following code:&lt;/P&gt;&lt;P&gt;MODULE PBO OUTPUT.&lt;/P&gt;&lt;P&gt;*MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;TO&lt;/P&gt;&lt;P&gt;*MODULE PBO OUTPUT.&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;Then it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 06:53:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887428#M52743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T06:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887429#M52744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In PBO&lt;/P&gt;&lt;P&gt;MODULE   status_9001 OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF G_CUSTOM_CONTAINER IS INITIAL&lt;/P&gt;&lt;P&gt;    SET PF-STATUS 'ZSTATUS'.&lt;/P&gt;&lt;P&gt;    SET TITLEBAR 'ZTITLE'.&lt;/P&gt;&lt;P&gt;Double click on the zstatus and create three option BACK, EXIT and CANC.&lt;/P&gt;&lt;P&gt;IF G_CUSTOM_CONTAINER IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT TO REPRESENT CONTAINER I.E CUSTOMER CONTROL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT G_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;EXPORTING CONTAINER_NAME = G_CONTROL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT FOR GRID TO BE PLACED IN CONTAINER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT GRID1&lt;/P&gt;&lt;P&gt;EXPORTING I_PARENT = G_CUSTOM_CONTAINER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;In PAI add these codes to set pf-status&lt;/P&gt;&lt;P&gt;  DATA: i_return_code TYPE i .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;dispatch&lt;/P&gt;&lt;P&gt;      IMPORTING return_code = i_return_code.&lt;/P&gt;&lt;P&gt;  save_ok = ok_code.&lt;/P&gt;&lt;P&gt;  CASE save_ok.&lt;/P&gt;&lt;P&gt;    WHEN 'BACK' OR 'END' OR 'CANC'.&lt;/P&gt;&lt;P&gt;      PERFORM exit_program.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;  CLEAR save_ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&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  EXIT_PROGRAM&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;      text&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 exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD G_CUSTOM_CONTAINER -&amp;gt;free.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Error in FLush&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;  LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;ENDFORM.                  " EXIT_PROGRAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have refreshed the grid in PBO itself.&lt;/P&gt;&lt;P&gt;Do seperately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Include this too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Judith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 06:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887429#M52744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T06:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887430#M52745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you already created the screen 100 and placed custom container in screen 100&lt;/P&gt;&lt;P&gt;with name 'B1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem may be in flow logic of screen 100 you need to include the follwoing piece of code in PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Module PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;If not,get back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 06:56:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887430#M52745</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-06-08T06:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887431#M52746</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 checked and got the output too for ur program&lt;/P&gt;&lt;P&gt;see the changes made&lt;/P&gt;&lt;P&gt;REPORT zzztest_1 .&lt;/P&gt;&lt;P&gt;Tables: mara.&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt; *&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;&amp;amp; EG using&lt;P&gt;&lt;/P&gt;&lt;P&gt;*customer control field *catalog *&lt;/P&gt;&lt;P&gt;*&amp;amp; *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;*-- Global data definitions for ALV&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;CLASS cl_gui_cfw DEFINITION LOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- ALV Grid instance reference&lt;/P&gt;&lt;P&gt;DATA GRID1 TYPE REF TO cl_gui_alv_grid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Name of the custom control added on the screen&lt;/P&gt;&lt;P&gt;DATA G_CONTROL TYPE scrfname VALUE 'B1' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Custom container instance reference&lt;/P&gt;&lt;P&gt;DATA G_CUSTOM_CONTAINER TYPE REF TO cl_gui_custom_container .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Field catalog table&lt;/P&gt;&lt;P&gt;DATA gt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--- Layout structure&lt;/P&gt;&lt;P&gt;DATA gs_layout TYPE lvc_s_layo .&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;DATA: save_ok TYPE sy-ucomm,&lt;/P&gt;&lt;P&gt;      ok_code TYPE sy-ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ok_code = sy-ucomm.&lt;/P&gt;&lt;P&gt;*--- Internal table holding list data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF gt_MARA OCCURS 0 ,&lt;/P&gt;&lt;P&gt;MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;MBRSH LIKE MARA-MBRSH,&lt;/P&gt;&lt;P&gt;MTART LIKE MARA-MTART,&lt;/P&gt;&lt;P&gt;END OF gt_MARA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT MATNR MBRSH MTART up to 10 rows FROM MARA into TABLE GT_MARA.&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 SCREEN 0100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CALL METHOD grid1-&amp;gt;refresh_table_display .&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;DATA : LS_FCAT type lvc_s_fcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'MATNR' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '18' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'MATERIAL NO' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'MATNR#' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR LS_FCAT.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'MBRSH' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '10' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'MBRSH' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'MBRSH ' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR LS_FCAT.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'MTART' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '10' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'MTART' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'MTART' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.&lt;/P&gt;&lt;P&gt;ps_layout-zebra = 'X' .&lt;/P&gt;&lt;P&gt;ps_layout-grid_title = 'MATERIALS' .&lt;/P&gt;&lt;P&gt;ps_layout-smalltitle = 'X' .&lt;/P&gt;&lt;P&gt;ENDFORM.&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;      Module  STATUS_0100  OUTPUT&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;      text&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;module STATUS_0100 output.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MODULE PBO *OUTPUT *&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;HR originaltext="--------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF G_CUSTOM_CONTAINER IS INITIAL.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'ZSTATUS'.&lt;/P&gt;&lt;P&gt;SET TITLEBAR 'ZTITLE'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT TO REPRESENT CONTAINER I.E CUSTOMER CONTROL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT G_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;EXPORTING CONTAINER_NAME = G_CONTROL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OBJECT FOR GRID TO BE PLACED IN CONTAINER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CREATE OBJECT GRID1&lt;/P&gt;&lt;P&gt;EXPORTING I_PARENT = G_CUSTOM_CONTAINER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Preparing field catalog.&lt;/P&gt;&lt;P&gt;PERFORM prepare_field_catalog CHANGING gt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Preparing layout structure&lt;/P&gt;&lt;P&gt;PERFORM prepare_layout CHANGING gs_layout .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD GRID1-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;is_layout = gs_layout&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = gt_MARA[]&lt;/P&gt;&lt;P&gt;it_fieldcatalog = gt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endmodule.                 " STATUS_0100  OUTPUT&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;      Module  USER_COMMAND_0100  INPUT&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;      text&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;module USER_COMMAND_0100 input.&lt;/P&gt;&lt;P&gt;DATA: i_return_code TYPE i .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_cfw=&amp;gt;dispatch&lt;/P&gt;&lt;P&gt;IMPORTING return_code = i_return_code.&lt;/P&gt;&lt;P&gt;save_ok = ok_code.&lt;/P&gt;&lt;P&gt;CASE save_ok.&lt;/P&gt;&lt;P&gt;WHEN 'BACK' OR 'END' OR 'CANC'.&lt;/P&gt;&lt;P&gt;PERFORM exit_program.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;CLEAR save_ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmodule.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;************************************&lt;/P&gt;&lt;P&gt;FORM exit_program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD G_CUSTOM_CONTAINER-&amp;gt;free.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Error in FLush&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;LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;ENDFORM. " EXIT_PROGRAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Judith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 07:12:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887431#M52746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T07:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887432#M52747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;          When creating an ALV it is very important to understand the flow of data and the communication parameters between your module pool program and the screen.There is nothing wrong with your code.In the PBO event of the screen the ALV grid display has to be called otherwise you will be displayed with a blank screen on executing the program.Call the PBO module present in your program at the screen level and the ALV will display properly with the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 07:18:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887432#M52747</guid>
      <dc:creator>nishanthbhandar</dc:creator>
      <dc:date>2005-06-08T07:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887433#M52748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everybody! Thanks a lot for such a prompt reply from everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now further to the discussion, I have called the following functions from PBO of screen 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM prepare_field_catalog CHANGING gt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM prepare_layout CHANGING gs_layout .&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;In form display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have called reuse_alv_grid_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I check for syst errors, I am getting importing is expected and not exporting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change to importing, I get exporting is expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code :: &lt;/P&gt;&lt;P&gt;=======================================&lt;/P&gt;&lt;P&gt;form display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    T_OUTTAB                          = gt_MARA&lt;/P&gt;&lt;P&gt;          .&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;==============================&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 07:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887433#M52748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T07:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887434#M52749</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;In PBO it's enough to write the following line for your previous code. &lt;/P&gt;&lt;P&gt;Module PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your problem is solved,close this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jayanthi Jayaraman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 08:04:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887434#M52749</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-06-08T08:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887435#M52750</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;Try copy and paste the whole code i replied.&lt;/P&gt;&lt;P&gt;Goto screen 100 and in the flowlogic uncomment the modules and try executing the program, u will get the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: If any one the above replies solved or helpful then reward points and close the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Please Close the thread if ur problem got solved.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Judith Jessie Selvi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 08:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887435#M52750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-08T08:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: ALV First Program! Help Reqd</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887436#M52751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make use of the tutorial &amp;lt;a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf"&amp;gt;"An Easy Reference for ALV Grid Control"&amp;lt;/a&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a second point, since you are new to this forum, let me introduce the portion of sytematic about assigning points. Not strictly relating with this specific thread, you can assign points to posts you find helpful while solving your questions. You can assign points by using the points scala at the left of each post. By giving a 10-point or choosing "Solved by own" at the left of your original post, you sign the thread as closed which makes SDNers save their time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar &amp;lt;a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d"&amp;gt;[ BC ]&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2005 08:21:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-first-program-help-reqd/m-p/887436#M52751</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2005-06-08T08:21:52Z</dc:date>
    </item>
  </channel>
</rss>

