<?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: READ TABLE using index with dynamic internal tables - multiple fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493849#M1420682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS:&amp;lt;fs_vbreve&amp;gt; TYPE t_vbreve.

LOOP AT it_vbreve ASSIGNING &amp;lt;fs_vbreve&amp;gt;.

    READ TABLE it_vbrevr WITH KEY vbeln = &amp;lt;fs_vbreve&amp;gt;-vbeln
                                  posnr = &amp;lt;fs_vbreve&amp;gt;-posnr
                                  BINARY SEARCH
                                  TRANSPORTING NO FIELDS.
    IF sy-subrc EQ 0.
      &amp;lt;fs_vbreve&amp;gt;-del = 'N'.
    ELSE.
      UNASSIGN &amp;lt;fs_vbkd&amp;gt;.
      READ TABLE it_vbkd ASSIGNING &amp;lt;fs_vbkd&amp;gt;
                                    WITH KEY vbeln = &amp;lt;fs_vbreve&amp;gt;-vbeln
                                             posnr = &amp;lt;fs_vbreve&amp;gt;-posnr
                                             BINARY SEARCH.
      IF sy-subrc EQ 0.
        READ TABLE it_fplt WITH KEY fplnr = &amp;lt;fs_vbkd&amp;gt;-fplnr
                                    BINARY SEARCH
                                    TRANSPORTING NO FIELDS.
        IF sy-subrc EQ 0.
          &amp;lt;fs_vbreve&amp;gt;-del = 'N'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : v_ktokd LIKE kna1-ktokd,
         v_kunnr LIKE kna1-kunnr.


  FIELD-SYMBOLS: &amp;lt;k1&amp;gt; TYPE STANDARD TABLE.
  DATA: k2      TYPE fknvi  ,
        l_index TYPE sytabix.

  IF ( sy-tcode = 'XD01'  OR  sy-tcode = 'VD01' ) AND
     i_knvv-vkorg EQ '1000'.
    ASSIGN ('(SAPMF02D)XKNVI[]') TO &amp;lt;k1&amp;gt;.
    IF &amp;lt;k1&amp;gt; IS ASSIGNED.
      LOOP AT t_knvi.

        MOVE: sy-tabix TO l_index.
        IF t_knvi-taxkd IS INITIAL AND
           t_knvi-aland EQ 'US'.
          t_knvi-taxkd = '6'.
          MODIFY t_knvi TRANSPORTING taxkd.

          READ TABLE &amp;lt;k1&amp;gt; INTO k2 INDEX l_index.
          k2-taxkd = '6'.
          MODIFY &amp;lt;k1&amp;gt;  FROM k2 INDEX l_index.
        ENDIF.
        CLEAR: k2     ,
               l_index.
      ENDLOOP.
      UNASSIGN &amp;lt;k1&amp;gt;.
    ENDIF.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jan 2010 14:50:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-14T14:50:49Z</dc:date>
    <item>
      <title>READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493844#M1420677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have 2 internal tables where one field has slightly different fieldname as one is based on a TO and other ona transfer requirement.  Based on which tramsaction is called determines which table to access.  Tried doing this with field symbols but get no joy. Getting mixed up with my field symbols statments.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY,
                              &amp;lt;fs_tab&amp;gt; type STANDARD table.

*---Set screen fields----------------------------------------------
  IF sy-tcode = 'ZRFB13'.
    assign GT_LTAP to &amp;lt;fs_tab&amp;gt;.
  ELSEIF sy-tcode = 'ZRFB14'.
    ASSIGN GT_LTBP TO &amp;lt;fs_TAB&amp;gt;.
  ENDIF.


  READ TABLE &amp;lt;FS_TAB&amp;gt; ASSIGNING &amp;lt;FS&amp;gt; INDEX G_COUNT .

  IF sy-subrc = 0.
    IF sy-tcode = 'ZRFB13'.
      xr_scr_0902-s_item  = &amp;lt;fs&amp;gt;-tapos.
      xr_scr_0902-fld_skip = &amp;lt;fs&amp;gt;-skip.
      xr_scr_0902-s_matnr = &amp;lt;fs&amp;gt;-matnr.
      xr_scr_0902-s_batch = &amp;lt;fs&amp;gt;-charg.
      xr_scr_0902-s_qty   = &amp;lt;fs&amp;gt;-qty.
      xr_scr_0902-s_uom   = &amp;lt;fs&amp;gt;-uom.
      xr_scr_0902-s_styp  =&amp;lt;fs&amp;gt;-vltyp.
      xr_scr_0902-s_bin   = &amp;lt;fs&amp;gt;-vlpla.
   ELSEIF SY-TVCODE = 'ZRFB14'.
      xr_scr_0902-s_item  = &amp;lt;fs&amp;gt;-tbpos.
      xr_scr_0902-fld_skip = &amp;lt;fs&amp;gt;-skip.
      xr_scr_0902-s_matnr = &amp;lt;fs&amp;gt;-matnr.
      xr_scr_0902-s_batch = &amp;lt;fs&amp;gt;-charg.
      xr_scr_0902-s_qty   = &amp;lt;fs&amp;gt;-qty.
      xr_scr_0902-s_uom   = &amp;lt;fs&amp;gt;-uom.
  ENDIF.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax error is ' The data object &amp;lt;fs&amp;gt; has no structure and therefore no component called TAPOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way I can do this without using ASSIGN COMPONENT as do not really want to assign fields when multiple fields involved? Can  I reference a data object or  is there something else I can do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers would be appreciated.&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;Larissa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 13:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493844#M1420677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T13:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493845#M1420678</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;Or you assign field by field, or u define the field-symbol like the structure having the fields u're transfering instead of to define as generic type:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE &amp;lt;structure&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 13:57:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493845#M1420678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T13:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493846#M1420679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem is that my structure will be different at runtime based on which transaction has been run.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 14:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493846#M1420679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T14:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493847#M1420680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That means u have to assign field by field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a rule for mapping where u can indicate the link between source and target field perhaps u can create some lines of code valid for all cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: max bianchi on Jan 14, 2010 3:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 14:04:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493847#M1420680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T14:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493848#M1420681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi larissa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all have a look at this points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt; Cut and paste without attribution from &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb387a358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb387a358411d1829f0000e829fbfe/content.htm&lt;/A&gt; removed &amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Manas Mishra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kumar Manas Mishra on Jan 14, 2010 3:43 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kumar Manas Mishra on Jan 14, 2010 3:45 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kumar Manas Mishra on Jan 14, 2010 3:47 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Jan 14, 2010 9:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 14:43:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493848#M1420681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T14:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493849#M1420682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS:&amp;lt;fs_vbreve&amp;gt; TYPE t_vbreve.

LOOP AT it_vbreve ASSIGNING &amp;lt;fs_vbreve&amp;gt;.

    READ TABLE it_vbrevr WITH KEY vbeln = &amp;lt;fs_vbreve&amp;gt;-vbeln
                                  posnr = &amp;lt;fs_vbreve&amp;gt;-posnr
                                  BINARY SEARCH
                                  TRANSPORTING NO FIELDS.
    IF sy-subrc EQ 0.
      &amp;lt;fs_vbreve&amp;gt;-del = 'N'.
    ELSE.
      UNASSIGN &amp;lt;fs_vbkd&amp;gt;.
      READ TABLE it_vbkd ASSIGNING &amp;lt;fs_vbkd&amp;gt;
                                    WITH KEY vbeln = &amp;lt;fs_vbreve&amp;gt;-vbeln
                                             posnr = &amp;lt;fs_vbreve&amp;gt;-posnr
                                             BINARY SEARCH.
      IF sy-subrc EQ 0.
        READ TABLE it_fplt WITH KEY fplnr = &amp;lt;fs_vbkd&amp;gt;-fplnr
                                    BINARY SEARCH
                                    TRANSPORTING NO FIELDS.
        IF sy-subrc EQ 0.
          &amp;lt;fs_vbreve&amp;gt;-del = 'N'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : v_ktokd LIKE kna1-ktokd,
         v_kunnr LIKE kna1-kunnr.


  FIELD-SYMBOLS: &amp;lt;k1&amp;gt; TYPE STANDARD TABLE.
  DATA: k2      TYPE fknvi  ,
        l_index TYPE sytabix.

  IF ( sy-tcode = 'XD01'  OR  sy-tcode = 'VD01' ) AND
     i_knvv-vkorg EQ '1000'.
    ASSIGN ('(SAPMF02D)XKNVI[]') TO &amp;lt;k1&amp;gt;.
    IF &amp;lt;k1&amp;gt; IS ASSIGNED.
      LOOP AT t_knvi.

        MOVE: sy-tabix TO l_index.
        IF t_knvi-taxkd IS INITIAL AND
           t_knvi-aland EQ 'US'.
          t_knvi-taxkd = '6'.
          MODIFY t_knvi TRANSPORTING taxkd.

          READ TABLE &amp;lt;k1&amp;gt; INTO k2 INDEX l_index.
          k2-taxkd = '6'.
          MODIFY &amp;lt;k1&amp;gt;  FROM k2 INDEX l_index.
        ENDIF.
        CLEAR: k2     ,
               l_index.
      ENDLOOP.
      UNASSIGN &amp;lt;k1&amp;gt;.
    ENDIF.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 14:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493849#M1420682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T14:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493850#M1420683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Decided to do it another way as if I have to assign the fields then no point doing field symbols. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 15:09:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493850#M1420683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T15:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE using index with dynamic internal tables - multiple fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493851#M1420684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Decided to do something else but awarded points to the most relevant answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 15:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-using-index-with-dynamic-internal-tables-multiple-fields/m-p/6493851#M1420684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-14T15:10:46Z</dc:date>
    </item>
  </channel>
</rss>

