Saturday, March 29, 2014
We use logical database(s) for most of the SAP HR Programs. Available ldb are PNP/PNPCE. PCH, PAP. Find the features of LDB here.
How To Create SAP ABAP HR Reports Using A Logical Database (LDB).
Step 1: Create an executable program.
- Go to SE38 transaction code.
- Create program ZTEST_LDB_PRORGRAM. (1) Provide meaningful report Title (2) select Type as Executable Program (3) provide Logical Database as PNP and SAVE. Save as local / transportable.
Step 2: Assign the Report category.
- Report Category specify which master data fields to be displayed on selection-screen. When you assign logical database PNP to the program, default report category is assigned. The selection-screen of the default report category.
- Creation of the new Report Category.
- Steps to change default Report category to other category.
Step 3: ABAP Source code in the LDB program:
- Simple ABAP program with pnp logical database.
REPORT ztest_ldb_program. NODES: pernr. INFOTYPES: 0001,0002,0006. START-OF-SELECTION. GET pernr. rp-provide-from-last p0002 space pn-begda pn-endda. IF pnp-sw-found = '1'. WRITE: p0002-pernr, p0002-vorna, p0002-nachn. ENDIF. END-OF-SELECTION.
- NODES pernr: We have to know about NODES statement. NODES statement is to pass data from logical databases to executable programs. Basically it defines an interface work area(In this case PERNR is workarea) and is allowed only in the global declaration section of executable programs that are associated with a logical database.
- PERNR structure at SE11* .
- INFOTYPES statement: It is used to define an internal table for HR Infotypes. When you define INFOTYPES 0001, An internal table P0001 is created with the structure of the info type P0001 and a header.
- Standard LDB Selection Screen: When you use logical database selection screen, ldb PNP program filters employees based on selection input.
- When you use custom Selection fields along with logical database selection, filtering needs to be taken in our custom program .
- GET pernr event: This event has to be used when program is associated with logical data base. When you run the program, When GET pernr event is triggered, the interface workarea(PERNR) defined with NODES statement is populated and also all the tables defined using INFOTYPES statement also populated with data for one employee. One employee information is available until END-OF-SELECTION event. GET pernr event is triggered for each employee selected based on the selection screen input.
- Macro are used in HR LDB programs. All macro definitions are found in Include DBPNPMAC. RP-PROVIDE-FROM-LAST macro is used to get latest record in the given period(PN-BEGDA and PN-ENNDA). Find all useful Macros in HR ABAP.
Step 4. Activate and Test the program
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
Thanks for your Valuable information.
ReplyDelete