Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

logical databases

Former Member
0 Kudos

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.

Please provide me your opinions, examples or some other resource to learn the logical dbs.

Thanks in advance.

Deniz.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

For better understanding refer to

Regards

Bala

3 REPLIES 3

Former Member
0 Kudos

Hi,

For better understanding refer to

Regards

Bala

Former Member
0 Kudos

Hi

In HR we use PNP and PCH ldb's

see the doc

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.

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.

Less coding s required to retrieve data compared to normal internel tables.

Tables used LDB are in hierarchial structure.

Mainly we used LDBs in HR Abap Programming.

Where all tables are highly inter related so LDBs can optimize the performance there.

Check this Document. All abt LDB's

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=...

GO THROUGH LINKS -

http://www.sap-basis-abap.com/saptab.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm

/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases

www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html

www.sap-img.com/abap/abap-interview-question.htm

www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm

Gothru the blog which provides info on LDB's:

/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

HRP1000, HRP1001...etc ->

"Personnel Planning data(info types for PCH ldb)

PA0001, PA0002...etc ->

"HR Master record tables(info types for PNP ldb)

Then below is the porgam for payroll result .... It retreives data from the PNP logical database .

<b>

Note : please palce PNP ldb in the Attributes of the Pogram in the SE38 . and activate the program .</b>

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.

reward points if it is usefull...

Girish