Professional Documents
Culture Documents
Technical Design Document TD - PO039I - OCR Contract and PO Interface
Technical Design Document TD - PO039I - OCR Contract and PO Interface
Changes to Design
List all changes to the functional design since original signoff of the document.
Procurement Contract NO
NO
Menu Definition(s)
Action Menu Name Bar Name Item Name Description of Modification
UPDATE BSC_INTFC_MNU Add the component to this menu at the
time of registration.
Component Properties
Standard Search Record ‘Add Mode’ Search Record Allowed Actions
B_OCR_RUNCNTRL B_OCR_RUNCNTRL Add / Update
Component Definition(s)
Component Name Action Description of Modification
B_OCR_INTF_RUN New New component for the process - ‘OCR Contract and PO
Files’
Page Definition(s)
Action Page Page Description Description of Modification
New B_OCR_INTF_PNL Generates OCR Contract and PO New run control page for the process –
Files ‘OCR Contract and PO Files’.
Page Navigation
Page Navigation
B_OCR_INTF_PNL BSC Interfaces -> Purchasing -> Generates OCR Contract and PO Files
Folder
Action Type Description
Add Content Reference Content reference for the ‘OCR Contract and PO Files’ process will be
automatically generated when the component ‘B_OCR_INTF_RUN is
registered (or migrated).
Record B_OCR_RUNCNTRL
Parent Record: N/A
Type SQL Table
Sort Audit
Sub-record Type Key / Orde (Add, Prompt
(If (Char, Require r Search Delete, Table / Set
Applicable Integer d (Key, Order (Asc, Key / Change Default Control
Field Name ) , …) Length Label Alt) # Desc) List ) Value Field
OPRID Char 30 User Y/Y 1 Y/Y NO
RUN_CNTL_ID Char 30 Run Cntl Y/Y 2 Y/Y NO
PROCESS_NAME Char 12 Proc Name Y/Y 3 NO
B_IF_CONTROL_ID Char 15 Intfc Cntrl ID Y/Y 4 NO
PROCESS_INSTANCE Nbr 10 Instance Y/Y 5 NO
PO_REQUIRED_FLG Char 1 PO Req Flg 6 NO
PO_CNTRCT_FLG Char 1 Schedule 7 NO
APPROVAL_DATE Date 10 Approval 8 NO
Note: The fields PROCESS_NAME and CONTROL_ID will be used to retrieve the Output File and Log File Path. The fields are place holders.
Record B_OCR_INTF_AET
Parent Record: N/A
Type Derived Work Record
Sort Audit
Type Key / Orde (Add, Prompt
Sub-record (Char, Required r Search Delete, Table / Set
(If Integer (Key, Order (Asc, Key / Change Default Control
Field Name Applicable) , …) Length Label Alt) # Desc) List ) Value Field
PROCESS_INSTANCE Nbr 10 Instance Y/Y 5 NO
PROCESS_NAME Char 12 Proc Name 3 NO
B_IF_CONTROL_ID Char 15 Intfc Cntrl ID 4 NO
PO_REQUIRED_FLG Char 1 PO Req Flg 6 NO
PO_CNTRCT_FLG Char 1 Schedule 7 NO
APPROVAL_DATE Date 10 Approval 8 NO
EXIST Char 1 Exist 9 NO
Record B_OCR_PO_TMP
Parent Record: N/A
Record B_OCR_PROC_TMP
Parent Record: N/A
Type SQL Table
Sort Audit
Type Orde (Add, Prompt
Sub-record (Char, Key / r Search Delete, Table / Set
(If Integer Required Order (Asc, Key / Change Default Control
Field Name Applicable) , …) Length Label (Key, Alt) # Desc) List ) Value Field
PROCESS_INSTANCE Nbr 10 Instance Y/Y 1
SETID Char 5 SetID Y/Y 2
CNTRCT_ID Char 25 Buy Agree ID Y/Y 3
AMT_CNTRCT_MAX Nbr 27 Max. Amt 4
APPROVAL_DT Date 10 Date Y/Y 5
CNTRCT_BEGIN_DT Date 10 Begin Dt 6
CNTRCT_EXPIRE_DT Date 10 Expire Dt 7
VENDOR_ID Char 10 Vendor 8
File Layout:
File Layout
Name Description File Layout Format Delimiter Size
B_OCR_PURC_ORDER File Layout to generate the Purchase Order file FIXED – Left Pad numeric
for OCR systems. fields with zeros and
character fields with spaces.
Field Req’d Transformation Position (Start) Position (End) Length Description
Value
BUSINESS_UNIT Yes 1 5 5 Business Unit
PO_ID Yes 6 15 10 PO No.
MERCHANDISE_AMT_PO Yes 16 43 28 PO Amount
APPROVAL_DT Yes 44 53 10 Date
VENDOR_ID Yes 54 63 10 Vendor
NAME1 Yes 64 103 40 Name
DESCR254_MIXED Yes 104 357 254 More Info
B_OCR_PROC_TYPE Yes 358 359 2 OCR Procurement
MTA_SW_GOALS_MWD Yes 360 360 1 SW_GOALS_MD
B_DBE_ASIDE Yes 361 363 3 DBE Set Aside
B_VND_CERT Yes 364 366 3 Certified by MT
MTA_RATE_MBE_TOT Yes 367 373 7 Total MBE %
MTA_RATE_WBE_TOT Yes 374 380 7 Total WBE %
MTA_RATE_DBE_TOT Yes 381 387 7 Total DBE %
File Layout
Name Description File Layout Format Delimiter Size
B_OCR_PROC_CNTRCT File Layout to generate the Procurement FIXED – Left Pad numeric
Contract file for OCR systems. fields with zeros and
Field Definition(s)
Action Field Name (Long) Name (Short) Type Le Format Type
n
Field Properties
Action Component Record Field Event Description of Modification
Translates
Action Field Name Value Status Effdt Long Name Short Name
Message Catalog
Action Message Set # Message # Message Description
Component Interface
CI Name CI Description
PeopleCode
Process Type
Enter the type of process: Interface, Batch, Conversion, etc…
This application engine (B_OCR_INTF_AE) process will run in a nightly batch and generate two files, one
for procurement contract data and one for purchase order data that were approved since the previous night’s
batch and have MBE/WBE/DBE goals established and will create these output file on the BSC FTP File
server.
Application Engine
INIT Step01 : SQL Select Run Control values into State Record
Step02 : PeopleCode Open the Log file for writing and write the
housekeeping information.
CLOSE Step01 : PeopleCode Write the control information and any error
informative messages to the Log file. Close
the log file.
Note: The fields PROCESS_NAME and CONTROL_ID will be used to retrieve the Output File and Log
File Path. The fields are place holders.
INIT.Step02.PeopleCode: Open the Log file for writing and write the housekeeping information.
BSC_Open_File(B_REQTOHYP_AET.PROCESS_INSTANCE,
B_REQTOHYP_AET.PROCESS_NAME, B_REQTOHYP_AET.CONTROL_ID,
&BSC_FILE_PATH_NAME, &BSC_BACKUP_PATH, &BSC_LOG_PATH, &BSC_FILE_OWNER,
&BSC_FILE_GROUP);
%SELECT (EXIST)
SELECT 'X' FROM PS_INSTALLATION WHERE %BIND (PO_REQUIRED_FLG) = 'Y'
UPDATE PS_B_OCR_PO_TMP A
SET DESCR254_MIXED = (SELECT B.DESCR254_MIXED FROM PS_PO_LINE B
WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT
AND A.PO_ID = B.PO_ID
AND B.LINE_NBR = '1')
WHERE EXISTS (SELECT B1.DESCR254_MIXED FROM PS_PO_LINE B1
WHERE A.BUSINESS_UNIT = B1.BUSINESS_UNIT
AND A.PO_ID = B1.PO_ID
AND B1.LINE_NBR = '1')
PROCESS_PO.Step03. Peoplecode: Generate the Purchase Order file for OCR systems.
If &OCR_PO_File.IsOpen Then
If &OCR_PO_File.SetFileLayout(FileLayout.B_OCR_PURC_ORDER) Then
&PORecLine = CreateRecord(RECORD.B_OCR_PO_TMP);
&SQL_PORecLine = CreateSQL("%Selectall(:1)", &PORecLine);
While &SQL_PORecLine.Fetch(&PORecLine)
&OCR_PO_File.WriteRecord(&PORecLine);
&PO_COUNT = &PO_COUNT + 1;
End-While;
Else
/* do error processing -; file layout not correct */
End-If;
Else
/* do error processing -; file not open */
End-If;
%TruncateTable(%Table(B_OCR_PO_TMP))
%SELECT (EXIST)
SELECT 'X' FROM PS_INSTALLATION WHERE %BIND (PO_CNTRCT_FLG) = 'Y'
PROCESS_PROC.Step02. Peoplecode: Generate the Procurement Contracts file for OCR systems.
If &OCR_PROC_File.IsOpen Then
If &OCR_PROC_File.SetFileLayout(FileLayout.B_OCR_PROC_CNTRCT) Then
&PORecLine = CreateRecord(RECORD.B_OCR_PROC_TMP);
&SQL_PROCRecLine = CreateSQL("%Selectall(:1)", &PROCRecLine);
While &SQL_PROCRecLine.Fetch(&PROCRecLine)
&OCR_PROC_File.WriteRecord(&PROCRecLine);
&PROC_COUNT = &PROC_COUNT + 1;
End-While;
Else
/* do error processing -; file layout not correct */
End-If;
Else
/* do error processing -; file not open */
End-If;
%TruncateTable(%Table(B_OCR_PROC_TMP))
/*Check if any records were processed by this run and write the housekeeping information.*/
If &OCR_PO_File.IsOpen Then
&OCR_PO_File.Close();
BSC_Close_File(&BSC_FILE_PATH_NAME, &B_IF_FILE_OWNER,
&B_IF_FILE_GROUP);
End-If;
If &OCR_PROC_File.IsOpen Then
&OCR_PROC_File.Close();
BSC_Close_File(&BSC_FILE_PATH_NAME, &B_IF_FILE_OWNER,
&B_IF_FILE_GROUP);
End-If;
&Log_File.Close();
BSC_Close_File(&BSC_FILE_PATH_NAME2, &B_IF_FILE_OWNER2, &B_IF_FILE_GROUP2);
Reporting
Report Description:
The OCR department requires this query B_OCR_REQUISITION be built in PeopleSoft that will allow
them to search for upcoming requisitions that will require MBE/WBE/DBE goals. The OCR department
users will be able to inquire on requisition details across all business units, for a specified dollar amount
and within a specified date range.
Query - B_OCR_REQUISITION
SQL (B_OCR_REQUISITION):
SELECT A.BUSINESS_UNIT
, A.REQ_ID
, A.REQ_STATUS
, SUM( B.MERCHANDISE_AMT)
FROM PS_REQ_HDR A
, PS_REQ_LINE B
WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT
AND A.REQ_ID = B.REQ_ID
AND A.APPROVAL_DT BETWEEN TO_DATE(:1,'YYYY-MM-DD') AND TO_DATE(:2,'YYYY-MM-DD')
GROUP BY A.BUSINESS_UNIT, A.REQ_ID, A.REQ_STATUS
HAVING SUM( B.MERCHANDISE_AMT) >= :3
ORDER BY 1, 2
Prompts:
Report Execution:
Executed through PS Query Manager/Query Viewer
Application Message
Message Description
Provide a description of the message and the rational behind why it is required.
Message Structure
Version Record Field Alias Include
Version Number Record Name Which fields exist Pseudo name Yes or No (‘Y’ or ‘N’) to
on the record? for field indicate if field is included
in message
Message Channel
Provide an explanation of all modified or new Sections, Steps, and Actions within the Application Engine
program. Include field names, record names and calculations, if applicable.
Message PeopleCode
List out PseudoCode and logic for any message PeopleCode
Job Dependencies
Indicate any dependencies for this process including time of day, pre-requsite processes or audits and post
requisite processes or audits
Interface Details
- Type
- Directory
- Interface Control
it last failed?) In most cases, unless the input file is larger or processing time is long, commitment control
is not required.)
Process Defn
Process Definition(s)
Action Process Definition Name Type Description
ADD B_OCR_INTF_AE Application Generates Purchase Order & Procurement Contract files for OCR
Engine systems.
Cycle 0 - Tests the program when it processes zero rows of input data. Either the driving select returns
zero rows of data or the input file contains zero rows of data.
Scenario: No Directory ID (Control ID) is selected for processing on the run control page.
Result: Throws an error message - ‘Process Name and Directory ID should be provided’.
Scenario: No Process Name is selected for processing on the run control page.
Result: Throws an error message - ‘Process Name and Directory ID should be provided’.
Scenario: No Transaction Type is selected for processing on the run control page.
Result: Throws an error message - ‘Atleast one transaction type should be specified’.
Scenario: No Transaction Approval Date is specified for processing on the run control page.
Result: The Application Engine program will use the run date as the transaction approval
Date and generates the files matching the specified criteria on the run control page.
Cycle 1 - Tests the program when it processes one row of input data. Either the driving select returns
one row of data or the input file contains one row of data.
Scenario: One Transaction Type that’s Purchase Order is selected for processing on the run
control page and has single row of information that needs to be sent; and Directory
ID, Process Name & Transaction Approval Date are selected.
Result:
o Purchase Order file (OCR_EXTRACT_PO.TXT) is generated, contains information which
has purchase order data that were approved and PO_HDR.APPROVAL_DT = <Run
Control Transaction Approval Date>
o PO’s containing contracts should not be selected.
o Have MBE/WBE/DBE goals established (B_PO_DTL_TBL.MTA_GOALS_MWD = ‘Y’)
o Housekeeping information is written to the log file with details such as total rows
processed in this run.
Scenario: One Transaction Type that’s Procurement Contract is selected for processing on the
run control page and has single row of information that needs to be sent; and
Directory ID, Process Name & Transaction Approval Date are selected.
Result:
o Procurement Contract file (OCR_EXTRACT_PROC.TXT) is generated, contains
information which has procurement contracts data that were approved
CNTRCT_HDR.APPROVAL_DT = <Run Control Transaction Approval Date>
o Have MBE/WBE/DBE goals established (MTA_CNTRCT_DTL.MTA_GOALS_MWD = ‘Y’)
o Housekeeping information is written to the log file with details such as total rows
processed in this run.
Scenario: Both Transaction Types Purchase Order and Procurement Contract are selected for
processing on the run control page and has single row of information that needs to be
sent; and Directory ID, Process Name & Transaction Approval Date are selected.
Result:
o Two file should be produced, one for purchase orders and one for procurement
contracts
o Files should contain data for procurement contracts and purchase orders that were
approved and have MBE/WBE/DBE goals established respectively.
o Housekeeping information is written to the log file with details such as total rows
processed in this run for each file.
Cycle 2 - Tests the program when it processes multiple rows of input data. Either the driving select
returns multiple rows of data or the input file contains multiple rows of data.
Scenario: One Transaction Type that’s Purchase Order is selected for processing on the run
control page and have multiple rows of information that needs to be sent; and
Directory ID, Process Name & Transaction Approval Date is selected.
Result:
o Purchase Order file (OCR_EXTRACT_PO.TXT) is generated, contains information which
has purchase order data that were approved and PO_HDR.APPROVAL_DT = <Run
Control Transaction Approval Date>
o PO’s containing contracts should not be selected.
o Have MBE/WBE/DBE goals established (B_PO_DTL_TBL.MTA_GOALS_MWD = ‘Y’)
o Housekeeping information is written to the log file with details such as total rows
processed in this run.
Scenario: One Transaction Type that’s Procurement Contract is selected for processing on the
run control page and has multiple rows of information that needs to be sent; and
Directory ID, Process Name & Transaction Approval Date are selected.
Result:
o Procurement Contract file (OCR_EXTRACT_PROC.TXT) is generated, contains
information which have procurement contracts data that were approved
CNTRCT_HDR.APPROVAL_DT = <Run Control Transaction Approval Date>
o Have MBE/WBE/DBE goals established (MTA_CNTRCT_DTL.MTA_GOALS_MWD = ‘Y’)
o Housekeeping information is written to the log file with details such as total rows
processed in this run.
Scenario: Both Transaction Types Purchase Order and Procurement Contract are selected for
processing on the run control page and have multiple rows of information that needs
to be sent; and Directory ID, Process Name & Transaction Approval Date are selected.
Result:
o Two file should be produced, one for purchase orders and one for procurement
contracts
o Files should contain data for procurement contracts and purchase orders that were
approved and have MBE/WBE/DBE goals established respectively.
o Housekeeping information is written to the log file with details such as total rows
processed in this run for each file.
Cycle 3 - Tests the program when it processes one or more rows of data; focuses on specific functional
and technical test conditions.
Scenario: None of the fields are selected on the run control page and the page is saved / run
button is clicked.
Result: An appropriate error message is displayed and the page is not saved.
Scenario: Directory ID and Process Name are selected on the run control page, but both
Transaction Types are not selected and the page is saved.
Result: An appropriate error message is displayed and the page is not saved.
Scenario: Directory ID or Process Name are not selected on the run control page and the page
is saved.
Result: An appropriate error message is displayed and the page is not saved.
Cycle 4-89 - Tests the program when it processes additional test conditions that could not be tested in
previous cycles.
Example Test Scenario/Result – If Applicable
Cycle 90-99 – Tests the program for error processing not tested in previous cycles (e.g. failed SQL statements).
Example Test Scenario/Result – If Applicable