<?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 Selecting required fields from a table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875815#M1960237</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;My requirement is selection screen has a field called PERIOD.&lt;/P&gt;
  &lt;P&gt;If the user give a value '4' in the period field, then the fields TSL01, TSL02, TSL03, TSL04 from table JVTO1 with details has to be displayed.&lt;/P&gt;
  &lt;P&gt;Similarly if the user gives '5' in the period field then fields TSL01, TSL02, TSL03, TSL04, TSL05 from table JVTO1 with details has to be displayed and so on.&lt;/P&gt;
  &lt;P&gt;Could someone suggest something regarding this?&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 09:06:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-05-21T09:06:29Z</dc:date>
    <item>
      <title>Selecting required fields from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875815#M1960237</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;My requirement is selection screen has a field called PERIOD.&lt;/P&gt;
  &lt;P&gt;If the user give a value '4' in the period field, then the fields TSL01, TSL02, TSL03, TSL04 from table JVTO1 with details has to be displayed.&lt;/P&gt;
  &lt;P&gt;Similarly if the user gives '5' in the period field then fields TSL01, TSL02, TSL03, TSL04, TSL05 from table JVTO1 with details has to be displayed and so on.&lt;/P&gt;
  &lt;P&gt;Could someone suggest something regarding this?&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 09:06:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875815#M1960237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-05-21T09:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting required fields from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875816#M1960238</link>
      <description>&lt;P&gt;Easy.  The below assumes you read out all the required fields from the table into an internal table. Then you can loop over the data and process ....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Do period times.&lt;BR /&gt;data(lv_field_name) = 'TSL' &amp;amp;&amp;amp; sy-tabix.  "Maybe additional formatting of counter is required &lt;BR /&gt;assign component (lv_field_name) of structure X to field-symbol(&amp;lt;fs_field&amp;gt;).&lt;BR /&gt;check ( sy-subrc eq 0 ).&lt;BR /&gt;*do whatever you want with the field value&lt;BR /&gt;enddo.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 12:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875816#M1960238</guid>
      <dc:creator>StevenDeSaeger</dc:creator>
      <dc:date>2019-05-21T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting required fields from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875817#M1960239</link>
      <description>&lt;P&gt;Either create a dynamic table or use ALV and adapt field catalog ( no_out = abap_true ) or cl_salv_column-&amp;gt;set_visible( value = abap_false )&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:06:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875817#M1960239</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2019-05-21T13:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting required fields from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875818#M1960240</link>
      <description>&lt;P&gt;If your requirement is simple, you could try dynamic SQL and inline declaration to achive:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field_list = VALUE #( BASE ( field_list ) FOR i = 1 UNTIL i = input_value ( |TSL0{ i }| ) ).
SELECT (field_list)
  FROM JVTO1
 WHERE (condition)
  INTO TABLE @DATA(itab).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in case it more complex (with extra calculation after SQL or something else), you should select all fields then build a dynamic internal table:&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.scn.sap.com/wiki/display/Snippets/Example+-+create+a+dynamic+internal+table" target="test_blank"&gt;https://wiki.scn.sap.com/wiki/display/Snippets/Example+-+create+a+dynamic+internal+table&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 01:23:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-required-fields-from-a-table/m-p/11875818#M1960240</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-05-22T01:23:08Z</dc:date>
    </item>
  </channel>
</rss>

