<?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 read table with condition types in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791286#M2024319</link>
    <description>&lt;P&gt; Hi, gurus,&lt;/P&gt;
  &lt;P&gt; I have requirement where I have &lt;STRONG&gt;multiple KSCHL (condition types) in bset table.&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt; I have written the select query with the required condition types as below.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2227153-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;You can see in the above image that multiple kschl we have used in select query.&lt;/P&gt;
  &lt;P&gt;You can see in the below we are using multiple read tables as below.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2227154-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt; Now i have to&lt;STRONG&gt; READ it with each KSCHL which is taken alot of space&lt;/STRONG&gt;. I want to get all the &lt;/P&gt;
  &lt;P&gt; values of ktosl in single read table.&lt;/P&gt;
  &lt;P&gt;I am expecting something like this.&lt;/P&gt;
  &lt;P&gt; READ TABLE lt_bset INTO ls_bset WITH KEY bukrs = ls_bseg-bukrs&lt;/P&gt;
  &lt;P&gt; belnr = ls_bseg-belnr&lt;/P&gt;
  &lt;P&gt;gjahr = ls_bseg-gjahr&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;kschl = 'JICR' and kschl = 'JISR 'and kschl = 'JICN'&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;txgrp = ls_bseg-txgrp.&lt;/P&gt;
  &lt;P&gt; is it possible ?&lt;/P&gt;
  &lt;P&gt; or let me know if there is any way so that I can use only one read table.&lt;/P&gt;
  &lt;P&gt;The following is the select query of bset table.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2023 12:35:39 GMT</pubDate>
    <dc:creator>pashasapcha</dc:creator>
    <dc:date>2023-11-24T12:35:39Z</dc:date>
    <item>
      <title>read table with condition types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791286#M2024319</link>
      <description>&lt;P&gt; Hi, gurus,&lt;/P&gt;
  &lt;P&gt; I have requirement where I have &lt;STRONG&gt;multiple KSCHL (condition types) in bset table.&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt; I have written the select query with the required condition types as below.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2227153-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;You can see in the above image that multiple kschl we have used in select query.&lt;/P&gt;
  &lt;P&gt;You can see in the below we are using multiple read tables as below.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2227154-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt; Now i have to&lt;STRONG&gt; READ it with each KSCHL which is taken alot of space&lt;/STRONG&gt;. I want to get all the &lt;/P&gt;
  &lt;P&gt; values of ktosl in single read table.&lt;/P&gt;
  &lt;P&gt;I am expecting something like this.&lt;/P&gt;
  &lt;P&gt; READ TABLE lt_bset INTO ls_bset WITH KEY bukrs = ls_bseg-bukrs&lt;/P&gt;
  &lt;P&gt; belnr = ls_bseg-belnr&lt;/P&gt;
  &lt;P&gt;gjahr = ls_bseg-gjahr&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;kschl = 'JICR' and kschl = 'JISR 'and kschl = 'JICN'&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;txgrp = ls_bseg-txgrp.&lt;/P&gt;
  &lt;P&gt; is it possible ?&lt;/P&gt;
  &lt;P&gt; or let me know if there is any way so that I can use only one read table.&lt;/P&gt;
  &lt;P&gt;The following is the select query of bset table.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 12:35:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791286#M2024319</guid>
      <dc:creator>pashasapcha</dc:creator>
      <dc:date>2023-11-24T12:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: read table with condition types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791287#M2024320</link>
      <description>&lt;P&gt;In programming theory, your request would lead to nothing found:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;kschl = 'JICR' and kschl = 'JIsR' and kschl = 'JIcn'&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You should ask:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;kschl = 'JICR' or kschl = 'JIsR' or kschl = 'JIcn'&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Nov 2023 13:26:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791287#M2024320</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-24T13:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: read table with condition types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791288#M2024321</link>
      <description>&lt;P&gt;If your question is about performance (if I understand well "taken alot of space"), you should better say it and not asking how to do something that you think would solve the issue. See &lt;A href="https://en.wikipedia.org/wiki/XY_problem"&gt;XY problem - Wikipedia&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 13:28:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791288#M2024321</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-11-24T13:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: read table with condition types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791289#M2024322</link>
      <description>&lt;P&gt;Add all the condition types in a range table and use it in SELECT WHERE clause(KSCHL in lr_kschl).&lt;/P&gt;&lt;P&gt;Note: The range itab can not be used in READ but you can LOOP the itab and use it in WHERE clause.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP it_bset into ls_bset WHERE ..."othet conditions
                                KSCHL in lr_kschl.
....calculations
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2023 04:11:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791289#M2024322</guid>
      <dc:creator>thilakan_t</dc:creator>
      <dc:date>2023-11-27T04:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: read table with condition types</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791290#M2024323</link>
      <description>&lt;P&gt;You can create a nested table.&lt;/P&gt;&lt;P&gt;First take all key fields and add an additional column as table of KSCHL.&lt;/P&gt;&lt;P&gt;t_kschl type table of ....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select ...&lt;BR /&gt;into table  @data(lt_data)

loop at lt_data into wa_data.
  read table lth_nested assigning field-symbol(&amp;lt;wa_nested&amp;gt;) 
  from corresponding #(wa_data).
  if sy-subrc is not initial.
    insert corresponding #(wa_data) into table lth_nested assigning &amp;lt;wa_nested&amp;gt;. 
  endif.
  insert wa_data-kschl into table  &amp;lt;wa_nested&amp;gt;-t_kschl.
endloop.

read table lth_nested assigning &amp;lt;wa_nested&amp;gt; with table key ...
check sy-subrc is initial.
loop at &amp;lt;wa_nested&amp;gt;-t_kschl into ....
endloop.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2023 15:25:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-condition-types/m-p/12791290#M2024323</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2023-11-27T15:25:23Z</dc:date>
    </item>
  </channel>
</rss>

