<?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: Updating database table from a dynamic internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423115#M541089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the solution. i have another query.&lt;/P&gt;&lt;P&gt;when my data is passed from the internal table to work area, i need access to a particular column of the work area(the column is chosen dynamically) and update the same with a new value.&lt;/P&gt;&lt;P&gt;Kindly help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravish Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2007 05:23:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-20T05:23:37Z</dc:date>
    <item>
      <title>Updating database table from a dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423112#M541086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dynamic internal table which is populated with data accoring to select-option.&lt;/P&gt;&lt;P&gt; Now i have to make updations to the data fetched into this dynamic table and then update the database table with these changes. To do this, i need access to the work area of the dynamic internal table, but i am not able to either access it or create it.&lt;/P&gt;&lt;P&gt;Kindly suggest how to go about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS : The task is being performed using classes and methods a nd not function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravish Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 04:42:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423112#M541086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Updating database table from a dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423113#M541087</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;Check this example of how create work area for a dynamic internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: p_input TYPE i OBLIGATORY.

START-OF-SELECTION.

  DATA: v_fieldname  TYPE char30.
  DATA: v_char       TYPE numc4.
  DATA: it_fldcat    TYPE lvc_t_fcat.
  DATA: wa_it_fldcat LIKE LINE OF it_fldcat.
  DATA: gp_table     TYPE REF TO data.

  FIELD-SYMBOLS: &amp;lt;gt_table&amp;gt; TYPE table.

  DO p_input TIMES.

    v_fieldname = 'COL'.
    v_char      = sy-index.

    CONCATENATE v_fieldname v_char INTO v_fieldname.
    CONDENSE v_fieldname.

    CLEAR wa_it_fldcat.
    wa_it_fldcat-fieldname = v_fieldname.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-outputlen = 5.
    wa_it_fldcat-intlen = 5.
    APPEND wa_it_fldcat TO it_fldcat .

  ENDDO.

* Internal table creation..
  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
  EXPORTING it_fieldcatalog = it_fldcat
  IMPORTING ep_table = gp_table.

  ASSIGN gp_table-&amp;gt;* TO &amp;lt;gt_table&amp;gt;.

  CHECK sy-subrc = 0.

  DATA: WA TYPE REF TO DATA.

* Work area for the dynamic internal table.
  CREATE DATA WA LIKE LINE OF &amp;lt;gt_table&amp;gt;.

  WRITE: / 'Dynamic internal table created'.

* Process the internal table
  LOOP AT &amp;lt;gt_table&amp;gt; INTO WA.
    
***********Do all your stuffs there..    

  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 04:46:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423113#M541087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T04:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Updating database table from a dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423114#M541088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the document for How to use Dynamic Tables ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the very best to you.&lt;/P&gt;&lt;P&gt;- Mohan Vamsi Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 04:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423114#M541088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T04:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Updating database table from a dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423115#M541089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naren&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the solution. i have another query.&lt;/P&gt;&lt;P&gt;when my data is passed from the internal table to work area, i need access to a particular column of the work area(the column is chosen dynamically) and update the same with a new value.&lt;/P&gt;&lt;P&gt;Kindly help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravish Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 05:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423115#M541089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T05:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Updating database table from a dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423116#M541090</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;you can create a field-symbols..try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Continuation with my previous example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Work area for the dynamic internal table.
  CREATE DATA WA LIKE LINE OF &amp;lt;gt_table&amp;gt;.
 
  WRITE: / 'Dynamic internal table created'.

  field-symbols : &amp;lt;FS&amp;gt;.
 
* Process the internal table
  LOOP AT &amp;lt;gt_table&amp;gt; INTO WA.
    
* get the column value
     ASSIGN COMPONENT 'MATNR' OF STRUCTURE WA TO &amp;lt;FS&amp;gt;.
  
     CHECK sy-subrc = 0.

* Modify the value...
     &amp;lt;FS&amp;gt;   = 'test'.

* Modify the internal table.
      MODIFY &amp;lt;gt_table&amp;gt; FROM WA.

  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Please make sure to reward points for helpful answers..&amp;lt;/b&amp;gt;Thanks&lt;/P&gt;&lt;P&gt;naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 05:31:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-database-table-from-a-dynamic-internal-table/m-p/2423116#M541090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T05:31:40Z</dc:date>
    </item>
  </channel>
</rss>

