Saturday, October 19, 2013

XML Publisher Step by step

  Analyse the Requirement and prepare Target Record with Required fields to Report(do all tthis using in Peoplecode)

Now XMLP Steps will start:
1) We have prepare Query with Target record (Reporting tools > PS Query > Query Manager -- Save).
2) Use this Query and Prepare Data Source (Reporting tools > BI Publisher > Data Source).
    a) Generate XML and XSD
    b) Save xml file to local System
3) Open a new Word Document and use BI-Publisher -  Add-in.
  a) Use Sample XML option to load saved xml on local system.
  b) will get Data load Successfull message.
  c) Now Prepare Template as per Client Requirement
       i) Table wizard - Table - option used to get data in Table Format
      ii) Form to Access the Fields
      iii) Free Form - Will prepare Letter/certificate Templates
  d) save Template name with ".rtf".
4) now upload this template File to Report definition in Template tab and make active status and test Visualise button.
 note: be carefull we have to use same query name
5) Then test using  xml viewer.
__________________________________
Same report to generate using people code

/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* People code to Run BI Publisher           */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
import PSXP_RPTDEFNMANAGER:*;

Local Record &rcdQryPrompts;
Local string &LanguageCd, &MyTemplate, &MyReportName, &OutFormat, &EMPLID;
Local date &AsOfDate, &BEGIN_DT, &END_DT;

Local Record &rcdSltEmp;
Local string &strEmplids;

Local Rowset &rsSltEmp;


Local Record &REC;


DoSaveNow();

&rsSltEmp = GetLevel0()(1).GetRowset(Scroll.MHN_PENDOC_TBL);
&REC = CreateRecord(Record.MHN_PENDOC_TBL);


 
 
   rem TransferPage(Page.LGE_TL_SEC);
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
   /* Set XML Publisher report required parameters                            */
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
   /**/
   &LanguageCd = "POR";
   &AsOfDate = %Date;
   &OutFormat = "PDF";
   REM &OutFormat = "HTML";

 
      &MyReportName = "MHN_TERM_HM";
      &MyTemplate = "MHN_TERM_HM_1";

 
 
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
   /* Prompt values                                                           */
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
 
   Local PSXP_RPTDEFNMANAGER:ReportDefn &oReportDefn = create PSXP_RPTDEFNMANAGER:ReportDefn(&MyReportName);
   &oReportDefn.Get();
   &rcdQryPrompts = &oReportDefn.GetPSQueryPromptRecord();
 
   If Not &rcdQryPrompts = Null Then
      &oReportDefn.SetPSQueryPromptRecord(&rcdQryPrompts);
      &rcdQryPrompts.OPRID.Value = %OperatorId;
   End-If;

   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
   /* Kick of the report process                                              */
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
 
   &oReportDefn.ProcessReport(&MyTemplate, &LanguageCd, &AsOfDate, &OutFormat);
 
   CommitWork();
 
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
   /* Display Report to the user                                              */
   /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
   &oReportDefn.DisplayOutput();
End-If;

Required Field property will not work in Derived work Record.

1) Enable Required fied property in Derived Work Record
2) Place this fied on the Page
3) then open component in PIA and saving the page with out value in the field
4) Page is Saving, not triggering the required field validation.
Reason: Derived Work Record is not a Physical Table so no value is going to save on the database.
i.e. reason Derived work record - Required field will not work so we have to write manual validataion.
Eg: If MHN_PENDDOC_REC.INSTITUTION.Value = "" Then
   /*Error - Por favor selecione o valor Instituição Acadêmica */
   MHN_PENDDOC_REC.INSTITUTION.Style = "PSERROR";
   Error MsgGet(32002, 2, "Message Not Found.");
Else
   MHN_PENDDOC_REC.INSTITUTION.Style = "";
 
end-if;

Wednesday, May 8, 2013

Sysdate in SQR

let $hdatenow = datenow()
let $hsysdate  = datetostr(datenow(),'YYYYMMDD')
$hsysdate   - value we can see Sysdate.

Wednesday, October 24, 2012

Tablespace Script

Script to update the Tablespace for all the records in the Project.

 
Script to update the Tablespace for all the records in the Project. when we import Project in the client instance, we can use this SQL to change the tablespace for all the records at time, rather changing it one by one.

Update PSRECTBLSPC
SET DDLSPACENAME = {NEW TABLESPACE}
WHERE DDLSPACENAME = {OLD TABLESPACE};
and RECNAME IN (Select A.OBJECTVALUE1 from PSPROJECTITEM A, PSRECDEFN B
               Where A.PROJECTNAME = {PROJECTNAME} and A.OBJECTTYPE = 0 and A.OBJECTID1 = 1 and A.OBJECTVALUE1 = B.RECNAME and B.RECTYPE =0)

Peoplesoft HCM9.1 Upgarde -  

1. Date Time Stamp Issues- OracleDescriptor=1 or Cast or To_date or To_Char

2. Funclib_absence Record is converted to Funclib_gp_abs

3. Grou_id configuration issue-for current Calender Group - onebrace is coming extra.

4. Style Sheet - new style sheet is PSSTYLEDEF_SWAN

Peoplesoft - HR & Base Benefits


Primary Jobs in Peoplesoft
There are 2 types of the Primary Jobs in the Peoplesoft HCM
1) HR - Primary Job Indicator in the Job data component.
2) Benefits - Primary Job Indicator.
One of the Employee job will be considered as the HR -Primary job for an employee and this is mainly for reporting purpose.

One of the Employee Job will be considered as the Benefits - Primary Job for Jobs under particulary Benefit Record number of an employee. If employees' Jobs are assigned to more than one Benefit record number and for each set of the Employees' Jobs under the particular Benefit record number one Benefits Primary Job should be selected.

Job - Data - Benefit Program Participation Page can be used to set the Benefit Record number.

Note : - Benefit Record Number is Zero by default. You manually change this field when appropraite. Because you are maintaning an effective-dated history of primary jobs benefits according to a set of strict rules , don't change the benefit record number of an existing job.
Doing so invalidates the primary job inicators that reside on the effective - dated primary jobs table and can result in erroneous processing within Benefits Adminstration and payroll for north america, resulting in abnormal termination of some processes.

Multiple Job Options can be set in the below Component.
Setup HRMS > Product Releated > Base Benefits > Multiple Job Options > Mutliple- Job optns

Following page can be used to view and update an employee's primary Job flag inculde deduction flag.
Benefits > Maintain Primary Jobs > Maintain Flags > Primary Jobs Flags

Primary Jobs table, Which is automatically created when ever a job is added using the Add concurrent Job pages updated whenever the job is terminated, based upon rules that you define in the multiple- Job optns (multiple Job options) page.

Primary Jobs table has following flags as well.
Include Eligibility : For Benefits Administration only. Select this check box if you want this job to be included by the system when determining the employee’s benefit eligibility.
Include Deductions: Select this check box if you want this job to be included when the system calculates the employee’s benefit deduction and coverage.

Why Benefits Primary Job is requried.
1) Determine to which Job the system applies the benefit deducation.
2) Identify the job that will provide the service date and the termination date.
3) Search record on all the Benefits search page shows only the jobs which has primary job flag is selected.

Automatically Building Primary Job Data for Multiple Employees
Run the Primary Job Utility process whenever you add a new employee population to the database through an external interface or database load (such as when implementing employee groups in phases or acquiring another company).

Benefits > Maintain Primary Jobs > Rebuild Primary Job Flags > Primary Job Maint
Process Name :- BN_BEN500_AE
When the utility runs, all existing data for the indicated employee population (if any) in the Primary Jobs Table is deleted. For each employee, a new effective-dated entry is made, assigning the primary job designation to the lowest active employee record within a benefit record number. Primary Job information is created for a time span bounded by the earliest and latest job effective dates for all jobs within a benefit record. If all jobs within a benefit record are terminated, the job with the lowest employee record is designated as the primary job.
Warning! All manual changes made through the Primary Jobs Flags page for the selected employee population are lost, because the complete Primary Job history is rebuilt for each employee.