<?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 internal table in OO method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469280#M220703</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 am new to ABAP Objects, and I am trying to implement a Business Add-Inn. I have created a new method, where I define an internal table and then use a function to read data and store it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, the function ends correctly, and while debugging I can see that the internal table (i_1001) has data. But after the exception check, the program jumps the LOOP instruction and goes directly to the next instruction. What can the problem be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing the code in case it helps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;DATA :    d_evento TYPE HRTEM_INTEZW-eveid,&lt;/P&gt;&lt;P&gt;          d_fecha TYPE HRTEM_INTEZW-adate,&lt;/P&gt;&lt;P&gt;          d_linea_1001 TYPE p1001,&lt;/P&gt;&lt;P&gt;          d_tipo_evento TYPE objec-objid,&lt;/P&gt;&lt;P&gt;          t_l_objeto TYPE STANDARD TABLE OF HROBJECT INITIAL SIZE 1,&lt;/P&gt;&lt;P&gt;          t_objeto TYPE HROBJECT.&lt;/P&gt;&lt;P&gt;TYPES :   i_tabla_1001 TYPE STANDARD TABLE OF P1001 INITIAL SIZE 0.&lt;/P&gt;&lt;P&gt;DATA:     i_1001 TYPE i_tabla_1001.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Inicialización de variables locales.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR :   d_linea , d_num_lineas , d_evento, d_fecha , d_linea_1001, d_tipo_evento.&lt;/P&gt;&lt;P&gt;REFRESH : i_1001 .  CLEAR : i_1001.&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Se busca el tipo de evento al que está vinculado el evento, para&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;obtener la tipología del evento (que hereda del tipo evento).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH t_l_objeto.&lt;/P&gt;&lt;P&gt;CLEAR t_objeto.&lt;/P&gt;&lt;P&gt;t_objeto-plvar = '01'.&lt;/P&gt;&lt;P&gt;t_objeto-otype = 'E'.&lt;/P&gt;&lt;P&gt;t_objeto-objid = me-&amp;gt;evento.&lt;/P&gt;&lt;P&gt;APPEND t_objeto TO t_l_objeto.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RH_READ_INFTY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;        AUTHORITY                  = 'DISP'&lt;/P&gt;&lt;P&gt;        WITH_STRU_AUTH             = 'X'&lt;/P&gt;&lt;P&gt;        INFTY                      = '1001'&lt;/P&gt;&lt;P&gt;        ISTAT                      = '1'&lt;/P&gt;&lt;P&gt;        BEGDA                      = d_fecha&lt;/P&gt;&lt;P&gt;        ENDDA                      = '99991231'&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;        INNNN                      = i_1001&lt;/P&gt;&lt;P&gt;        OBJECTS                    = t_l_objeto&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;        ALL_INFTY_WITH_SUBTY       = 1&lt;/P&gt;&lt;P&gt;        NOTHING_FOUND              = 2&lt;/P&gt;&lt;P&gt;        NO_OBJECTS                 = 3&lt;/P&gt;&lt;P&gt;        WRONG_CONDITION            = 4&lt;/P&gt;&lt;P&gt;        WRONG_PARAMETERS           = 5&lt;/P&gt;&lt;P&gt;        OTHERS                     = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;   CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;        WHEN '1'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Infotipos con subtipo especificado al leer inf1001'&lt;/P&gt;&lt;P&gt;                     TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '2'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'No hay datos para la selección del inf 1001'&lt;/P&gt;&lt;P&gt;                     TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '3'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'La tabla de objetos está vacía al leer el inf 1001'&lt;/P&gt;&lt;P&gt;                    TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '4'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Condición errónea el leer el inf 1001' TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '5'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Parámetros erróneos el leer el inf 1001' TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN OTHERS.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Error al leer el inf 1001' TYPE 'E'.&lt;/P&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;LOOP AT i_1001 INTO d_linea_1001 WHERE  RSIGN = 'A' AND RELAT = '20' .&lt;/P&gt;&lt;P&gt;   d_tipo_evento = d_linea_1001-sobid.&lt;/P&gt;&lt;P&gt;   CLEAR d_linea_1001.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;me-&amp;gt;tipo_evento = d_tipo_evento.&lt;/P&gt;&lt;P&gt;REFRESH t_l_objeto.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It jumps from the IF control of exceptions to the   last instruction (REFRESH t_l_objeto). sy-subrc gets the value 4 while it jumps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea about what can the problem be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nerea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Aug 2006 09:08:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-30T09:08:01Z</dc:date>
    <item>
      <title>internal table in OO method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469280#M220703</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 am new to ABAP Objects, and I am trying to implement a Business Add-Inn. I have created a new method, where I define an internal table and then use a function to read data and store it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, the function ends correctly, and while debugging I can see that the internal table (i_1001) has data. But after the exception check, the program jumps the LOOP instruction and goes directly to the next instruction. What can the problem be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing the code in case it helps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;DATA :    d_evento TYPE HRTEM_INTEZW-eveid,&lt;/P&gt;&lt;P&gt;          d_fecha TYPE HRTEM_INTEZW-adate,&lt;/P&gt;&lt;P&gt;          d_linea_1001 TYPE p1001,&lt;/P&gt;&lt;P&gt;          d_tipo_evento TYPE objec-objid,&lt;/P&gt;&lt;P&gt;          t_l_objeto TYPE STANDARD TABLE OF HROBJECT INITIAL SIZE 1,&lt;/P&gt;&lt;P&gt;          t_objeto TYPE HROBJECT.&lt;/P&gt;&lt;P&gt;TYPES :   i_tabla_1001 TYPE STANDARD TABLE OF P1001 INITIAL SIZE 0.&lt;/P&gt;&lt;P&gt;DATA:     i_1001 TYPE i_tabla_1001.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Inicialización de variables locales.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR :   d_linea , d_num_lineas , d_evento, d_fecha , d_linea_1001, d_tipo_evento.&lt;/P&gt;&lt;P&gt;REFRESH : i_1001 .  CLEAR : i_1001.&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Se busca el tipo de evento al que está vinculado el evento, para&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;obtener la tipología del evento (que hereda del tipo evento).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH t_l_objeto.&lt;/P&gt;&lt;P&gt;CLEAR t_objeto.&lt;/P&gt;&lt;P&gt;t_objeto-plvar = '01'.&lt;/P&gt;&lt;P&gt;t_objeto-otype = 'E'.&lt;/P&gt;&lt;P&gt;t_objeto-objid = me-&amp;gt;evento.&lt;/P&gt;&lt;P&gt;APPEND t_objeto TO t_l_objeto.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RH_READ_INFTY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;        AUTHORITY                  = 'DISP'&lt;/P&gt;&lt;P&gt;        WITH_STRU_AUTH             = 'X'&lt;/P&gt;&lt;P&gt;        INFTY                      = '1001'&lt;/P&gt;&lt;P&gt;        ISTAT                      = '1'&lt;/P&gt;&lt;P&gt;        BEGDA                      = d_fecha&lt;/P&gt;&lt;P&gt;        ENDDA                      = '99991231'&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;        INNNN                      = i_1001&lt;/P&gt;&lt;P&gt;        OBJECTS                    = t_l_objeto&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;        ALL_INFTY_WITH_SUBTY       = 1&lt;/P&gt;&lt;P&gt;        NOTHING_FOUND              = 2&lt;/P&gt;&lt;P&gt;        NO_OBJECTS                 = 3&lt;/P&gt;&lt;P&gt;        WRONG_CONDITION            = 4&lt;/P&gt;&lt;P&gt;        WRONG_PARAMETERS           = 5&lt;/P&gt;&lt;P&gt;        OTHERS                     = 6&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;   CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;        WHEN '1'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Infotipos con subtipo especificado al leer inf1001'&lt;/P&gt;&lt;P&gt;                     TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '2'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'No hay datos para la selección del inf 1001'&lt;/P&gt;&lt;P&gt;                     TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '3'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'La tabla de objetos está vacía al leer el inf 1001'&lt;/P&gt;&lt;P&gt;                    TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '4'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Condición errónea el leer el inf 1001' TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN '5'.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Parámetros erróneos el leer el inf 1001' TYPE 'E'.&lt;/P&gt;&lt;P&gt;        WHEN OTHERS.&lt;/P&gt;&lt;P&gt;            MESSAGE 'Error al leer el inf 1001' TYPE 'E'.&lt;/P&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;LOOP AT i_1001 INTO d_linea_1001 WHERE  RSIGN = 'A' AND RELAT = '20' .&lt;/P&gt;&lt;P&gt;   d_tipo_evento = d_linea_1001-sobid.&lt;/P&gt;&lt;P&gt;   CLEAR d_linea_1001.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;me-&amp;gt;tipo_evento = d_tipo_evento.&lt;/P&gt;&lt;P&gt;REFRESH t_l_objeto.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It jumps from the IF control of exceptions to the   last instruction (REFRESH t_l_objeto). sy-subrc gets the value 4 while it jumps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea about what can the problem be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nerea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:08:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469280#M220703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: internal table in OO method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469281#M220704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nerea,&lt;/P&gt;&lt;P&gt;perhaps in the internal table there is not a line which mets the condition you give at start of the loop.&lt;/P&gt;&lt;P&gt;&amp;gt; LOOP AT i_1001 INTO d_linea_1001 WHERE RSIGN = 'A' AND RELAT = '20' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a line in the internal table with field RSIGN containing 'A' and with field RELAT containing '20'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469281#M220704</guid>
      <dc:creator>MichaelTe</dc:creator>
      <dc:date>2006-08-30T09:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: internal table in OO method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469282#M220705</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 ur code, just try the following in the loop..endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_1001 INTO d_linea_1001.&lt;/P&gt;&lt;P&gt;d_tipo_evento = d_linea_1001-sobid.&lt;/P&gt;&lt;P&gt;CLEAR d_linea_1001.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;me-&amp;gt;tipo_evento = d_tipo_evento.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if the loop block works and subrc value is zero, the problem is with the WHERE condition in your loop statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try and revert back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469282#M220705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: internal table in OO method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469283#M220706</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 already tryed coding the LOOP with no WHERE addition, but it does not process the LOOP. Besides, there is a line in the internal table that matchs the where condition, so the problem wouldn't be that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nerea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:55:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469283#M220706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: internal table in OO method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469284#M220707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IN debug mode, what is the value of SY-SUBRC at the statement IF SY-SUBRC &amp;lt;&amp;gt; 0.? Quite possible, your MESSAGE statement is causing the 'jump'.. set the sy-subrc to 0 in debug &amp;amp; see if loops through..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 10:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469284#M220707</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-08-30T10:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: internal table in OO method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469285#M220708</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 solved the problem. The sy-subrc is 0, the problem was not that, I have changed it to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IS SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;    LOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ir works now, I suppose the MESSAGE statement was causing the 'jump'... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much Suresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nerea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-in-oo-method/m-p/1469285#M220708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:03:05Z</dc:date>
    </item>
  </channel>
</rss>

