<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ABAP Tutorials &#187; PNP</title>
	<atom:link href="http://www.abap-tutorials.com/tag/pnp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abap-tutorials.com</link>
	<description>ABAP Tutorials, Guides, Training, Manuals</description>
	<lastBuildDate>Thu, 17 Nov 2011 07:43:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>ABAP HR program to download Employee data</title>
		<link>http://www.abap-tutorials.com/2009/12/11/abap-hr-program-to-download-employee-data/</link>
		<comments>http://www.abap-tutorials.com/2009/12/11/abap-hr-program-to-download-employee-data/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 07:12:31 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP HR]]></category>
		<category><![CDATA[Function Modules]]></category>
		<category><![CDATA[Report]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Upload Download]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[employee data]]></category>
		<category><![CDATA[logical database]]></category>
		<category><![CDATA[PNP]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1153</guid>
		<description><![CDATA[Following program downloads Employee Data into Excel file(.xls). The selection criteria can be specified at the run time. It also uses Logical Database &#8216;PNP&#8217; ( to be specified in the program attributes) to retrieve various personnel data.       Program Code:   REPORT zdownempdata . INFOTYPES: 0000, 0001, 0007, 0008, 0121, 0615. NODES: pernr. TABLES: t001p. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Following program downloads Employee Data into Excel file(.xls). The selection criteria can be specified at the run time. It also uses Logical Database &#8216;PNP&#8217; ( to be specified in the program attributes) to retrieve various personnel data.</p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1154" title="download_empl_data" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/download_empl_data.jpg" alt="download_empl_data" width="614" height="445" /></div>
<p> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><span id="more-1153"></span></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong><span style="color: #3366ff;">Program Code: </span></strong></p>
<p> </p>
<pre lang="ABAP">REPORT  zdownempdata  .

INFOTYPES: 0000, 0001, 0007, 0008, 0121, 0615.
NODES: pernr.
TABLES: t001p.

TYPES: BEGIN OF t_employee,
*        INCLUDE STRUCTURE hrms_biw_io_occupancy.
  begda	TYPE begda,
  endda	TYPE endda,
  pernr	TYPE pernr_d,
  rfpnr	TYPE rfpnr,
  bukrs	TYPE bukrs,
  werks	TYPE persa,
  btrtl	TYPE btrtl,
  persg	TYPE persg,
  persk	TYPE persk,
  orgeh	TYPE orgeh,
  stell	TYPE stell,
  plans	TYPE plans,
  kokrs	TYPE mast_coar,
  kostl	TYPE mast_cctr,
  abkrs	TYPE abkrs,
  molga	TYPE molga,
  trfar	TYPE trfar,
  trfgb	TYPE trfgb,
  trfkz	TYPE trfkz,
  trfgr	TYPE trfgr,
  trfst	TYPE trfst,
  bsgrd	TYPE bsgrd,
  ansal	TYPE ansal_15,
  ancur	TYPE ancur,
  empct	TYPE empct,
  stat2	TYPE stat2,
  ncsdate     TYPE hiredate,
  sltyp	TYPE p_sltyp,
  slreg	TYPE p_slreg,
  slgrp	TYPE p_slgrp,
  sllev	TYPE p_sllvl,
  ansvh	TYPE ansvh,
  vdsk1	TYPE vdsk1,
  sname	TYPE smnam,
 END OF t_employee.
DATA: it_employee TYPE STANDARD TABLE OF t_employee INITIAL SIZE 0,
      wa_employee TYPE t_employee.

TYPES: BEGIN OF t_emptexts,
*        INCLUDE STRUCTURE hrms_bw_txt_employee.
  DATEFROM  TYPE RSDATEFROM,
  DATETO  TYPE RSDATETO,
  PERNR	TYPE PERSNO,
  TXTMD	TYPE EMNAM,
 END OF t_emptexts.
DATA: it_emptexts TYPE STANDARD TABLE OF t_emptexts INITIAL SIZE 0,
      wa_emptexts TYPE t_emptexts.

TYPES: BEGIN OF t_contract,
*        INCLUDE STRUCTURE pa0615.
  pernr TYPE p0615-pernr,
  begda TYPE p0615-begda,
  endda TYPE p0615-endda,
  aedtm TYPE p0615-aedtm,
  ctype TYPE p0615-ctype,
  cbeg  TYPE p0615-cbeg,
  cend  TYPE p0615-cend,
 END OF t_contract.
DATA: it_contract TYPE STANDARD TABLE OF t_contract INITIAL SIZE 0,
      wa_contract TYPE t_contract.

DATA: it_tabemp TYPE filetable,
      gd_subrcemp TYPE i,
      it_tabempt TYPE filetable,
      gd_subrcempt TYPE i,
      it_tabcont TYPE filetable,
      gd_subrccont TYPE i.

DATA: gd_downfile TYPE string.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_emp   LIKE rlgrap-filename,
            p_empt  LIKE rlgrap-filename,
            p_cont LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK block1.

***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_emp.

  REFRESH: it_tabemp.
  CALL METHOD cl_gui_frontend_services=&gt;file_open_dialog
    EXPORTING
      window_title      = 'Select File'
      default_filename  = '*.xls'
      initial_directory = 'C:\'
      multiselection    = ' '  "No multiple selection
    CHANGING
      file_table        = it_tabemp
      rc                = gd_subrcemp.

  LOOP AT it_tabemp INTO p_emp.
  ENDLOOP.

***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_empt.

  REFRESH: it_tabemp.
  CALL METHOD cl_gui_frontend_services=&gt;file_open_dialog
    EXPORTING
      window_title      = 'Select File'
      default_filename  = '*.xls'
      initial_directory = 'C:\'
      multiselection    = ' '  "No multiple selection
    CHANGING
      file_table        = it_tabempt
      rc                = gd_subrcempt.

  LOOP AT it_tabempt INTO p_empt.
  ENDLOOP.

***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cont.

  REFRESH: it_tabcont.
  CALL METHOD cl_gui_frontend_services=&gt;file_open_dialog
    EXPORTING
      window_title      = 'Select File'
      default_filename  = '*.xls'
      initial_directory = 'C:\'
      multiselection    = ' '  "No multiple selection
    CHANGING
      file_table        = it_tabcont
      rc                = gd_subrccont.

  LOOP AT it_tabcont INTO p_cont.
  ENDLOOP.

************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.

GET pernr.
* Selecting the latest infotype record
  rp_provide_from_last p0000 space pn-begda pn-endda.
  rp_provide_from_last p0001 space pn-begda pn-endda.
  rp_provide_from_last p0007 space pn-begda pn-endda.
  rp_provide_from_last p0008 space pn-begda pn-endda.
  rp_provide_from_last p0121 space pn-begda pn-endda.
  rp_provide_from_last p0615 space pn-begda pn-endda.

  MOVE-CORRESPONDING p0001 TO wa_employee.
  wa_employee-rfpnr = p0121-rfp01. "?????

  MOVE-CORRESPONDING p0007 TO wa_employee.
  MOVE-CORRESPONDING p0008 TO wa_employee.
  MOVE-CORRESPONDING p0000 TO wa_employee.

  SELECT SINGLE molga
    FROM t001p
    INTO wa_employee-molga
   WHERE werks EQ p0001-werks AND
         btrtl EQ p0001-btrtl.

  SELECT SINGLE trfkz
    FROM t503
    INTO wa_employee-trfkz
   WHERE persg EQ p0001-persg AND
         persk EQ p0001-persk.

  CALL FUNCTION 'HR_ENTRY_DATE'
    EXPORTING
      persnr                     = pernr-pernr
*   RCLAS                      =
*   BEGDA                      = '18000101'
*   ENDDA                      = '99991231'
*   VARKY                      =
   IMPORTING
      entrydate                  = wa_employee-ncsdate
* TABLES
*   ENTRY_DATES                =
 EXCEPTIONS
   ENTRY_DATE_NOT_FOUND       = 1
   PERNR_NOT_ASSIGNED         = 2
   OTHERS                     = 3
            .
  IF sy-subrc &lt;&gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* append employee data
  APPEND wa_employee TO it_employee.
  CLEAR: wa_employee.

  wa_emptexts-datefrom = p0001-begda.
  wa_emptexts-dateto   = p0001-endda.
  wa_emptexts-pernr    = p0001-pernr.
  wa_emptexts-txtmd    = p0001-ename.

* append employee texts data
  APPEND wa_emptexts TO it_emptexts.
  CLEAR: wa_emptexts.

  MOVE-CORRESPONDING p0615 TO wa_contract.
* append employee contract data
  APPEND wa_contract TO it_contract.
  CLEAR: wa_contract.

************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.

* download employee data
  IF NOT p_emp IS INITIAL.
    gd_downfile = p_emp.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = gd_downfile
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = it_employee.
    IF sy-subrc EQ 0.
      WRITE:/ 'Employee file downloaded to',
              gd_downfile.
    ELSE.
      WRITE:/ 'There was an error downloading Employee file to',
              gd_downfile.
    ENDIF.
  ENDIF.

* download employee texts data
  IF NOT p_empt IS INITIAL.
    gd_downfile = p_empt.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = gd_downfile
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = it_emptexts.
    IF sy-subrc EQ 0.
      WRITE:/ 'Employee text file downloaded to',
              gd_downfile.
    ELSE.
      WRITE:/ 'There was an error downloading Employee text file to',
              gd_downfile.
    ENDIF.
  ENDIF.

* download contract data
  IF NOT p_cont IS INITIAL.
    gd_downfile = p_cont.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = gd_downfile
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = it_contract.
    IF sy-subrc EQ 0.
      WRITE:/ 'Employee contract file downloaded to',
              gd_downfile.
    ELSE.
WRITE:/ 'There was an error downloading Employee contract file to',
              gd_downfile.
    ENDIF.
  ENDIF.</pre>
<p> </p>
<p>Before execution the program, browse for the file path and provide file name for files Employee Data, Employee Data Texts, and Employee Contract Data.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1158" title="download_empl_data2" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/download_empl_data2.jpg" alt="download_empl_data2" width="450" height="335" /></p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/11/20/macros-in-abap-hr-programming-i/' rel='bookmark' title='Macros in ABAP-HR Programming &#8211; I'>Macros in ABAP-HR Programming &#8211; I</a></li>
<li><a href='http://www.abap-tutorials.com/2009/12/07/maintain-hr-report-category/' rel='bookmark' title='Create HR Report Category in SAP'>Create HR Report Category in SAP</a></li>
<li><a href='http://www.abap-tutorials.com/2010/05/25/bdc-to-insert-wage-type-in-infotype-0008/' rel='bookmark' title='BDC to insert Wage Type in Infotype 0008 (Basic Pay)'>BDC to insert Wage Type in Infotype 0008 (Basic Pay)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2009/12/11/abap-hr-program-to-download-employee-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create HR Report Category in SAP</title>
		<link>http://www.abap-tutorials.com/2009/12/07/maintain-hr-report-category/</link>
		<comments>http://www.abap-tutorials.com/2009/12/07/maintain-hr-report-category/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 07:28:43 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP HR]]></category>
		<category><![CDATA[Report]]></category>
		<category><![CDATA[Selection-Screen]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[logical database]]></category>
		<category><![CDATA[PNP]]></category>
		<category><![CDATA[Report Category]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1129</guid>
		<description><![CDATA[Creating / Maintaining a Report Category is one of the important task in ABAP HR when handling Logical Databases. Report Category provides an added flexibility in term of field selection to be displayed on screen and the handling of fields in the back-end.       The steps for Creating/Using Report category can be defined as [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Creating / Maintaining a Report Category is one of the important task in ABAP HR when handling Logical Databases. Report Category provides an added flexibility in term of field selection to be displayed on screen and the handling of fields in the back-end.</p>
<p style="text-align: justify;"> </p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1140" title="rep_cat8" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat81.jpg" alt="rep_cat8" width="468" height="285" /></div>
<p> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><span id="more-1129"></span></p>
<p style="text-align: justify;">The steps for Creating/Using Report category can be defined as follows:</p>
<p style="text-align: justify;">1.  Create a program using the transaction SE38. </p>
<p style="text-align: justify;"> </p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1132" title="rep_cat1" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat1.jpg" alt="rep_cat1" width="448" height="276" /></div>
<p> </p>
<p style="text-align: justify;">Provide the logical database name as <strong>PNP</strong>. Click on SAVE. </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">2. Then again follow this menu path<strong>&#8212;&gt;GOTO&#8212;-&gt;ATTRIBUTES.</strong></p>
<p style="text-align: justify;"><strong> </strong></p>
<p><strong></p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1133" title="rep_cat2" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat2.jpg" alt="rep_cat2" width="468" height="285" /></div>
<p></strong></p>
<p> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">3. Click on the button <strong>HR report category </strong>to use the<strong> </strong>existing<strong> </strong>report category.</p>
<p style="text-align: justify;"> </p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1134" title="rep_cat3" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat3.jpg" alt="rep_cat3" width="459" height="315" /></div>
<p> </p>
<p style="text-align: justify;">Select the radio button “Master Data (Infotypes)&#8221;.</p>
<p style="text-align: justify;"> </p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1135" title="rep_cat4" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat4.jpg" alt="rep_cat4" width="459" height="315" /></div>
<p> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong><span style="color: #3366ff;">Creating HR report category  </span></strong></p>
<p style="text-align: justify;">1. Click on HR report category</p>
<p>Give name of the <strong>HR report category</strong> to be create like ____0001(4 underscores 3 zeros 1) here <strong>follow the standards for creating the HR report category</strong>.  </p>
<p>To create new HR report category, click on<strong> new entries</strong></p>
<p>Give the <strong>report</strong> <strong>category name   :  ____0002  (this is an example )</strong></p>
<p><strong>               Description                 : this is test report category        </strong></p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1136" title="rep_cat5" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat5.jpg" alt="rep_cat5" width="575" height="192" /></div>
<p>Then <strong>save</strong> it under a <strong>transport request</strong>.</p>
<p>Click on <strong>allowable selection criteria</strong>&#8212;&gt;choose <strong>enter</strong>&#8212;-&gt; <strong>new entries.</strong></p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1137" title="rep_cat6" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat6.jpg" alt="rep_cat6" width="576" height="176" /></div>
<p>Get the fields from <strong>select option field</strong> with F4 help and give the values to be appeared in the selection screen of the <strong>LDB</strong> you want.</p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1138" title="rep_cat7" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat7.jpg" alt="rep_cat7" width="576" height="185" /></div>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;">Save</span></strong><span style="font-size: 10pt; font-family: Arial; color: black;"> it. </span><span style="font-size: 10pt; font-family: Arial; color: black;"> </span></p>
<p> </p>
<p> </p>
<p><strong><span style="color: #3366ff;">Using Report Category in the LDB</span></strong></p>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="font-weight: normal;">If the report category is space, it means there is nothing given in the HR report category.</span></span><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="font-weight: normal;"> </span></span></strong></p>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="font-weight: normal;">The <strong>output screen</strong> will be like this&#8230;with more field options.</span></span></strong></p>
<div style="width: 100%; float: left;"><img class="aligncenter size-full wp-image-1139" title="rep_cat8" src="http://www.abap-tutorials.com/wp-content/uploads/2009/12/rep_cat8.jpg" alt="rep_cat8" width="468" height="285" /></div>
<p> </p>
<p><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="color: #000000;">If the </span><strong><span style="color: #000000;">report category</span></strong><span style="color: #000000;"> is </span></span></p>
<p><span style="font-size: 10pt; font-family: Arial; color: black;">a) _____000 (5 underscores 3 zeros no gap) No<strong> LDB selection screen is displayed. </strong>It shows a clear screen.</span><span style="font-family: Arial; color: black;"> </span></p>
<p><span style="font-size: 10pt; font-family: Arial; color: black;">b) _____001 (5 underscores 2 zeros 1 no gap) only personnel number with out search help</span></p>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="font-weight: normal;">c) <span style="font-family: Arial; color: black;">_____003 (5 underscores 2 zeros 3 no gap) personnel number, Employment status,   Payroll area,</span><span style="font-family: Arial; color: black;">Pers.area/subarea/cost center</span></span></span></strong></p>
<p> </p>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="color: #3366ff;">Few sample programs:</span></span></strong></p>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="font-weight: normal;"><span style="font-family: Arial; color: black;">1) <span style="font-family: Georgia;">Program for understanding the PNP LDB with report category _____001.</span></span></span></span></strong></p>
<pre lang="ABAP">report zpnpldb .
INFOTYPES: 0001.
tables : pernr .
GET PERNR.
PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE: / P0001-PERNR,
P0001-STELL,
P0001-BEGDA,
P0001-ENDDA.
ENDPROVIDE.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA .
IF PNP-SW-FOUND =  1.
WRITE: / PERNR-PERNR, P0001-STELL, PN-BEGDA, PN-ENDDA.
ELSE.
REJECT.
ENDIF.</pre>
<p><strong><span style="font-size: 10pt; font-family: Arial; color: black;"><span style="font-weight: normal;"><span style="font-family: Arial; color: black;">2) <span style="font-family: Georgia;">This is a simple program for understanding the PNP LDB with report category space or with no report category. </span></span></span></span></strong></p>
<pre lang="ABAP">report zpnpldb .
tables : pernr .
INFOTYPES: 2001 MODE N.
initialization .
*pnpbegda = sy-datum - 30 .
*pnpendda = sy-datum .
pnppernr-sign = 'I'.
pnppernr-option = 'EQ'  .
pnppernr-low = '1000'.
append pnppernr.
pnppernr-low = '1001'.
append pnppernr.
pnppernr-low = '1002'.
append pnppernr.
pnppernr-low = '1003'.
append pnppernr.
start-of-selection .
GET PERNR.
RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA.
LOOP AT P2001.
WRITE: / p2001-pernr , p2001-begda, p2001-endda, P2001-ABWTG.
ENDLOOP.
end-of-selection .</pre>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/12/11/abap-hr-program-to-download-employee-data/' rel='bookmark' title='ABAP HR program to download Employee data'>ABAP HR program to download Employee data</a></li>
<li><a href='http://www.abap-tutorials.com/2009/11/20/macros-in-abap-hr-programming-i/' rel='bookmark' title='Macros in ABAP-HR Programming &#8211; I'>Macros in ABAP-HR Programming &#8211; I</a></li>
<li><a href='http://www.abap-tutorials.com/2009/11/23/difference-between-pnp-and-pnpce/' rel='bookmark' title='PNP Vs. PNPCE &#8211; Comparing the two Logical Databases'>PNP Vs. PNPCE &#8211; Comparing the two Logical Databases</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2009/12/07/maintain-hr-report-category/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PNP Vs. PNPCE &#8211; Comparing the two Logical Databases</title>
		<link>http://www.abap-tutorials.com/2009/11/23/difference-between-pnp-and-pnpce/</link>
		<comments>http://www.abap-tutorials.com/2009/11/23/difference-between-pnp-and-pnpce/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 13:50:06 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP HR]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Concurrent Employment]]></category>
		<category><![CDATA[logical database]]></category>
		<category><![CDATA[PNP]]></category>
		<category><![CDATA[PNPCE]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1085</guid>
		<description><![CDATA[PNPCE database in many ways can be said as the extension of  PNP logical database. PNP doesn&#8217;t contain all the data elements that are now in the expanded Concurrent Employment Database. SAP made an internal decision to not modify PNP, rather supercede it with a newer logical database, PNPCE. The PNPCE logical database supports the evaluation [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">PNPCE database in many ways can be said as the extension of  PNP logical database. PNP doesn&#8217;t contain all the data elements that are now in the expanded <strong>Concurrent Employment</strong> Database. SAP made an internal decision to not modify PNP, rather supercede it with a newer logical database, PNPCE.</p>
<p style="text-align: justify;">The PNPCE logical database supports the evaluation of HR master data. It includes the functions of the PNP logical database and offers additional evaluation options. Therefore, PNPCE logical database <strong>should be preffered</strong> over PNP database for all new developments.</p>
<p style="text-align: justify;"><span id="more-1085"></span></p>
<p style="text-align: justify;">The enhanced functionality of PNPCE in comparison to PNP essentially concerns the evaluation of Concurrent Employment, that is the possibility to group evaluate several assignments/personnel numbers of a person. The new events &#8216;<strong>GET PERSON</strong>&#8216; and &#8216;<strong>GET GROUP</strong>&#8216; as well as an enhanced syntax for the INFOTYPES statement (addition <strong>AS PERSON TABLE</strong>) for the procurement of infotype data enable you to use the new functionality. The use of these new functions is optional. You can run a PNPCE report that does not use the new events and the addition for the INFOTYPES statement in a PNP-compatible session. Since the PNPCE also has an improved selection screen, each report benefits from this even if the report does not use the functions for evaluating Concurrent Employment.</p>
<p style="text-align: justify;"><strong>Essentials</strong><br />
A report that wants to use the PNPCE must enter this in its report attributes under Logical database.<br />
In addition, the PERNR structure must be declared in the report using the &#8216;TABLES PERNR&#8217; statement. You can only use the PERNR structure again in certain circumstances. The use of the &#8216;GET PERNR&#8217; event is therefore forbidden. Instead, use the &#8216;GET PERAS&#8217; event. Except for the PERNR-PERNR component, all other components of the PERNR structure are no longer filled and have initial values. This kind of programming (with the exception of PERNR-PERNR) therefore not permitted.<br />
In addition to the &#8216;GET PERAS&#8217; event, you can also use the GET PERSON&#8217; and &#8216;GET GROUP&#8217; events. To be able to use these events, you must declare them using the NODES statement (NODES PERSON&#8217;, &#8216;NODES GROUP&#8217;, or. NODES PERAS&#8217;).</p>
<p style="text-align: justify;"><strong>Explanation of Terms</strong><br />
If the &#8216;GET PERSON&#8217; and &#8216;GET GROUP events and the &#8216;AS PERSON TABLE&#8217; addition for the INFOTYPES statement are not used, the report indicates that it does not require the functionality for evaluating Concurrent Employment. In this case, the report runs in a PNP-compatible session. This is referred to as PNP mode in the following documentation. On the other hand, if the report uses the functionality for evaluating Concurrent Employment we refer to CE mode.</p>
<p style="text-align: justify;"><strong>Features</strong><br />
Process of an Evaluation<br />
The PNPCE selection screen offers you as standard a range of functions that you can use to restrict the personnel number and person selection. The process is initially as follows regardless of whether the report runs in CE or PNP mode. All available functions and selection conditions leads to the selection of personnel numbers. If you use the sorting function, this set of personnel numbers is then sorted according to the sort criteria you selected. In PNP mode, the GET PERAS event is triggered as a result for each personnel number.<br />
In CE mode, the persons belonging to the personnel numbers are determined first for all personnel numbers selected. The GET PERSON event is then triggered for each person. The person ID is specified in the OBJID component of the PERSON structure. PERNR_NUM contains the total number of personnel assignments (= personnel numbers) that this person has and the ALL_PERNRS table, which contains a list of these personnel numbers regardless of whether they were actually selected or not. The SELECTED flag is set to X for the personnel numbers selected. The flag is initial for all personnel numbers that are not selected. The PROCESS flag specifies whether the personnel number should be processed in the rest of the process. This flag is set to X by default for the personnel numbers selected. However, the report can set or delete this flag at the GET PERSON event for all personnel numbers. In this way, report and logical database communicate with each other which enables the report to control the rest of the process.</p>
<p style="text-align: justify;">In the next step, the logical database groups all personnel numbers of a person that are to be processed (that is, all personnel numbers that have the PROCESS flag set). The report can control the type of grouping using the PNPCE_GROUPING_FROM_PAYROLL flag (normal or payroll grouping) and using the PNPGPRSN (grouping reason) and PNPGPVAL (grouping value) parameters of the selection screen. The GET GROUP event is triggered for each group of personnel numbers determined. The GROUPING_REASON and GROUPING_VALUE components contain the grouping reason and grouping value of this group. The number of personnel numbers that belong to this group and that are processed subsequently is in PERNR_NUM. The included ALL_PERNR table contains a list of these personnel numbers with additional information. The SELECTED flag specifies whether the current personnel number was originally selected (flag is set) or was marked by the report as to be processed. GROUPING_BEGDA and GROUPING_ENDDA contain the validity period that the personnel number has for this grouping. The NO_AUTHORITY flag is set if there is insufficient authorization for a personnel number. This personnel number is not processed further. The SORT component defines a standard sort order for the personnel numbers of a group. The report can change this by overwriting the values. In this way, report and logical database communicate with each other, which controls the further processing sequence of the personnel numbers.</p>
<p style="text-align: justify;">The GET PERAS event is then triggered for all personnel numbers of the group (with the exception of the personnel numbers for which no authorization exists) in the sequence defined by the SORT component (see above). The SELECTED, GROUPING_BEGDA, and GROUPING_ENDDA components have the same meaning here as with the GET GROUP event. The PROCESSED_BEFORE flag specifies whether the personnel number has already been processed once before (it is possible that the personnel number belongs to several groupings and has been therefore been processed several times).</p>
<p style="text-align: justify;">


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/11/19/logical-database-in-sap-a-must-for-abap-hr-programmer/' rel='bookmark' title='Logical Database in SAP &#8211; a must for ABAP HR programmer'>Logical Database in SAP &#8211; a must for ABAP HR programmer</a></li>
<li><a href='http://www.abap-tutorials.com/2009/11/20/macros-in-abap-hr-programming-i/' rel='bookmark' title='Macros in ABAP-HR Programming &#8211; I'>Macros in ABAP-HR Programming &#8211; I</a></li>
<li><a href='http://www.abap-tutorials.com/2009/12/07/maintain-hr-report-category/' rel='bookmark' title='Create HR Report Category in SAP'>Create HR Report Category in SAP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2009/11/23/difference-between-pnp-and-pnpce/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Macros in ABAP-HR Programming &#8211; I</title>
		<link>http://www.abap-tutorials.com/2009/11/20/macros-in-abap-hr-programming-i/</link>
		<comments>http://www.abap-tutorials.com/2009/11/20/macros-in-abap-hr-programming-i/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 11:32:42 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP HR]]></category>
		<category><![CDATA[Function Modules]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[macros]]></category>
		<category><![CDATA[PNP]]></category>
		<category><![CDATA[PNPCE]]></category>
		<category><![CDATA[RP-PROVIDE-FROM-FRST]]></category>
		<category><![CDATA[RP-PROVIDE-FROM-LAST]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1081</guid>
		<description><![CDATA[The macros will be used to get the data from the various clusters based on the cluster ID.For Buffering purpose we use macros. For example, when we want to read the data from the cluster RU, we have to pass the cluster ID &#8220;RU&#8221; and Rx-KEY to the particular macro. By using the Rx-key the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The macros will be used to get the data from the various clusters based on the cluster ID.For Buffering purpose we use macros.</p>
<p style="text-align: justify;">For example, when we want to read the data from the cluster RU, we have to pass the cluster ID &#8220;RU&#8221; and Rx-KEY to the particular macro. By using the Rx-key the macro will fetch the data from the cluster RU.</p>
<p style="text-align: justify;">Basically we use the macros to IMPORT/EXPORT the data to or from the clusters.</p>
<p style="text-align: justify;"><span id="more-1081"></span></p>
<p style="text-align: justify;">Here is the general naming convension for the IMPORT and EXPORT macros.</p>
<p style="text-align: justify;"><strong><span style="color: #3366ff;">For Import:</span></strong></p>
<p style="text-align: justify;">RP-IMP-Cn-xx</p>
<p style="text-align: justify;">where,</p>
<p style="text-align: justify;">n &#8212;&#8212;&#8211;&gt; No. of PCL file.(ex:1,2,3,4 0r 5)</p>
<p style="text-align: justify;">xx&#8212;&#8212;&#8211;&gt; cluster ID</p>
<p style="text-align: justify;">IMP&#8212;&#8212;&gt; Import</p>
<p style="text-align: justify;"><strong><span style="color: #3366ff;">For Export:</span></strong></p>
<p style="text-align: justify;">RP-EXP-Cn-xx</p>
<p style="text-align: justify;">where,</p>
<p style="text-align: justify;">n &#8212;&#8212;&#8211;&gt; No. of PCL file.(ex:1,2,3,4 0r 5)</p>
<p style="text-align: justify;">xx&#8212;&#8212;&#8211;&gt; cluster ID</p>
<p style="text-align: justify;">EXP&#8212;&#8212;&gt; Export</p>
<p style="text-align: justify;">Macro contains some part of source code which it will be useful for number of applications, just like function modules.</p>
<p style="text-align: justify;"><strong><span style="color: #3366ff;">Generally we use two macros in HR ABAP</span></strong></p>
<ul>
<li>
<div style="text-align: justify;"><strong>RP-PROVIDE-FROM-LAST</strong></div>
</li>
<li>
<div style="text-align: justify;"><strong>RP-PROVIDE-FROM-FRST</strong></div>
</li>
</ul>
<p style="text-align: justify;">The macro RP-PROVIDE-FROM-LAST retrieves the last(latest) data record which is valid in the data selection period.</p>
<p style="text-align: justify;">The macro RP-PROVIDE-FROM-FRST retrieves the first(start)data record which is valid in the data selection period.</p>
<p style="text-align: justify;">For every macro, whether the operation was successful or not will be checked with PNP-SW-FOUND. If PNP-SW-FOUND = 1, then the operation is successful. ( same as sy-subrc but the value is in reverse case)</p>
<p style="text-align: justify;">The macro RP-READ-INFOTYPE retrieves all the data record(s) which is valid in the data selection period. If SY-SUBRC = 0 or initial, then the process is successful.</p>
<p style="text-align: justify;">All the Macros are stored in table TRMAC.</p>
<p style="text-align: justify;">Whenever you are using the macros like RP-PROVIDE-FROM-LAST or RP-PROVIDE-FROM-FRST, check whether you have included logical database PNP in program attributes.</p>
<p style="text-align: justify;">It is not necessary to include logical database PNP/PNPCE in your program when you are using the macro like RP-READ-INFOTYPE A B C D E , where A corresponds to PERNR which describes for which personnel number you require records. B corresponds to INFOTYPE which describes from which infotype you require records. C corresponds to data structure of the declared infotype (internal table like P0000 for infotype 0000) where all the records of the particular personnel number will be stored. D corresponds to Start date. E corresponds to End date.</p>
<p style="text-align: justify;"><strong>Sample Code :</strong></p>
<p style="text-align: justify;">Tables : PERNR.</p>
<p style="text-align: justify;">INFOTYPES : 0001,0002.</p>
<p style="text-align: justify;"> Start-of-selection.</p>
<p style="text-align: justify;">Get PERNR.</p>
<p style="text-align: justify;">RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.</p>
<p style="text-align: justify;"> Write : / P0001-PERNR.</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><strong><span style="color: #3366ff;">Note:</span></strong></p>
<p style="text-align: justify;">1. NULL is a macro which contains the value 0 (on most implementations). this is the one used to initialize a pointer to NULL</p>
<p style="text-align: justify;">2. Debugging a MACRO is not really possible, prevent the use of them.</p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/07/20/macro-an-under-used-modularization-technique/' rel='bookmark' title='MACRO in ABAP &#8211; an under-used Modularization Technique'>MACRO in ABAP &#8211; an under-used Modularization Technique</a></li>
<li><a href='http://www.abap-tutorials.com/2010/01/14/programmers-guide-to-abap-hr/' rel='bookmark' title='Programmer&#8217;s Guide to ABAP HR'>Programmer&#8217;s Guide to ABAP HR</a></li>
<li><a href='http://www.abap-tutorials.com/2009/11/18/abap-vs-abap-hr/' rel='bookmark' title='ABAP Vs. ABAP HR'>ABAP Vs. ABAP HR</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2009/11/20/macros-in-abap-hr-programming-i/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

