<?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: variable/dynamic field names in database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065322#M1703033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramu, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure, if I really understood what you like to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My interpretation: you want a screen with a drop down box. If you select 'Number' from the drop down, you can enter an employee number. If you select 'Name' you can enter a name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that interpretation is right: I do not see that this has to do anything with how you create the database table. I rather think it has to do with the UI -&amp;gt; you could create a drop down box with fixed values. Then create 2 input fields, one for number, one for name. Depending on the value of the drop down box, you show one of the 2 input fields and hide the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Sep 2012 23:08:55 GMT</pubDate>
    <dc:creator>schneidertho</dc:creator>
    <dc:date>2012-09-29T23:08:55Z</dc:date>
    <item>
      <title>variable/dynamic field names in database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065321#M1703032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we create variable fields in database table(SE11) , that is name of the field is not fixed. We need to select the name of field from drop down or F4 then enter the correspond value for that field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example. : From dropdown we need to select emp name or emp number as the field name . If we select EMP NAME as field name then we can able to enter some employee name as field value.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls tell me how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;Ram&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 08:30:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065321#M1703032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-09-28T08:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: variable/dynamic field names in database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065322#M1703033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramu, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure, if I really understood what you like to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My interpretation: you want a screen with a drop down box. If you select 'Number' from the drop down, you can enter an employee number. If you select 'Name' you can enter a name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that interpretation is right: I do not see that this has to do anything with how you create the database table. I rather think it has to do with the UI -&amp;gt; you could create a drop down box with fixed values. Then create 2 input fields, one for number, one for name. Depending on the value of the drop down box, you show one of the 2 input fields and hide the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Sep 2012 23:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065322#M1703033</guid>
      <dc:creator>schneidertho</dc:creator>
      <dc:date>2012-09-29T23:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: variable/dynamic field names in database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065323#M1703034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your question seems to be confusing. You want the variable field names to be able to create the table on runtime or the table with actual fields (like number, name, date of birth, address fields etc) are already present and you need to populate the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I feel is the second case where the filed names are actually defined in table, but you want the variable values to be entered on the fields based on the drop down values of field names. In such case, you first need to take the field names from DD03L table where you will give your table name and extract the field names. This is then passed into the dropdown list. Generate the corresponding entry/input field with length as the selected length. Using Field symbols, populate the field values for that field and respective key. This will help you in generating the record for the given key fields of that table. You need to develop the logic for inserting/appending the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the first thing to happen, like dynamic table, then I will suggest you to create the internal table and then export the same to DATABASE indx(??) eg. Saving and reading table &amp;amp; records will have statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORT itab to DATABASE indx(index1) ID 'TABLE' from wa. ---&amp;gt; Saving&lt;/P&gt;&lt;P&gt;IMPORT itab1 to itab2 from DATABASE indx(index1) ID 'TABLE' ---&amp;gt; Reading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data will be stored in the INDX table from where you can retreive the data. Please check SAP Documentation for playing around with DATABASE indx table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hardik Mehta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 14:23:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065323#M1703034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-04T14:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: variable/dynamic field names in database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065324#M1703035</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;The field name is entered in the selection screen, and inappropriate to that field value F4 help values will be displayed.By menas of dynamic select query, this criteria is possible.&lt;/P&gt;&lt;P&gt;There is no need of variable name in table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare gt_mara internal table with all possible variable fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="L0S31"&gt;* Internal table and Workarea Declaration&lt;BR /&gt;&amp;nbsp; DATA:lt_field_list&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;STANDARD &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;ty_field_list,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_wa_fieldlist &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;ty_field_list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S31"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; parameter:p_fname &lt;SPAN class="L0S52"&gt;type char20,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_fval&amp;nbsp; &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;char100.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;SELECTION-SCREEN &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ON &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;VALUE-REQUEST &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FOR &lt;/SPAN&gt;p_fval.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; l_wa_fieldlist-field = p_fname.&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;APPEND &lt;/SPAN&gt;l_wa_fieldlist &lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;lt_field_list.&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLEAR &lt;/SPAN&gt;l_wa_fieldlist.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S52"&gt;select &lt;/SPAN&gt;(lt_field_list)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;mara&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;gt_mara.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; lc_fname = p_fname.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="L0S31"&gt;*Function module for F4&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CALL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FUNCTION &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'F4IF_INT_TABLE_VALUE_REQUEST'&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retfield&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = lc_fname&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynpnr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = sy-dynnr&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_org&amp;nbsp;&amp;nbsp; = &lt;SPAN class="L0S33"&gt;'S'&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TABLES&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value_tab&amp;nbsp;&amp;nbsp; = gt_mara&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return_tab&amp;nbsp; = lt_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S52"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;Hope this helps your query&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;/SPAN&gt;&lt;/P&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;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 09:18:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-dynamic-field-names-in-database-table/m-p/9065324#M1703035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-10-15T09:18:59Z</dc:date>
    </item>
  </channel>
</rss>

