<?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: Regarding logical data base tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456060#M215593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;HEREWITH I AM GIVING SOME LINKS OF SAMPLE HR REPORT, GO THROUGH THEM I HOPE YOU WILL GET SOME IDEA FOR YOUR PROBLEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/hr021.htm" target="test_blank"&gt;http://www.sap-img.com/hr021.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html" target="test_blank"&gt;http://sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;MRUTYUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jun 2006 03:39:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-21T03:39:38Z</dc:date>
    <item>
      <title>Regarding logical data base tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456055#M215588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am working on abap-hr. i want to know how to retrieve data from two different hr-database tables to two different internal tables and then send it to final internal table.can any one plz give me sample hr code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your help is rewarded with points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;rad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 02:01:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456055#M215588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T02:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding logical data base tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456056#M215589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just select the data from each db table into a corresponding internal table, then loop at the first one move the fields that you want to the 3rd internal table structure, then loop at the other internal table where the keys match and move the other data, then APPEND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001.


data: ipa0001 type table of pa0001 with header line.
data: ipa0002 type table of pa0002 with header line.

data: begin of ipa occurs 0,
      pernr type pa0001-pernr,
      persg type pa0001-persg,
      nachn type pa0002-nachn,
      vorna type pa0002-vorna,
      end of ipa.

select * into table ipa0001 from pa0001.
select * into table ipa0002 from pa0002.


loop at ipa0001.
  clear ipa.
  ipa-pernr = ipa0001.
  ipa-persg = ipa0001.

  loop at ipa0002 where pernr = ipa0001-pernr.
    ipa-nachn = ipa0002-nachn.
    ipa-vorna = ipa0002-vorna.
    append ipa.
  endloop.
endloop.

loop at ipa.
  write:/ ipa.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course this could also be done with an INNER JOIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oops.  Totally missed that you were referring to LDBs. &lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 02:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456056#M215589</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T02:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding logical data base tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456057#M215590</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 you are using logical databases, then you don't have to give any SELECT statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. For getting the personnel number, you use PNP logical database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Declare infotypes of the 2 tables from which you need to fetch data, say for 0000, 0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Use the event GET PERNR in START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you do this, an internal table will be created and will be populated with all pernr for the declared infotypes in P0000, P0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. at the event END-OF-SELECTION, GET PERNR will be triggered and next pernr will be fetched and the internal tables with that pernr will be populated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use these internal tables for getting the desired records by using the macros,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAMPLE CODE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;infotypes: 0000, 0001, 0002.&lt;/P&gt;&lt;P&gt;tables: pa0000, pa0001, PERNR.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;          .....&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start-of-selection&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  GET PERNR.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if no record is found then exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF PNP-SW-FOUND = 1.&lt;/P&gt;&lt;P&gt;    ITAB-PERNR  = PERNR-PERNR.      "Emp no&lt;/P&gt;&lt;P&gt;    ITAB-BUKRS  = P0001-BUKRS.      "Company code&lt;/P&gt;&lt;P&gt;    ITAB-WERKS  = P0001-WERKS.      "Personnel area&lt;/P&gt;&lt;P&gt;    ITAB-BTRTL  = P0001-BTRTL.      "Personnel sub-area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; RP-PROVIDE-FROM-LAST P0002 SPACE PN-BEGDA PN-ENDDA.&lt;/P&gt;&lt;P&gt;  if pnp-sw-found = 1.&lt;/P&gt;&lt;P&gt;    ITAB-VORNA  = P0002-VORNA.&lt;/P&gt;&lt;P&gt;    ITAB-NACHN  = P0002-NACHN.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.     &lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;  END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this will fetch the last record. if you need to fetch all records then you can loop P0001 and get the values for that particular pernr.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; loop at P0001.&lt;/P&gt;&lt;P&gt;  itab-pernr = pernr-pernr.&lt;/P&gt;&lt;P&gt;  itab-werks = P0001-werks.&lt;/P&gt;&lt;P&gt;  .......&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;Navneeth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: If not clear, please let me know.&lt;/P&gt;&lt;P&gt;Message was edited by: Navneeth Saraogi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 02:20:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456057#M215590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T02:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding logical data base tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456058#M215591</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 have Used PNP logical database and for each PERNR Select name of the employee.Please look at the following sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : pernr.&lt;/P&gt;&lt;P&gt;data : first_name like pa0002-vorna,&lt;/P&gt;&lt;P&gt;       last_name like pa0002-nachn,&lt;/P&gt;&lt;P&gt;       full_name(50),&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; get pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ********&lt;STRONG&gt;FULL NAME OF EMPLOYEE&lt;/STRONG&gt;*************&lt;/P&gt;&lt;P&gt;*****FIRST NAME&lt;/P&gt;&lt;P&gt;select single vorna&lt;/P&gt;&lt;P&gt;              from pa0002&lt;/P&gt;&lt;P&gt;              into first_name&lt;/P&gt;&lt;P&gt;              where pernr = pernr-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****LAST NAME&lt;/P&gt;&lt;P&gt;select single nachn&lt;/P&gt;&lt;P&gt;              from pa0002&lt;/P&gt;&lt;P&gt;              into last_name&lt;/P&gt;&lt;P&gt;              where pernr = pernr-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****FULL NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate first_name '' last_name into full_name.&lt;/P&gt;&lt;P&gt;it_final-empnam = full_name.&lt;/P&gt;&lt;P&gt;append it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pramod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 02:20:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456058#M215591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T02:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding logical data base tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456059#M215592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; There is another example where i'have used BRM LDB and used GET events on header and  Item tables.The following code pulls the record for CD doc. type and other doc type incase profit center is blank in BSEG table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : bkpf,bseg,glpca.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:s_glacc FOR  bseg-hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET bseg.&lt;/P&gt;&lt;P&gt; CHECK bseg-prctr = space .&lt;/P&gt;&lt;P&gt; CHECK bseg-hkont IN s_glacc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF bkpf-blart = 'CD'.&lt;/P&gt;&lt;P&gt;      w_refdocnr  = bkpf-awkey(10).&lt;/P&gt;&lt;P&gt;      w_aworg = bkpf-awkey+10(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT SINGLE * FROM glpca&lt;/P&gt;&lt;P&gt;         INTO wa_glpca&lt;/P&gt;&lt;P&gt;         WHERE ryear = bseg-gjahr&lt;/P&gt;&lt;P&gt;         AND refdocnr = w_refdocnr&lt;/P&gt;&lt;P&gt;                AND  aworg =  w_aworg&lt;/P&gt;&lt;P&gt;                AND  refdocln = bseg-buzei&lt;/P&gt;&lt;P&gt;                AND  rbukrs = bkpf-bukrs.&lt;/P&gt;&lt;P&gt; ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT SINGLE * FROM glpca&lt;/P&gt;&lt;P&gt;         INTO wa_glpca&lt;/P&gt;&lt;P&gt;         WHERE ryear = bseg-gjahr&lt;/P&gt;&lt;P&gt;            AND  refdocnr = bseg-belnr&lt;/P&gt;&lt;P&gt;            AND  refdocln = bseg-buzei&lt;/P&gt;&lt;P&gt;            AND  rbukrs   = bkpf-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this code will give  you direction to proceed further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pramod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 02:47:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456059#M215592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T02:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding logical data base tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456060#M215593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;HEREWITH I AM GIVING SOME LINKS OF SAMPLE HR REPORT, GO THROUGH THEM I HOPE YOU WILL GET SOME IDEA FOR YOUR PROBLEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/hr021.htm" target="test_blank"&gt;http://www.sap-img.com/hr021.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html" target="test_blank"&gt;http://sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;MRUTYUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 03:39:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-logical-data-base-tables/m-p/1456060#M215593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T03:39:38Z</dc:date>
    </item>
  </channel>
</rss>

