<?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: logical databases in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550269#M580619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HRP1000, HRP1001...etc -&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"Personnel Planning data(info types for PCH ldb)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PA0001, PA0002...etc -&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"HR Master record tables(info types for PNP ldb)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then  below  is the porgam for payroll  result  ....   It retreives data from the PNP logical  database  .  &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Note : please   palce PNP ldb  in the   Attributes  of the Pogram in  the   SE38 . and activate the program   .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZPAYROLL_RESULTS.

NODES: pernr.
INFOTYPES: 0000, 0001, 2001.

TABLES: t554s, pcl1, pcl2.

INCLUDE rpclst00.
INCLUDE rpc2rx09.                      "Payroll results datadefns-Intl.
INCLUDE rpc2rxx0.                      "Payroll results datadefns-Intl.
INCLUDE rpc2rgg0.                      "Payroll results datadefns-GB
INCLUDE rpcfdcg0.                      "Payroll results datadefns-GB
INCLUDE rpcdatg0.
INCLUDE rpc2cd00.                      "Cluster Directory defns.
INCLUDE rpc2ps00.                      "Cluster: Generierte Schematas
INCLUDE rpc2pt00.
INCLUDE rpcfdc10.
INCLUDE rpcfdc00.
INCLUDE rpppxd00.
INCLUDE rpppxd10.
INCLUDE rpcfvp09.
INCLUDE rpcfvpg0.
INCLUDE rpppxm00.

TYPES: BEGIN OF t_salrate,
    seqnr    TYPE pc261-seqnr,
    begda    TYPE p2001-begda,
    endda    TYPE p2001-endda,
    split(2) TYPE c,
    val      TYPE p DECIMALS 2,
   END OF t_salrate.
DATA: it_salrate TYPE STANDARD TABLE OF t_salrate INITIAL SIZE 0,
      wa_salrate TYPE t_salrate.


*Selection screen
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: so_awart FOR p2001-awart.
SELECTION-SCREEN END OF BLOCK block1.

************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.

GET pernr.

* get payroll results data
  rp-init-buffer.
  CLEAR rgdir. REFRESH rgdir.
  CLEAR rt. REFRESH rt.
  CLEAR: rx-key.

* set key to current pernr
  MOVE pernr-pernr(8) TO cd-key-pernr.

* retrieves payroll results for specific pernr(personnel number)
  rp-imp-c2-cd.

  IF rp-imp-cd-subrc = 0.                                "rgdir success
    rx-key-pernr = pernr-pernr.
    SORT rgdir BY seqnr ASCENDING.
    CLEAR rgdir.
  ENDIF.

  SORT rgdir BY fpbeg fpend ASCENDING seqnr DESCENDING.
* RGDIR the table where all payroll results periods are stored
  LOOP AT rgdir WHERE  abkrs IN pnpabkrs        "pay area
                  AND  srtza EQ 'A'
                  AND  void  NE 'V'.

    IF sy-subrc NE 0.
*     set key to specific payroll results period(current RGDIR loop pass)
      UNPACK rgdir-seqnr   TO   rx-key-seqno.

*     Retrieves data for specific payroll results period (current RGDIR
*     loop pass)
      rp-imp-c2-rg.

*     Loop at wpbp data for specific payroll results period
      LOOP AT wpbp.
        wa_salrate-seqnr = rgdir-seqnr.
        wa_salrate-begda = wpbp-begda.
        wa_salrate-endda = wpbp-endda.
        wa_salrate-split = wpbp-apznr.
*       loop at rt data for specific payroll results period
        LOOP AT rt WHERE lgart EQ '/010' AND             "wage type
                         apznr EQ wpbp-apznr.            "payroll split
          wa_salrate-val = ( rt-betpe * ( wpbp-adivi / wpbp-kdivi ) ).
          APPEND wa_salrate TO it_salrate.
        ENDLOOP.
      ENDLOOP.

*     Process BT table
      LOOP AT BT.
      ENDLOOP.

*     Process NIPAY table
      LOOP AT NIPAY.
      ENDLOOP.

*     etc................
    ENDIF.
  ENDLOOP.


************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points if it is usefull...&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jul 2007 10:51:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-19T10:51:39Z</dc:date>
    <item>
      <title>logical databases</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550266#M580616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To write reports of the Human resources department, I am told that we use mainly logical databases. And I have to write reports about HR but do not have comprehensive info on logical db.&lt;/P&gt;&lt;P&gt;Please provide me your opinions, examples or some other resource to learn the logical dbs.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Deniz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550266#M580616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: logical databases</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550267#M580617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  For better understanding refer to &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="458313"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:39:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550267#M580617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: logical databases</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550268#M580618</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;In HR we use PNP and PCH ldb's &lt;/P&gt;&lt;P&gt;see the doc &lt;/P&gt;&lt;P&gt;A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LDB offers an easy-to-use selection screens. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections. It contains central authorization checks for data base accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Less coding s required to retrieve data compared to normal internel tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables used LDB are in hierarchial structure.&lt;/P&gt;&lt;P&gt;Mainly we used LDBs in HR Abap Programming.&lt;/P&gt;&lt;P&gt;Where all tables are highly inter related so LDBs can optimize the performance there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this Document. All abt LDB's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2flibrary%2fabap%2fabap-code-samples%2fldb+browser.doc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2flibrary%2fabap%2fabap-code-samples%2fldb+browser.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GO THROUGH LINKS - &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-basis-abap.com/saptab.htm" target="test_blank"&gt;http://www.sap-basis-abap.com/saptab.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3110478"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html" target="test_blank"&gt;www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sap-img.com/abap/abap-interview-question.htm" target="test_blank"&gt;www.sap-img.com/abap/abap-interview-question.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm" target="test_blank"&gt;www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Gothru the blog which provides info on LDB's:&lt;/P&gt;&lt;P&gt;/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for useful Answers&amp;lt;/b&amp;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>Thu, 19 Jul 2007 10:43:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550268#M580618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: logical databases</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550269#M580619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HRP1000, HRP1001...etc -&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"Personnel Planning data(info types for PCH ldb)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PA0001, PA0002...etc -&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"HR Master record tables(info types for PNP ldb)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then  below  is the porgam for payroll  result  ....   It retreives data from the PNP logical  database  .  &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Note : please   palce PNP ldb  in the   Attributes  of the Pogram in  the   SE38 . and activate the program   .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZPAYROLL_RESULTS.

NODES: pernr.
INFOTYPES: 0000, 0001, 2001.

TABLES: t554s, pcl1, pcl2.

INCLUDE rpclst00.
INCLUDE rpc2rx09.                      "Payroll results datadefns-Intl.
INCLUDE rpc2rxx0.                      "Payroll results datadefns-Intl.
INCLUDE rpc2rgg0.                      "Payroll results datadefns-GB
INCLUDE rpcfdcg0.                      "Payroll results datadefns-GB
INCLUDE rpcdatg0.
INCLUDE rpc2cd00.                      "Cluster Directory defns.
INCLUDE rpc2ps00.                      "Cluster: Generierte Schematas
INCLUDE rpc2pt00.
INCLUDE rpcfdc10.
INCLUDE rpcfdc00.
INCLUDE rpppxd00.
INCLUDE rpppxd10.
INCLUDE rpcfvp09.
INCLUDE rpcfvpg0.
INCLUDE rpppxm00.

TYPES: BEGIN OF t_salrate,
    seqnr    TYPE pc261-seqnr,
    begda    TYPE p2001-begda,
    endda    TYPE p2001-endda,
    split(2) TYPE c,
    val      TYPE p DECIMALS 2,
   END OF t_salrate.
DATA: it_salrate TYPE STANDARD TABLE OF t_salrate INITIAL SIZE 0,
      wa_salrate TYPE t_salrate.


*Selection screen
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: so_awart FOR p2001-awart.
SELECTION-SCREEN END OF BLOCK block1.

************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.

GET pernr.

* get payroll results data
  rp-init-buffer.
  CLEAR rgdir. REFRESH rgdir.
  CLEAR rt. REFRESH rt.
  CLEAR: rx-key.

* set key to current pernr
  MOVE pernr-pernr(8) TO cd-key-pernr.

* retrieves payroll results for specific pernr(personnel number)
  rp-imp-c2-cd.

  IF rp-imp-cd-subrc = 0.                                "rgdir success
    rx-key-pernr = pernr-pernr.
    SORT rgdir BY seqnr ASCENDING.
    CLEAR rgdir.
  ENDIF.

  SORT rgdir BY fpbeg fpend ASCENDING seqnr DESCENDING.
* RGDIR the table where all payroll results periods are stored
  LOOP AT rgdir WHERE  abkrs IN pnpabkrs        "pay area
                  AND  srtza EQ 'A'
                  AND  void  NE 'V'.

    IF sy-subrc NE 0.
*     set key to specific payroll results period(current RGDIR loop pass)
      UNPACK rgdir-seqnr   TO   rx-key-seqno.

*     Retrieves data for specific payroll results period (current RGDIR
*     loop pass)
      rp-imp-c2-rg.

*     Loop at wpbp data for specific payroll results period
      LOOP AT wpbp.
        wa_salrate-seqnr = rgdir-seqnr.
        wa_salrate-begda = wpbp-begda.
        wa_salrate-endda = wpbp-endda.
        wa_salrate-split = wpbp-apznr.
*       loop at rt data for specific payroll results period
        LOOP AT rt WHERE lgart EQ '/010' AND             "wage type
                         apznr EQ wpbp-apznr.            "payroll split
          wa_salrate-val = ( rt-betpe * ( wpbp-adivi / wpbp-kdivi ) ).
          APPEND wa_salrate TO it_salrate.
        ENDLOOP.
      ENDLOOP.

*     Process BT table
      LOOP AT BT.
      ENDLOOP.

*     Process NIPAY table
      LOOP AT NIPAY.
      ENDLOOP.

*     etc................
    ENDIF.
  ENDLOOP.


************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points if it is usefull...&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 10:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logical-databases/m-p/2550269#M580619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T10:51:39Z</dc:date>
    </item>
  </channel>
</rss>

