<?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 modify for the fields in a database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224679#M1207997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the values in the ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Z_VC_MY&lt;/P&gt;&lt;P&gt;Z_VC_MODEL&lt;/P&gt;&lt;P&gt;Z_VC_MARKET&lt;/P&gt;&lt;P&gt;Z_VC_DESTINATION&lt;/P&gt;&lt;P&gt;Z_VC_COLOR&lt;/P&gt;&lt;P&gt;Z_VC_ABS&lt;/P&gt;&lt;P&gt;Z_VC_WHEEL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in these values and the fields in some other table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now every time in the select i will get some field name say in one case it is "Z_VC_WHEEL"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in the work area  i need to update  Z_VC_WHEEL field with the value i am getting in the IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and modify the data base table from the work area.&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;Ravindra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2009 05:40:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-23T05:40:25Z</dc:date>
    <item>
      <title>Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224675#M1207993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am in to a serious trouble it is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Z table from which i will be getting a field name and from a idoc i will be getting a value in a segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to update a table with the value from the idoc into the field name which i have retrieved from the Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Now based on the select the field name will be changing everytime based on select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now how do i modify the Database table??? since the field is changing everytime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the field symbols but it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is not allowing me to wrote say  W_itab-&amp;lt;FS&amp;gt; = idoc-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE HELP ME OUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ravindra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:08:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224675#M1207993</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224676#M1207994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravindra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you paste your code for updating the Z table here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash Pandey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:24:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224676#M1207994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224677#M1207995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ravindra ,&lt;/P&gt;&lt;P&gt;  You declare one generic structure with all the fields which are included in your select query.move corresponding values from field symbol to this structure. now easily u can update the table with the fields.The fields which will contains value will be updated and the remainig field which does not contain value will be empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; * Generic structure with the required fields  (or) all the fields from the table
TYPES:
    BEGIN OF TYPE_S_GENERIC,
      KDGRP TYPE KDGRP,
      KUNNR TYPE KUNNR,
      MATNR TYPE MATNR,
      DATBI TYPE DATBI,
      DATAB TYPE DATAB,
      KNUMH TYPE KNUMH,
    END OF TYPE_S_GENERIC.

 * *  Select the records from table 

SELECT *
      FROM (WA_ALL_TABS-TABNAME)
      INTO TABLE &amp;lt;ITAB&amp;gt;
     WHERE (W_CONDITION)
       AND KAPPL EQ PR_KAPPL
       AND KSCHL EQ PR_KSCHL.

    IF SY-SUBRC EQ 0.
       CREATE DATA REF_WA LIKE LINE OF &amp;lt;ITAB&amp;gt;.
       ASSIGN REF_WA-&amp;gt;* TO &amp;lt;FS_WA&amp;gt;.

       LOOP AT &amp;lt;ITAB&amp;gt; INTO &amp;lt;FS_WA&amp;gt;.
         MOVE-CORRESPONDING &amp;lt;FS_WA&amp;gt; TO WA_GENERIC.
         APPEND WA_GENERIC TO T_GENERIC.
      endloop.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224677#M1207995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224678#M1207996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravindra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create a varable of type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_condition  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now as you said you have the name of the variable from the IDOC. So use a concatenate statement to create a UPDATE condition. Somewhat like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CONCATENATE idoc-field ' = ' idoc-value INTO lv_condition.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE  ztable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set (lv_condition).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was one of the ways.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash Pandey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:36:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224678#M1207996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224679#M1207997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the values in the ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Z_VC_MY&lt;/P&gt;&lt;P&gt;Z_VC_MODEL&lt;/P&gt;&lt;P&gt;Z_VC_MARKET&lt;/P&gt;&lt;P&gt;Z_VC_DESTINATION&lt;/P&gt;&lt;P&gt;Z_VC_COLOR&lt;/P&gt;&lt;P&gt;Z_VC_ABS&lt;/P&gt;&lt;P&gt;Z_VC_WHEEL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in these values and the fields in some other table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now every time in the select i will get some field name say in one case it is "Z_VC_WHEEL"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in the work area  i need to update  Z_VC_WHEEL field with the value i am getting in the IDOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and modify the data base table from the work area.&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;Ravindra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:40:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224679#M1207997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224680#M1207998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravindra,&lt;/P&gt;&lt;P&gt;    Above given example is for a simple report. You  can also do like that. If the work area contains only&lt;/P&gt;&lt;P&gt;Z_VC_WHEEL  value and you want to updat with that value. Then the value will be updated with this field and make other fields remains same for that record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:48:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224680#M1207998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224681#M1207999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravindra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you already have the values in the work area then I have another way to solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ASSIGN COMPONENT 'Z_VC_WHEEL' OF STRUCTURE work_area to &amp;lt;fs_any&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK &amp;lt;fs_any&amp;gt; IS ASSIGNED.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;fs_any&amp;gt; = idoc-value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can update the database from your work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash Pandey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:51:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224681#M1207999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224682#M1208000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravindra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you already have the values in the work area then I have another way to solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ASSIGN COMPONENT 'Z_VC_WHEEL' OF STRUCTURE work_area to &amp;lt;fs_any&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK &amp;lt;fs_any&amp;gt; IS ASSIGNED.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;fs_any&amp;gt; = idoc-value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can update the database from your work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash Pandey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 05:52:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224682#M1208000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T05:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic modify for the fields in a database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224683#M1208001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Rajitha Sangi and Prakash Pandey &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;Ravindra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2009 08:00:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-modify-for-the-fields-in-a-database-table/m-p/5224683#M1208001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-23T08:00:09Z</dc:date>
    </item>
  </channel>
</rss>

