Wednesday, September 15, 2010

Implementing Search/Match


To use the full functionality of your system, you must maintain the integrity of your database. With users from many departments entering data, you want to minimize the entry of duplicate or multiple records. Search/Match enables you to define criteria to check for duplicate or multiple ID records. The searchable ID types (called Search Types) are:

• Person (emplID).
• Organization (organization IDs within PeopleSoft Enterprise Campus Solutions).
• Applicant (HRS_PERSON_ID within PeopleSoft Enterprise HRMS Talent Acquisition Manager).

People books have reference to the search match codes already delivered in the system. They are found in the following application engine sections.

• Search/Match/Post Test Scores (SAD_TEST_PST).
- See the SrchMtch section in the program
• CBAP Post (SAD_CPST_AE).
- See the SrchMtch section in the program, Step 01

Prior to implementing the code, make sure that you have created the Search/Match rules and Search/Match Parameters, to meet your business requirement.

Navigations:
Set Up SACR, System Administration, Utilities, Search/Match, Search/Match Rules
Set Up SACR, System Administration, Utilities, Search/Match, Search/Match Parameters, Search Parameters


Being setup the above two, you can also define permissions and exceptions.

Refer the Search/Match feature in PeopleBooks, for more information on the same.
So you have seen the delivered code for the searchmatch

The code has the object &PersonSrchType, which is used to compare the columns that are being passed for the search/match.

SEARCH_ADD_PARM & SEARCH_ORDR_PRM: The first record has the Search/Match parameter used for a particular job and the second search/match, has the parameter order number.

HCR_SM_CRIT_VW table has the parameter and the rule mapping, which is done in the Search/Match Parameters

Now how to implement that code in a better way.

You can create a function using the field formulae and put this code, by modifying it according to your search parameter and the rules.

Then call that function using the Declare function:

Declare Function USTSearchMatch PeopleCode UST_DERIVED_112.FIELDNAME FieldFormula; /* search match function to find whether Person exists in the PeopleSoft system*/

Then pass the parameters to this function by creating a derived record and assigning the values to it one by one.

/* Search Match */
&fileLog.WriteLine("Selected student For Search Match: " UST_I112_AET.UST_EMPLID.Value);
&SearchMatchTblRec = CreateRecord(Record.UST_DERIVED_SM);
&SearchMatchTblRec.FIRST_NAME_SRCH.VALUE = Upper(&First_Name_srch);
&SearchMatchTblRec.LAST_NAME_SRCH.VALUE = Upper(&Last_Name_srch);
&SearchMatchTblRec.BIRTHDATE.VALUE = &BirthDate;
If All(&National_ID) And
&Flag = "R" Then
&SearchMatchTblRec.NATIONAL_ID.VALUE = &National_ID;
End-If;
&SearchMatchTblRec.EXTERNAL_SYSTEM_ID.VALUE = &National_ID;
&SearchMatchTblRec.EXTERNAL_SYSTEM.VALUE = "LID";
&rs_PersonSrchRules = CreateRowset(Record.HCR_SM_CRIT_VW); /* delivered method/row set */
&PARM_CD = UST_I112_AET.SM_PARM_CD.Value;
SQLExec("SELECT DISTINCT SM_TYPE FROM PS_HCR_SM_ORDR_TBL WHERE SM_PARM_CD=:1", &PARM_CD, &SMTYPE);
&rs_PersonSrchRules.Fill("where SM_TYPE = :1 and SM_PARM_CD = :2", &SMTYPE, &PARM_CD);
&rs_PersonSrchRules.Sort(HCR_SM_CRIT_VW.SEARCH_RULE_NBR, "A", HCR_SM_CRIT_VW.SEQNO, "A");
&Processing_Code = USTSearchMatch(&rs_PersonSrchRules, &SearchMatchTblRec);
/* search match function */

The &Processing_Code returns the value from the function call, which tells the result, whether the person exist in the system or not.

Write an evaluate statement to assess the &Processing_Code variable as given below.
Evaluate &Processing_Code
When = "A"
/* ADD */
/* The person doesn’t exist in the system. Write the code to add the person */
Break;

When = "U"
/* UPDATE */
/* The person exist in the system. Write the code to update the person information */
Break;

When = "S" /* SUSPEND */
/* The person with the details already exist in the system. Write the code to update the flag for that row to suspend the processing */

Break;

When-Other /* IGNORE */
/* Invalid person ID. Write the code to write the respective details into a log file */
Break;

End-Evaluate;

Hurray! So you have done implementing the Search/Match feature. If you suggestions to make the code even more better do mail us or post comment for this post.

Anoop Savio

0 comments:

Post a Comment

Total Pageviews

Copyright © Tech & Management Notes