<?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 GRID  + Program Errors in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769430#M332323</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;Check this sample code..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZTEST_VIJAY  MESSAGE-ID ZZ  .
DATA: IT_MARA TYPE TABLE OF MARA.

DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM.
data: gc_layout type LVC_S_LAYO.
DATA:  G_CONTAINER TYPE SCRFNAME VALUE 'CONTROL'.
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.


START-OF-SELECTION.
SELECT *
FROM MARA
UP TO 20 ROWS
INTO TABLE IT_MARA.

END-OF-SELECTION.
IF NOT IT_MARA[] IS INITIAL.
  CALL SCREEN 100.
ELSE.
  MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.

MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
IF G_CUSTOM_CONTAINER IS INITIAL.
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE.                 " STATUS_0100  OUTPUT


MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT


FORM CREATE_AND_INIT_ALV .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER.

CREATE OBJECT G_GRID
EXPORTING I_PARENT = G_CUSTOM_CONTAINER.

data: x_variant type disvariant.
x_variant-report = sy-repid.

*Calling the Method for ALV output
  CALL METHOD G_GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_STRUCTURE_NAME = 'MARA'
    is_layout = gc_layout
    i_save           = 'A'
    is_variant = x_variant
    CHANGING
    IT_OUTTAB = IT_MARA[].

ENDFORM.                     "CREATE_AND_INIT_ALV&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 14:19:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T14:19:03Z</dc:date>
    <item>
      <title>ALV GRID  + Program Errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769427#M332320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a program which calls a function module ( for further processing ), and at the end this function moduels displays the ALV-GRID. Everything looks okey, and the ALV Gribd is also displayed fine,  But after the ALV Grid is displayed, and when I try to select one of the table entry and try to use the tool-bar functions ( details, sort, find, or filter ) the program shows me the error message, stating "STOP Program errors" and then program exits, any idea what's going on ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code for ALV GRID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;    lv_custom_cont   TYPE REF TO     &lt;/P&gt;&lt;P&gt;cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;    galv_sel         TYPE REF TO   cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;    ps_layout        TYPE lvc_s_layo,&lt;/P&gt;&lt;P&gt;    /cla/zz_lo_error TYPE dd02l-tabname,&lt;/P&gt;&lt;P&gt;    ls_variant       TYPE disvariant.&lt;/P&gt;&lt;P&gt;&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;output ALV List&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF galv_sel IS INITIAL.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT galv_sel&lt;/P&gt;&lt;P&gt;             EXPORTING i_parent = lv_custom_cont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ls_variant-report   = sy-repid.&lt;/P&gt;&lt;P&gt;      ls_variant-username = sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL METHOD&lt;/P&gt;&lt;P&gt;galv_sel-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;             i_structure_name = '/CLA/ZZ_LO_ERROR'&lt;/P&gt;&lt;P&gt;             is_layout        = ps_layout&lt;/P&gt;&lt;P&gt;             is_variant       = ls_variant&lt;/P&gt;&lt;P&gt;             i_save           = 'A'&lt;/P&gt;&lt;P&gt;           CHANGING&lt;/P&gt;&lt;P&gt;             it_outtab        = it_update[].&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_fieldcatalog  = pt_fieldcat&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_sort          = pt_sort.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CALL METHOD galv_sel-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;    ENDIF.&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;null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Haider Zaidi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 12:05:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769427#M332320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T12:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: ALV GRID  + Program Errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769428#M332321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Haider&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is the use of the function module (TABLES ?) parameter IT_UPDATE. Please remember that the data itab must be globally defined because its is a CHANGING parameter of the method SET_TABLE_FOR_FIRST_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following: define a global itab in the TOP include of your function group. Before calling method SET_TABLE_FOR_FIRST_DISPLAY move the itab values to this global itab like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  GT_UPDATE = it_update[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 12:43:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769428#M332321</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-12-06T12:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALV GRID  + Program Errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769429#M332322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Uwa, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, now I have declared an includ, and place the declaration of it_update in this include, and I call this include at the first line of FM, but problem still there....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Haider Zaidi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 13:07:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769429#M332322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T13:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: ALV GRID  + Program Errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769430#M332323</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;Check this sample code..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZTEST_VIJAY  MESSAGE-ID ZZ  .
DATA: IT_MARA TYPE TABLE OF MARA.

DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM.
data: gc_layout type LVC_S_LAYO.
DATA:  G_CONTAINER TYPE SCRFNAME VALUE 'CONTROL'.
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.


START-OF-SELECTION.
SELECT *
FROM MARA
UP TO 20 ROWS
INTO TABLE IT_MARA.

END-OF-SELECTION.
IF NOT IT_MARA[] IS INITIAL.
  CALL SCREEN 100.
ELSE.
  MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.

MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
IF G_CUSTOM_CONTAINER IS INITIAL.
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE.                 " STATUS_0100  OUTPUT


MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT


FORM CREATE_AND_INIT_ALV .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER.

CREATE OBJECT G_GRID
EXPORTING I_PARENT = G_CUSTOM_CONTAINER.

data: x_variant type disvariant.
x_variant-report = sy-repid.

*Calling the Method for ALV output
  CALL METHOD G_GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_STRUCTURE_NAME = 'MARA'
    is_layout = gc_layout
    i_save           = 'A'
    is_variant = x_variant
    CHANGING
    IT_OUTTAB = IT_MARA[].

ENDFORM.                     "CREATE_AND_INIT_ALV&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 14:19:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769430#M332323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T14:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: ALV GRID  + Program Errors</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769431#M332324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vijay, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I implement the functionality in single report then it usually works, but now I am facing this strange problem, and the senario is that from my program I call this fm, and inside this fm, I call the alv-grid for first display method etc.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea, why it works in single report and not in fm, and gives me this strange error msg.&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;PS: if you provide me your mail id, I can send you the exact screen-shot of msg... send me mail at web_cheela@yahoo.com, ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Haider Zaidi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Haider Zaidi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 14:23:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid-program-errors/m-p/1769431#M332324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T14:23:47Z</dc:date>
    </item>
  </channel>
</rss>

