<?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: Dynamic internal table - using it in another select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681590#M1449673</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;Try using gt_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Mar 2010 13:57:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-03T13:57:49Z</dc:date>
    <item>
      <title>Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681589#M1449672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an internal table declared dynamic. I have selected data into this internal table and now I want to use this - either in a FOR ALL ENTRIES or in a LOOP. But i get "the data object .... has no structure and therefore no component called BELNR"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Create a new dynamic Table from fieldcatalog
  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog = gt_fieldcat
    IMPORTING
      ep_table        = gt_table.

* Now assign this to a fieldsymbol with type standard table (req. by ALV)
  ASSIGN gt_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.

  SELECT belnr zslagtedata~matnr maktx zzslagtenr zzoremaerke
         zzdyre_kat zzform_char zzfedme zzalder zzlev_vaegt zzafr_vaegt
         zzvb_kode
    FROM zslagtedata
    JOIN makt
      ON zslagtedata~matnr = makt~matnr
    INTO CORRESPONDING FIELDS OF TABLE &amp;lt;dyn_table&amp;gt;
   WHERE zslagtedata~matnr IN s_matnr.
* Now see if there is some data in table ZAFR_PRISTABEL for the selected records
  select * from zafr_pristabel
    for ALL ENTRIES IN &amp;lt;dyn_table&amp;gt;
  where belnr = &amp;lt;dyn_table&amp;gt;-belnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not using the FOR ALL ENTRIES I would like to use :&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT &amp;lt;dyn_table&amp;gt; ASSIGNING &amp;lt;dyn_wa&amp;gt;.
    SELECT * FROM zafr_pristabel
      WHERE belnr EQ &amp;lt;dyn_wa&amp;gt;-belnr.
.......      
    ENDSELECT.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do that ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS the code is used to display price conditions from a table. Each row in the table is 1 price condition (can be customized). The condition record has to be linked with 1 document and shown as 1 line in an ALV list (the dynamic part is to add each record as an field in an internal table, and fill this field with data from the records)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 13:47:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681589#M1449672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T13:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681590#M1449673</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;Try using gt_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 13:57:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681590#M1449673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T13:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681591#M1449674</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;If declare the dynamic internal table with static structure then you can use it in for all entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It make it as type table or any then you can not use the field name in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If want do select inside the loop statement then there process. &lt;/P&gt;&lt;P&gt;1. Assign field value to 3rd variable using the statement assign component 'FIELD NAME' of structure to &amp;lt;3RD Variable&amp;gt; &lt;/P&gt;&lt;P&gt;2. Then use this 3rd variable in your select statement.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLs: &amp;lt;FS&amp;gt; type any.&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;dyn_table&amp;gt; ASSIGNING &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;Assign component 'belnr' of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SELECT * FROM zafr_pristabel&lt;/P&gt;&lt;P&gt;      WHERE belnr EQ &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;.......      &lt;/P&gt;&lt;P&gt;    ENDSELECT.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&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;&lt;/P&gt;&lt;P&gt;Subhankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 14:01:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681591#M1449674</guid>
      <dc:creator>Subhankar</dc:creator>
      <dc:date>2010-03-03T14:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681592#M1449675</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;it is not possible with FOR ALL ENTRIES since the table has no structure. You must work with a loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_fname TYPE char20.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;f_wa&amp;gt;, &amp;lt;f_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;it_table&amp;gt; ASSIGNING &amp;lt;f_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;    l_fname = '&amp;lt;f_wa&amp;gt;-your field here'.&lt;/P&gt;&lt;P&gt;    ASSIGN (l_fname) TO &amp;lt;f_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF &amp;lt;f_field&amp;gt; = some value.&lt;/P&gt;&lt;P&gt;      WRITE:/10 'Condition fulfilled'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 14:07:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681592#M1449675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681593#M1449676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Kim Ternstrøm ,&lt;/P&gt;&lt;P&gt;you very well know the offse structre of the table structre you can do it using OFFSET  for the loop thing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 14:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681593#M1449676</guid>
      <dc:creator>anup_deshmukh4</dc:creator>
      <dc:date>2010-03-03T14:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681594#M1449677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the gt_table just result in an error message saying that the data object gt_table has no structure and therefore no component called BELNR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 16:35:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681594#M1449677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T16:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table - using it in another select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681595#M1449678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used this code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT &amp;lt;dyn_table&amp;gt; ASSIGNING &amp;lt;dyn_wa&amp;gt;.
   Assign component 'BELNR' of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;belnr&amp;gt;.
    SELECT * FROM zafr_pristabel
      WHERE belnr EQ &amp;lt;belnr&amp;gt;.
      ASSIGN COMPONENT 'KSCHL' of structure zafr_pristabel to &amp;lt;field&amp;gt;.
      assign COMPONENT &amp;lt;field&amp;gt; of STRUCTURE &amp;lt;dyn_wa&amp;gt; to &amp;lt;value&amp;gt;.
      &amp;lt;value&amp;gt; = zafr_pristabel-kbetr.
    ENDSELECT.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional question : How do i track changes in the ALV - it is editable. If not using dynamic table i would create a TEMP table as a copy of the ALV table, but this is not possible using the dynamic table. The table is a field symbol &amp;lt;dyn_table&amp;gt;, and creating another field symbol &amp;lt;temp_dyn_table&amp;gt; and assigning the first to the second would always result in the two tables are the same.&lt;/P&gt;&lt;P&gt;If the user changes the value of 1 condition, this new value has to be written down in table zafr_pristabel again - and only the changed records.&lt;/P&gt;&lt;P&gt;PS i'm using &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Get changed data from memory - if not called we can't see the changed fileds
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = p_ref1.
  CALL METHOD p_ref1-&amp;gt;check_changed_data.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 16:59:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-using-it-in-another-select-statement/m-p/6681595#M1449678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T16:59:05Z</dc:date>
    </item>
  </channel>
</rss>

