<?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 Reading Hashtable Record in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457631#M551131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How read 10th records of Hash internal table? Please guide me with syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Jul 2007 18:32:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-01T18:32:38Z</dc:date>
    <item>
      <title>Reading Hashtable Record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457631#M551131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How read 10th records of Hash internal table? Please guide me with syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2007 18:32:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457631#M551131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-01T18:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Hashtable Record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457632#M551132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot read a hashed table using an index. If you loop over a hashed table sy-tabix is undefined. Hashed tables are basically accessed using their&amp;lt;b&amp;gt; key fields&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample report shows how to realize your requirement which, however, is not reasonable using hashed tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_HASHED_TABLE
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_hashed_table.

TABLES: kna1.
TABLES: knb1.

TYPES: BEGIN OF ty_s_customer.
TYPES:   bukrs    TYPE bukrs.
TYPES:   kunnr    TYPE kunnr.
TYPES:   anred    TYPE anred.
TYPES:   name1    TYPE name1_gp.
TYPES: END OF ty_s_customer.
TYPES: ty_t_customer  TYPE HASHED TABLE OF ty_s_customer
                      WITH UNIQUE KEY bukrs kunnr.

DATA:
  gd_idx         TYPE i,
  gs_customer    TYPE ty_s_customer,
  gt_customer    TYPE ty_t_customer.  " hashed table


PARAMETERS:
  p_bukrs    TYPE bukrs  DEFAULT '1000'.


START-OF-SELECTION.


  SELECT * FROM  vf_debi INTO CORRESPONDING FIELDS OF TABLE gt_customer
         WHERE  bukrs  = p_bukrs.


  "  READ TABLE gt_customer INTO gs_customer INDEX 10.  " not allowed

  gd_idx = 0.
  LOOP AT gt_customer INTO gs_customer.
    "   NOTE: sy-tabix is undefined

    ADD 1 TO gd_idx.
    IF ( gd_idx = 10 ).
      WRITE: / gd_idx, gs_customer-kunnr, gs_customer-name1.
      EXIT.
    ENDIF.
  ENDLOOP.

END-OF-SELECTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Sun, 01 Jul 2007 20:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457632#M551132</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-07-01T20:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Hashtable Record</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457633#M551133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check with below Link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report zxyz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COL1 TYPE I,&lt;/P&gt;&lt;P&gt;COL2 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 12 tIMES.&lt;/P&gt;&lt;P&gt;  LINE-COL1 = SY-INDEX.&lt;/P&gt;&lt;P&gt;  LINE-COL2 = SY-INDEX ** 2.&lt;/P&gt;&lt;P&gt;INSERT LINE INTO TABLE ITAB.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITAB into LINE  index 10. -&amp;gt; &amp;lt;b&amp;gt;you can not use explicit or implicit index operation with Hash table&amp;lt;/b&amp;gt; so you get syntax error&lt;/P&gt;&lt;P&gt;WRITE: 'SY-SUBRC =', SY-SUBRC.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;WRITE: / LINE-COL1, LINE-COL2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2007 20:50:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-hashtable-record/m-p/2457633#M551133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-01T20:50:57Z</dc:date>
    </item>
  </channel>
</rss>

