<?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: select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458645#M1250753</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;try using OFFSET on the first two characters of this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX. &lt;/P&gt;&lt;P&gt;If OFFSET(0) CA '0123456789'&lt;/P&gt;&lt;P&gt;AND OFFSET(1) CA '0123456789'.&lt;/P&gt;&lt;P&gt;then the fields you want need not b fetched.&lt;/P&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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: srishti singh on Apr 15, 2009 12:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Apr 2009 10:40:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-15T10:40:27Z</dc:date>
    <item>
      <title>select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458640#M1250748</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;in the report i need to fetch data based on BELNR, BUKRS, GJAHR and ZUONR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is for paricular BELNR,BUKRS AND GJAHR they are alot of ZUONRS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EG:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for a particular &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BELNR  BUKRS  GJAHR   ZUONR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1001      0010     2008        23456&lt;/P&gt;&lt;P&gt;1001      0010     2008        98567&lt;/P&gt;&lt;P&gt;1001      0010     2008       TMI234&lt;/P&gt;&lt;P&gt;1001      0010     2008       CA5673&lt;/P&gt;&lt;P&gt;1001      0010     2008        TK0000&lt;/P&gt;&lt;P&gt;1001      0010    2008         6736&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose i have the data as above in BSEG Table&lt;/P&gt;&lt;P&gt;i need to fetch only the following data based on  ZUONR which contains first 2 letters alphabets&lt;/P&gt;&lt;P&gt;how can i fetch the following data &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BELNR  BUKRS  GJAHR   ZUONR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1001      0010     2008       TMI234&lt;/P&gt;&lt;P&gt;1001      0010     2008       CA5673&lt;/P&gt;&lt;P&gt;1001      0010     2008        TK0000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please see my select query , please help to fetch the data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT   BUKRS&lt;/P&gt;&lt;P&gt;          BELNR&lt;/P&gt;&lt;P&gt;          GJAHR&lt;/P&gt;&lt;P&gt;          DMBTR&lt;/P&gt;&lt;P&gt;          WRBTR&lt;/P&gt;&lt;P&gt;          PSWSL&lt;/P&gt;&lt;P&gt;          ZUONR&lt;/P&gt;&lt;P&gt;          HKONT&lt;/P&gt;&lt;P&gt;          FROM BSEG&lt;/P&gt;&lt;P&gt;          INTO TABLE GT_BSEG&lt;/P&gt;&lt;P&gt;          FOR ALL ENTRIES IN GT_BKPF&lt;/P&gt;&lt;P&gt;          WHERE BUKRS EQ LT_BKPF-BUKRS&lt;/P&gt;&lt;P&gt;          AND   BELNR EQ LT_BKPF-BELNR&lt;/P&gt;&lt;P&gt;          AND   GJAHR EQ LT_BKPF-GJAHR&lt;/P&gt;&lt;P&gt;          AND    ZUONR EQ      .                           "what do i need to put here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE HELP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458640#M1250748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458641#M1250749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT BUKRS
BELNR
GJAHR
DMBTR
WRBTR
PSWSL
ZUONR
HKONT
FROM BSEG
INTO TABLE GT_BSEG
FOR ALL ENTRIES IN GT_BKPF
WHERE BUKRS EQ LT_BKPF-BUKRS
AND BELNR EQ LT_BKPF-BELNR
AND GJAHR EQ LT_BKPF-GJAHR.

Loop at GT_BSEG into &amp;lt;Workarea&amp;gt;.
If &amp;lt;workarea&amp;gt;-ZUONR+0(2) CN SY-ABCDE.          " If first two does not conatins characters delete.
DELETE GT_BSEG.
Endif.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458641#M1250749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458642#M1250750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way of achieving this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS&lt;/P&gt;&lt;P&gt;BELNR&lt;/P&gt;&lt;P&gt;GJAHR&lt;/P&gt;&lt;P&gt;DMBTR&lt;/P&gt;&lt;P&gt;WRBTR&lt;/P&gt;&lt;P&gt;PSWSL&lt;/P&gt;&lt;P&gt;ZUONR&lt;/P&gt;&lt;P&gt;HKONT&lt;/P&gt;&lt;P&gt;FROM BSEG&lt;/P&gt;&lt;P&gt;INTO TABLE GT_BSEG&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN GT_BKPF&lt;/P&gt;&lt;P&gt;WHERE BUKRS EQ LT_BKPF-BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR EQ LT_BKPF-BELNR&lt;/P&gt;&lt;P&gt;AND GJAHR EQ LT_BKPF-GJAHR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at gt_bseg.&lt;/P&gt;&lt;P&gt;if gt_bseg-ZUONR+0(2) ca '0123456789'.&lt;/P&gt;&lt;P&gt;delete gt_bseg index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi kanth Talagana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458642#M1250750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458643#M1250751</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 use '%' symbol as we use '*' in select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND ( ZUONR LIKE 'T%'  or ZUNOR LIKE 'C%' )but there should be some condition to filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:34:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458643#M1250751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458644#M1250752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my tip would be select em all and do your condition afterwards, when looping over it.&lt;/P&gt;&lt;P&gt;I dont think you can get something like "where first 2 characters is numeric" in your select query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:35:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458644#M1250752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458645#M1250753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;try using OFFSET on the first two characters of this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX. &lt;/P&gt;&lt;P&gt;If OFFSET(0) CA '0123456789'&lt;/P&gt;&lt;P&gt;AND OFFSET(1) CA '0123456789'.&lt;/P&gt;&lt;P&gt;then the fields you want need not b fetched.&lt;/P&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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: srishti singh on Apr 15, 2009 12:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:40:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458645#M1250753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458646#M1250754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;Kindly check the following link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2004/helpdata/EN/fc/eb3516358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2004/helpdata/EN/fc/eb3516358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458646#M1250754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458647#M1250755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT BUKRS&lt;/P&gt;&lt;P&gt;BELNR&lt;/P&gt;&lt;P&gt;GJAHR&lt;/P&gt;&lt;P&gt;DMBTR&lt;/P&gt;&lt;P&gt;WRBTR&lt;/P&gt;&lt;P&gt;PSWSL&lt;/P&gt;&lt;P&gt;ZUONR&lt;/P&gt;&lt;P&gt;HKONT&lt;/P&gt;&lt;P&gt;FROM BSEG&lt;/P&gt;&lt;P&gt;INTO TABLE GT_BSEG&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN GT_BKPF&lt;/P&gt;&lt;P&gt;WHERE BUKRS EQ LT_BKPF-BUKRS&lt;/P&gt;&lt;P&gt;AND BELNR EQ LT_BKPF-BELNR&lt;/P&gt;&lt;P&gt;AND GJAHR EQ LT_BKPF-GJAHR.&lt;/P&gt;&lt;P&gt;you need to fetch all values here and then you have see for your condition and delete your records.&lt;/P&gt;&lt;P&gt;loop at gt_bseg.&lt;/P&gt;&lt;P&gt;if gt_bseg-ZUONR+0(2) cn sy-abcde.&lt;/P&gt;&lt;P&gt;delete gt_bseg.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 10:46:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/5458647#M1250755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T10:46:40Z</dc:date>
    </item>
  </channel>
</rss>

