<?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: class method oops alv grid display error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740205#M2021027</link>
    <description>&lt;P&gt;Based on the code you have posted, nowhere you have defined LT_FINAL hence the error.&lt;/P&gt;&lt;P&gt;Maybe you are using Ctrl+F3 (activate current include) to activate your code instead of Ctrl+F7 (activate all includes).&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2023 17:27:17 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-09-26T17:27:17Z</dc:date>
    <item>
      <title>class method oops alv grid display error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740203#M2021025</link>
      <description>&lt;P&gt;with regards to oops, I have declared &lt;STRONG&gt;3 methods &lt;/STRONG&gt;inside class definition. &lt;/P&gt;
  &lt;P&gt;1. getdata&lt;/P&gt;
  &lt;P&gt;2. display&lt;/P&gt;
  &lt;P&gt;3. handle_hotspot_click&lt;/P&gt;
  &lt;P&gt;in&lt;STRONG&gt; get data&lt;/STRONG&gt; method the code is as below.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2210185-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;You can see I have called display inside method getdata.&lt;/P&gt;
  &lt;P&gt;in the method display I have called screen 200. (to display alv grid).The pbo of the screen 200 is to display alv grid. &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2210186-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I have given types and data declaration is&lt;STRONG&gt; protected section &lt;/STRONG&gt;of the class. &lt;/P&gt;
  &lt;P&gt;after the start of selection, I am calling method using object (instance method).&lt;/P&gt;
  &lt;P&gt;As all the methods are inside the same class, Ideally , I should not face any issue in accessing the data.&lt;/P&gt;
  &lt;P&gt;But it is showing the internal table as unknown.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2210187-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;can some one suggest me why it is throwing error as I am working in the same class methods ?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 15:27:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740203#M2021025</guid>
      <dc:creator>pashasapcha</dc:creator>
      <dc:date>2023-09-26T15:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: class method oops alv grid display error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740204#M2021026</link>
      <description>&lt;P&gt;Hi Mohammad Pasha&lt;/P&gt;&lt;P&gt;Think about coding using the class: &lt;STRONG&gt;cl_salv_table=&amp;gt;factory(...)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 16:55:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740204#M2021026</guid>
      <dc:creator>roberto_forti</dc:creator>
      <dc:date>2023-09-26T16:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: class method oops alv grid display error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740205#M2021027</link>
      <description>&lt;P&gt;Based on the code you have posted, nowhere you have defined LT_FINAL hence the error.&lt;/P&gt;&lt;P&gt;Maybe you are using Ctrl+F3 (activate current include) to activate your code instead of Ctrl+F7 (activate all includes).&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 17:27:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740205#M2021027</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-26T17:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: class method oops alv grid display error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740206#M2021028</link>
      <description>&lt;P&gt;DATA : user_cont TYPE REF TO cl_gui_custom_container,&lt;BR /&gt;       user_grid TYPE REF TO cl_gui_alv_grid.&lt;BR /&gt;Data : gs_layout type LVC_S_LAYO.&lt;BR /&gt;data : LT_FCAT type LVC_T_FCAT,&lt;BR /&gt;       LS_FCAT LIKE LINE OF LT_FCAT.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME title t1.&lt;/P&gt;SELECT-OPTIONS : so_bname FOR lv_bname.&lt;BR /&gt;SELECT-OPTIONS : so_date FOR lv_date.&lt;BR /&gt;SELECT-OPTIONS : SO_uflag for lv_uflag.&lt;BR /&gt;SELECTION-SCREEN : END OF BLOCK b1.&lt;BR /&gt;&lt;BR /&gt;SELECTION-SCREEN : BEGIN OF BLOCK B2 with frame title t2.&lt;BR /&gt;&lt;BR /&gt;  PARAMETERS : R1 RADIOBUTTON GROUP RG1 DEFAULT 'X',&lt;BR /&gt;               R2 RADIOBUTTON GROUP RG1,&lt;BR /&gt;               R3 RADIOBUTTON GROUP RG1,&lt;BR /&gt;               R4 RADIOBUTTON GROUP RG1.&lt;BR /&gt;  SELECTION-SCREEN : END OF BLOCK B2.&lt;BR /&gt;&lt;BR /&gt;SELECTION-SCREEN : BEGIN OF BLOCK B3 WITH FRAME TITLE T3.&lt;BR /&gt;  PARAMETERS: P_FILE TYPE RLGRAP-FILENAME.&lt;BR /&gt;SELECTION-SCREEN : END OF BLOCK B3." WITH FRAME TITLE T3.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CLASS lcl_user DEFINITION.&lt;BR /&gt;  PUBLIC SECTION.&lt;BR /&gt;&lt;BR /&gt;    METHODS :getdata,&lt;BR /&gt;             display,&lt;BR /&gt;             handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid IMPORTING e_row_id.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  PROTECTED SECTION.&lt;BR /&gt;  DATA : lv_date TYPE usr02-trdat,&lt;BR /&gt;       lv_bname type usr02-bname,&lt;BR /&gt;       lv_uflag type usr02-uflag.&lt;BR /&gt;&lt;BR /&gt;    TYPES : BEGIN OF &lt;STRONG&gt;ty_final,&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;              bname       TYPE usr02-bname,&lt;BR /&gt;              CLASS       TYPE usr02-class,&lt;BR /&gt;              GLTGV       type usr02-gltgv,&lt;BR /&gt;              GLTGB       TYPE USR02-GLTGB,&lt;BR /&gt;              uflag      TYPE  usr02-uflag,&lt;BR /&gt;          uflag_des  TYPE CHAR100,&lt;BR /&gt;              aname      TYPE usr02-aname,&lt;BR /&gt;              erdat      TYPE usr02-erdat,&lt;BR /&gt;              trdat      TYPE usr02-trdat,&lt;BR /&gt;              ltime      TYPE usr02-ltime,&lt;BR /&gt;              name_first TYPE user_addr-name_first,&lt;BR /&gt;              name_last  TYPE user_addr-name_last,&lt;BR /&gt;              name_textc TYPE user_addr-name_textc,&lt;BR /&gt;              tel_extens TYPE user_addr-tel_extens,&lt;BR /&gt;              roomnumber TYPE user_addr-roomnumber,&lt;BR /&gt;              department TYPE user_addr-department,&lt;BR /&gt;            END OF ty_final.&lt;BR /&gt;&lt;BR /&gt;    DATA : lt_final TYPE TABLE OF ty_final,&lt;BR /&gt;           ls_final TYPE ty_final.&lt;BR /&gt;"***************************************************************&lt;BR /&gt;&lt;BR /&gt;    TYPES : BEGIN OF ty_final1,&lt;BR /&gt;              bname       TYPE usr02-bname,&lt;BR /&gt;              CLASS       TYPE usr02-class,&lt;BR /&gt;              GLTGV       type usr02-gltgv,&lt;BR /&gt;              GLTGB       TYPE USR02-GLTGB,&lt;BR /&gt;              uflag      TYPE usr02-uflag,&lt;BR /&gt;&lt;BR /&gt;              aname      TYPE usr02-aname,&lt;BR /&gt;              erdat      TYPE usr02-erdat,&lt;BR /&gt;              trdat      TYPE usr02-trdat,&lt;BR /&gt;              ltime      TYPE usr02-ltime,&lt;BR /&gt;              name_first TYPE user_addr-name_first,&lt;BR /&gt;              name_last  TYPE user_addr-name_last,&lt;BR /&gt;              name_textc TYPE user_addr-name_textc,&lt;BR /&gt;              tel_extens TYPE user_addr-tel_extens,&lt;BR /&gt;              roomnumber TYPE user_addr-roomnumber,&lt;BR /&gt;              department TYPE user_addr-department,&lt;BR /&gt;            END OF ty_final1.&lt;BR /&gt;       DATA : lt_final1 TYPE TABLE OF ty_final1,&lt;BR /&gt;           ls_final1 TYPE ty_final1.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;       TYPES:&lt;BR /&gt;  BEGIN OF ty_data,&lt;BR /&gt;    uflag       TYPE xuuflag,&lt;BR /&gt;*    uflag_descr TYPE c LENGTH 60,&lt;BR /&gt;  END OF ty_data.&lt;BR /&gt;&lt;BR /&gt;TYPES tt_data TYPE STANDARD TABLE OF ty_data WITH DEFAULT KEY.&lt;BR /&gt;ENDCLASS.&lt;P&gt;Every thing was working fine as long as I kept the above types and data declarations outside the class.As I am using the oops abap, so I was planning to make the method public and its types and data declarations under protected section.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 19:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740206#M2021028</guid>
      <dc:creator>pashasapcha</dc:creator>
      <dc:date>2023-09-26T19:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: class method oops alv grid display error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740207#M2021029</link>
      <description>&lt;P&gt;You have declare something in the protected section of a class and you expect to be access from a MODULE of a Dynpro ? &lt;/P&gt;&lt;P&gt;First of all, WHY did you try to declare this in the class and why in the protected section ?&lt;/P&gt;&lt;P&gt;Why do you put ":"  after statement METHOD ? &lt;/P&gt;&lt;P&gt;Why do you use local class ?&lt;/P&gt;&lt;P&gt;Why do you use old method statement : CREATE OBJECT blabla.   ==&amp;gt; blabla = new class(  importing_param = 'toto' ).&lt;/P&gt;&lt;P&gt;So.&lt;/P&gt;&lt;P&gt;in a program, the data declared before the local class definition could be accessed by anybody.&lt;/P&gt;&lt;P&gt;The data declare in the public section of a local class, could be accessed by the program through an instance of a class.&lt;/P&gt;&lt;P&gt;The data declare in the protected section of a local class, could be accessed only by a LOCAL FRIEND of the local class (pretty sure you don't want that).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Fred&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 05:35:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-method-oops-alv-grid-display-error/m-p/12740207#M2021029</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2023-09-27T05:35:43Z</dc:date>
    </item>
  </channel>
</rss>

