<?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: query help in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930770#M385584</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 pass KOSTL and DATE to teh query, as these are fields it will bring u the correct records if u pass all teh key field values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Feb 2007 12:20:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-19T12:20:30Z</dc:date>
    <item>
      <title>query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930767#M385581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working ona query to get the unique cost center record populated into a internal table for a particular perosnnel area (WERKS) I used CSKS table to retieve the cost centers supervised by a particular person. But the person is responsible for multiple personnel areas. But I want the list of cost centers that for a particular personnel area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the code &lt;/P&gt;&lt;P&gt;select * from csks  where kokrs = 'ABC '  and BUKRS = '0100'&lt;/P&gt;&lt;P&gt;          and GSBER = '0100'  and Name2 = v_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this gave all the cost centers the person was holding including the records outside the required personnel areas that led me to extra records.&lt;/P&gt;&lt;P&gt;there is field WERKS here but is not populated.&lt;/P&gt;&lt;P&gt;hence I tried to join this with pa0001 to restrict the cost center records to a particular area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select distinct csks~kostl into v_kostl from csks inner join&lt;/P&gt;&lt;P&gt;   pa0001 on csks&lt;SUB&gt;bukrs = pa0001&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;     and csks&lt;SUB&gt;gsber = pa0001&lt;/SUB&gt;gsber&lt;/P&gt;&lt;P&gt;     where csks~bukrs = '0100'&lt;/P&gt;&lt;P&gt;      and csks~gsber ='0100'&lt;/P&gt;&lt;P&gt;      and csks~Name2 = v_name&lt;/P&gt;&lt;P&gt;      and pa0001~werks = 'BA01'.&lt;/P&gt;&lt;P&gt;The query is not returning the right records. Is there a different table that I can use to validate or am I missing something here?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2007 23:04:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930767#M385581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-16T23:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930768#M385582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   I think there is a small issue with your join statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it joins the two tables on following criterion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;csks&lt;SUB&gt;bukrs = pa0001&lt;/SUB&gt;bukrs&lt;/P&gt;&lt;P&gt;and csks&lt;SUB&gt;gsber = pa0001&lt;/SUB&gt;gsber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should add one more condition &lt;/P&gt;&lt;P&gt;as csks&lt;SUB&gt;name2 = pa0001&lt;/SUB&gt;sname&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will reduce the reocrds for particular user.&lt;/P&gt;&lt;P&gt;and after this your selecttion criterion of "name2 = v_name" and &lt;/P&gt;&lt;P&gt;pa0001~werks = 'BA01'&lt;/P&gt;&lt;P&gt;will give you the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you..&lt;/P&gt;&lt;P&gt;Award reward points to helpful answers &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2007 11:57:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930768#M385582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-19T11:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930769#M385583</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;If at all you need the Unique Cost center of an Employee it is present in PA0001 infotype. Why to use CSKS table or why to join it with PA0001 infotype.&lt;/P&gt;&lt;P&gt;All the required fields like KOKRS, GSBER, WERKS,SNAME,BUKRS  ETC ARE PRESENT IN pa0001. So if you write a Select on PA0001 alone will give you the necessary info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2007 12:16:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930769#M385583</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-19T12:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930770#M385584</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 pass KOSTL and DATE to teh query, as these are fields it will bring u the correct records if u pass all teh key field values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2007 12:20:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930770#M385584</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-19T12:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930771#M385585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for everyone's reply, sorry responding a bit late.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is why I need CSKS- it has the list of cost centers and person responsible for those cost centers from csks-name2 which is the requirement for my report. Hence I cannot just go for PA0001 - where Pa0001-sname is not equal to csks-name2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason to go after PA0001 was to get the personnel area which is not avaiable in CSKS. Because for my report I need list of cost centers for that department(based on the personnel area) and it can so happen that a single person can be responsible for several cost centers across different personnel areas which is what is now happening. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is giving me a list of cost centers outside that. Anwya I figured it out. &lt;/P&gt;&lt;P&gt;I shall award the points here.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2007 14:57:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-help/m-p/1930771#M385585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-21T14:57:15Z</dc:date>
    </item>
  </channel>
</rss>

