Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

Technical Design Document

TD_PO039I – OCR Contract and PO Interface

50331834.docx 1 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

Technical Design Sign-Off


Document sign-off will be completed by multiple parties including representatives from the client and from Accenture. The
Technical Design Analyst is responsible for identifying all individuals from which sigh-off is required. The sign-off signors of this
Work Product agree that this document is acceptable and complete to the best of their knowledge and will be used as the
official requirements for the build phase. It is further agreed that this document is now baselined and any changes to this
document from this point forward, must follow the established procedures for document updates and may result in contract
negotiations due to increased scope or complexity.
Typed Name Role Date Signature
{Analyst} Technical Design Analyst 11/06/2009
MTA BSC IT Director /
Teri Sciascia Defer to Team Lead
Lead
Chris Hetzel Accenture IT Lead Defer to Team Lead
Teresa Liu / Reuben Banaag MTA Development Lead Defer to Team Lead
Accenture Development
Ryan Blane Defer to Team Lead
Lead
{Lead Name} MTA {Team} Lead
{Lead Name} Accenture {Team} Lead
Kyle Overholser / Kemal
QA
Karakaya

Technical Design Modification History


Impacted
# Date Modified By Reason/Description of Modifications
Objects
08-TUE-2009 Vikram Padisala All Initial Draft

Technical Design Peer Review


The Peer Review participants of this Work Product agree that this document is acceptable and complete to the best of their
knowledge and that the appropriate QPI Peer Review processes and procedures have been completed.

Name Role Date


<Type Names> <Indicate Role> <Date Completed>

50331834.docx 2 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
General

Changes to Design
List all changes to the functional design since original signoff of the document.

# Date Modified By Impacted Section Reason/Description of Modifications Approval


<List the
<Enter Reason Eg. Vendor changed file layout functional lead
DD-MON-YYYY <Modified By> <List Section Changed>
requirements> who approved
the change>

50331834.docx 3 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Application Flow Diagram
START

Fetch the run control parameters into the


state record. Load B_OCR_PO_TMP table with data that
satisfies the conditions / parameters
selected on run control page.
Fetch the ‘Output Directory’ details
from the Directory Table.

YES Update field


Open the log file for writing and write B_OCR_PO_TMP.DESCR254_MIXED
the housekeeping information.
Purchase Order

Select the files to be processed based on the


Run Control Page Clear the Table B_OCR_PO_TMP

Procurement Contract NO
NO

YES Write the housekeeping information to


the log file. Close the log file.
Load B_OCR_PROC_TMP table with data
that satisfies the conditions / parameters
selected on run control page.
END

Generate the Procurement Contracts


file for OCR systems.

Clear the Table


B_OCR_PROC_TMP

50331834.docx 4 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Page Layout / Requirements

50331834.docx 5 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Solution
General Description
Provide a description of the technical approach to address the functional requirements. Document any
required coding.

On-Line Objects Impact Inventory and Description


Project Definition(s)
Project Name Action Description/Comments
B_OCR_INTF ADD OCR Contract and PO Interface

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

Page Field Properties


Page Field Description of Modification

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).

50331834.docx 6 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Record Definition Impact Inventory and Description

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

50331834.docx 7 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Type SQL Table
Sort
Type Key / Orde Audit Prompt
Sub-record (Char, Required r Search (Add, Table / Set
(If Integer, (Key, Order (Asc, Key / Delete, Defaul Control
Field Name Applicable) …) Length Label Alt) # Desc) List Change) t Value Field
PROCESS_INSTANCE Nbr 10 Instance Y/Y 1
BUSINESS_UNIT Char 5 Unit Y/Y 2
PO_ID Char 10 PO No. Y/Y 3
APPROVAL_DT Date 10 Date 4
VENDOR_ID Char 10 Vendor 5
NAME1 Char 40 Name 6
DESCR254_MIXED Char 254 More Info 7
B_OCR_PROC_TYPE Char 2 OCR Procurement 8
MTA_SW_GOALS_MWD Char 1 SW_GOALS_MD 9
B_DBE_ASIDE Char 3 DBE Set Aside 10
B_VND_CERT Char 3 Certified by MT 11
MTA_RATE_MBE_TOT Nbr 7 Total MBE % 12
MTA_RATE_WBE_TOT Nbr 7 Total WBE % 13
MTA_RATE_DBE_TOT Nbr 7 Total DBE % 14
MERCHANDISE_AMT_PO Sign 28 PO Amount 15

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

50331834.docx 8 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
NAME1 Char 40 Name 9
DESCR Char 30 Descr 10
B_OCR_PROC_TYPE Char 2 OCR Procurement 11
MTA_SW_GOALS_MWD Char 1 SW_GOALS_MD 12
B_DBE_ASIDE Char 3 DBE Set Aside 13
B_VND_CERT Char 3 Certified by MT 14
MTA_RATE_MBE_TOT Nbr 7 Total MBE % 15
MTA_RATE_WBE_TOT Nbr 7 Total WBE % 16
MTA_RATE_DBE_TOT Nbr 7 Total DBE % 17

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

50331834.docx 9 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
character fields with spaces.
Field Req’d Transformation Position (Start) Position (End) Length Description
Value
SETID Yes 1 5 5 SetID
CNTRCT_ID Yes 6 30 25 Buy Agree ID
AMT_CNTRCT_MAX Yes 31 57 27 Max. Amt
APPROVAL_DT Yes 58 67 10 Date
CNTRCT_BEGIN_DT Yes 68 77 10 Begin Dt
CNTRCT_EXPIRE_DT Yes 78 87 10 Expire Dt
VENDOR_ID Yes 88 97 10 Vendor
NAME1 Yes 98 137 40 Name
DESCR Yes 138 167 30 Descr
B_OCR_PROC_TYPE Yes 168 169 2 OCR Procurement
MTA_SW_GOALS_MWD Yes 170 170 1 SW_GOALS_MD
B_DBE_ASIDE Yes 171 173 3 DBE Set Aside
B_VND_CERT Yes 174 176 3 Certified by MT
MTA_RATE_MBE_TOT Yes 177 183 7 Total MBE %
MTA_RATE_WBE_TOT Yes 184 190 7 Total WBE %
MTA_RATE_DBE_TOT Yes 191 197 7 Total DBE %

50331834.docx 10 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

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

Record.Field, Page, New or Description of Business Pseudo code


Menu, Component, etc. Existing Action Rules/Logic
At a minimum, one (B_OCR_RUNCNTRL.
transaction type must be PO_REQUIRED_FLG =
specified on the run controls. ‘N’ AND
If no transaction type is B_OCR_RUNCNTRL.
B_OCR_RUNCNTRL. New SaveEdit selected, the page should not PO_CNTRCT_FLG = ‘N’)
PO_CNTRCT_FLG allow the user to save the run then display an error
controls or run the message – ‘Atleast one
application engine process. transaction type should be
specified’
B_OCR_RUNCNTRL.
PROCESS_NAME IsNull
Process Name and Directory OR
New SaveEdit
B_OCR_RUNCNTRL. ID should be provided by the B_OCR_RUNCNTRL.
B_IF_CONTROL_ID user to specify the target file B_IF_CONTROL_ID
location of the interface flat IsNull then display an
files. error message – ‘Process
Name and Directory ID
should be provided’

50331834.docx 11 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

Process Objects Impact Inventory and Description

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

Application Engine Program Flow


Provide a flow of the Application Engine processing. Include all sections to be used in the program.
Examples include: Main, Future, Group, and Wrap-up. This is similar to Housekeeping, Mainline, and
Wrap-up in SQR. Inside of each section, include the Steps that are being called. Include the actions that are
specified by each step. Possible actions could be “Do” actions (Do When, Do Until, Do Select, & Do
While actions that contain a SQL SELECT statement,), SQL, PeopleCode, Log Message, and Call Section.

Section Step Actio Comments


n
MAIN Step01 : Call Section Call the Section ‘INSERT’ to load State
Record and Open File
Step02 : Do when Check PO flag
Call Section Call the Section ‘PROCESS_PO’
Step03 : Do when Check Procurement flag
Call Section Call the Section ‘PROCESS_PROC’
Step04 : Call Section Call the Section ‘CLOSE’

INIT Step01 : SQL Select Run Control values into State Record
Step02 : PeopleCode Open the Log file for writing and write the
housekeeping information.

PROCESS_PO Step01 : SQL Insert into B_OCR_PO_TMP


Step02 : SQL Update
B_OCR_PO_TMP.DESCR254_MIXED
Step03 : PeopleCode Generate the Purchase Order file for OCR
systems.
Step04 : SQL Clear the Table B_OCR_PO_TMP

PROCESS_PROC Step01 : SQL Insert into B_OCR_PROC_TMP


Step02 : PeopleCode Generate the Procurement Contracts file for
OCR systems.
Step03 : SQL Clear the Table B_OCR_PROC_TMP

CLOSE Step01 : PeopleCode Write the control information and any error
informative messages to the Log file. Close
the log file.

50331834.docx 12 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

Application Engine Details

Modify/New Section/Step/Action -> SECTION_NAME.STEP_NAME.ACTION_TYPE

INIT.Step01.SQL: Select Run Control values into State Record B_OCR_INTF_AET

%Select (PROCESS_INSTANCE, PROCESS_NAME, B_IF_CONTROL_ID,


PO_REQUIRED_FLG, PO_CNTRCT_FLG, APPROVAL_DATE)
PROCESS_INSTANCE,
PROCESS_NAME,
B_IF_CONTROL_ID,
PO_REQUIRED_FLG,
PO_CNTRCT_FLG,
B_IF_FILE_PATH1,
APPROVAL_DATE

From PS_ B_OCR_RUNCNTRL

Where OPRID = %OperatorID


RUN_CNTL_ID = %RunControl

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.

Declare Function BSC_Open_File PeopleCode FUNCLIB_B_INTFC.B_IF_OPEN_FILE FieldFormula;

Global File &OCR_PO_File, &OCR_PROC_File, &Log_File;


Global string &BSC_FILE_PATH_NAME, &BSC_BACKUP_PATH, &BSC_LOG_PATH,
&BSC_FILE_OWNER, &BSC_FILE_GROUP;
Global string &BSC_FILE_PATH_NAME2, &BSC_BACKUP_PATH2, &BSC_LOG_PATH2,
&BSC_FILE_OWNER2, &BSC_FILE_GROUP2;

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);

/*Open (Create) the Log File for Writing:*/


&Log_File = GetFile(&BSC_LOG_PATH, "W", %FilePath_Absolute);

/*Write Housekeeping Information to Log File*/


&Log_File.WriteLine(CurDateTime() | ": Begin: Creating Purchase Order & Procurement Contracts File");
&Log_File.WriteLine(CurDateTime() | ": Created Log File");

&Log_File.WriteLine(CurDateTime() | ": Selected Run Control Parameters");


&Log_File.WriteLine(" PROCESS_INSTANCE :" | B_OCR_INTF_AET.
PROCESS_INSTANCE);
&Log_File.WriteLine(" PROCESS_NAME :" | B_OCR_INTF_AET.
PROCESS_NAME);

50331834.docx 13 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

&Log_File.WriteLine(" B_IF_CONTROL_ID :" | B_OCR_INTF_AET.


B_IF_CONTROL_ID);
&Log_File.WriteLine(" PO_REQUIRED_FLG :" | B_OCR_INTF_AET.
PO_REQUIRED_FLG);
&Log_File.WriteLine(" PO_CNTRCT_FLG :" | B_OCR_INTF_AET.
PO_CNTRCT_FLG);
&Log_File.WriteLine(" DATE_TO :" | B_OCR_INTF_AET.DATE_TO);
&Log_File.WriteLine(" B_IF_FILE_PATH1 :" | B_OCR_INTF_AET.
B_IF_FILE_PATH1);
&Log_File.WriteLine(" APPROVAL_DATE :" | B_OCR_INTF_AET.
APPROVAL_DATE);

/*If APPROVAL_DATE is null then default it to current date.*/

If B_OCR_INTF_AET.APPROVAL_DATE Is Null Then


B_OCR_INTF_AET.APPROVAL_DATE = CurrentDate();
End-If;

MAIN.Step02. Do when Call Section:

%SELECT (EXIST)
SELECT 'X' FROM PS_INSTALLATION WHERE %BIND (PO_REQUIRED_FLG) = 'Y'

PROCESS_PO.Step01.SQL: Insert into B_OCR_PO_TMP

INSERT INTO %Table (B_OCR_PO_TMP)

SELECT %Bind (PROCESS_INSTANCE),


, A.BUSINESS_UNIT
, A.PO_ID
, A.APPROVAL_DT
, A.VENDOR_ID
, D.NAME1
,''
, E.B_OCR_PROC_TYPE
, E.MTA_SW_GOALS_MWD
, E.B_DBE_ASIDE
, E.B_VEND_CERT
, E.B_RATE_MBE_TOT
, E.B_RATE_WBE_TOT
, E.B_RATE_DBE_TOT
, SUM (CASE C.CANCEL_STATUS WHEN 'A' THEN C.MERCHANDISE_AMT ELSE 0 END)
FROM PS_PO_HDR A
, PS_PO_LINE B
, PS_PO_LINE_SHIP C
, PS_VENDOR D
, PS_B_PO_DTL_TBL E
WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT
AND A.PO_ID = B.PO_ID
AND B.CNTRCT_ID = ' '
AND B.BUSINESS_UNIT = C.BUSINESS_UNIT
AND B.PO_ID = C.PO_ID
AND B.LINE_NBR = C.LINE_NBR

50331834.docx 14 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

AND D.SETID = A.VENDOR_SETID


AND D.VENDOR_ID = A.VENDOR_ID
AND C.BUSINESS_UNIT = E.BUSINESS_UNIT
AND C.PO_ID = E.PO_ID
AND E.MTA_GOALS_MWD = 'Y'
AND A.PO_STATUS = 'A'
AND A.APPROVAL_DT = %bind (APPROVAL_DT)
GROUP BY A.BUSINESS_UNIT, A.PO_ID, A.APPROVAL_DT, A.VENDOR_ID, D.NAME1
, E.B_OCR_PROC_TYPE, E.B_GOALS_MWD, E.B_DBE_ASIDE, E.B_VEND_CERT
, E.B_RATE_MBE_TOT, E.B_RATE_WBE_TOT, E.B_RATE_DBE_TOT

PROCESS_PO.Step02.SQL: Update B_OCR_PO_TMP.DESCR254_MIXED field

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.

Global File &OCR_PO_File, &Log_File;


Global string &PO_COUNT, &BSC_FILE_PATH;

&BSC_FILE_PATH = Substring (&BSC_FILE_PATH, 1, (Len(&BSC_FILE_PATH) - 4)) | 


"_OCI_EXTRACT_PO" | ".TXT" ;

/*Open (Create) the Output File for Writing:*/


&OCR_PO_File = GetFile(&BSC_FILE_PATH_NAME, "W", %FilePath_Absolute);

If &OCR_PO_File.IsOpen Then

/*Write the Purchase Order Record to the output file.*/

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 */

50331834.docx 15 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

End-If;

PROCESS_PO.Step04.SQL: Clear the Temporary Table before the program ends.

%TruncateTable(%Table(B_OCR_PO_TMP))

MAIN.Step03. Do when Call Section:

%SELECT (EXIST)
SELECT 'X' FROM PS_INSTALLATION WHERE %BIND (PO_CNTRCT_FLG) = 'Y'

PROCESS_PROC.Step01.SQL: Insert into B_OCR_PROC_TMP

INSERT INTO %Table (B_OCR_PROC_TMP)

SELECT %Bind (PROCESS_INSTANCE),


, A.SETID
, A.CNTRCT_ID
, A.AMT_CNTRCT_MAX
, A.APPROVAL_DT
, A.CNTRCT_BEGIN_DT
, A.CNTRCT_EXPIRE_DT
, A.VENDOR_ID
, B.NAME1
, A.DESCR
, C.B_OCR_PROC_TYPE
, C.MTA_SW_GOALS_MWD
, C.B_DBE_ASIDE
, C.B_VEND_CERT
, C.MTA_RATE_MBE_TOT
, C.MTA_RATE_WBE_TOT
, C.MTA_RATE_DBE_TOT
FROM PS_CNTRCT_HDR A
, PS_VENDOR B
, MTA_CNTRCT_DTL C
WHERE A.VENDOR_SETID = B.SETID
AND B.VENDOR_ID = A.VENDOR_ID
AND A.SETID = D.SETID
AND A.CNTRCT_ID = C.CNTRCT_ID
AND A.CNTRCT_STATUS = 'A'
AND A.APPROVAL_DT = %bind (APPROVAL_DT)

PROCESS_PROC.Step02. Peoplecode: Generate the Procurement Contracts file for OCR systems.

Global File &OCR_PROC_File, &Log_File;


Global string &PROC_COUNT, &BSC_FILE_PATH;

&BSC_FILE_PATH = Substring (&BSC_FILE_PATH, 1, (Len(&BSC_FILE_PATH) - 4)) | 


"_OCI_EXTRACT_PROC" | ".TXT" ;

/*Open (Create) the Output File for Writing:*/


&OCR_PROC_File = GetFile(&BSC_FILE_PATH_NAME, "W", %FilePath_Absolute);

50331834.docx 16 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

If &OCR_PROC_File.IsOpen Then

/*Write the Purchase Order Record to the output file.*/

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;

PROCESS_PROC.Step03.SQL: Clear the Temporary Table before the program ends.

%TruncateTable(%Table(B_OCR_PROC_TMP))

CLOSE.Step01.PeopleCode: Write the Housekeeping information to the log file.

Declare Function BSC_Close_File PeopleCode FUNCLIB_B_INTFC.B_IF_CLOSE_FILE FieldFormula;

Global File &OCR_PO_File, &OCR_PROC_File, &Log_File;


Global string &PO_COUNT, &PROC_COUNT;
Global string &BSC_FILE_PATH_NAME, &BSC_BACKUP_PATH, &BSC_LOG_PATH,
&BSC_FILE_OWNER, &BSC_FILE_GROUP;
Global string &BSC_FILE_PATH_NAME2, &BSC_BACKUP_PATH2, &BSC_LOG_PATH2,
&BSC_FILE_OWNER2, &BSC_FILE_GROUP2;

/*Check if any records were processed by this run and write the housekeeping information.*/

If &PO_COUNT > 0 Then


&Log_File.WriteLine(“***** Total Number of Records Processed in this run: “ | &PO_COUNT |
“*****”);
Else
&Log_File.WriteLine(“***** No records were processed for Purchase Order file *****”);
End-If;

If &PROC_COUNT > 0 Then


&Log_File.WriteLine(“***** Total Number of Records Processed in this run: “ |
&PROC_COUNT | “*****”);
Else
&Log_File.WriteLine(“***** No records were processed Procurement Contracts *****”);
End-If;

50331834.docx 17 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

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:

1 – Approval Date From


2 – Approval Date To
3 – Transaction Amount Minimum

Report Execution:
Executed through PS Query Manager/Query Viewer

50331834.docx 18 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

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.

Direction Message Node Name Message Node Description


Which direction? Routing roles for Include Node Name Description of Node
Channel. (PSFT_HR for example)

Message PeopleCode
List out PseudoCode and logic for any message PeopleCode

Message Layout or MockUp


Provide a message XML Layout

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

SQC’s, Copybooks, of Function called by the program.


Name Usage

Audit and Control Reporting


(If the interface requires a control report, provide the details of that report in this section.)

Error and Commit/Restart Processing


(Describe the commit processing of the program upon failure. (i.e. If the program fails on record 15000,
did the previous 14,999 get committed to the databse? Can the program be restarted from the point where

50331834.docx 19 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

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.

Unit Test Conditions

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:

50331834.docx 20 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

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.

50331834.docx 21 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture
Technical Design Document
TD_PO039I – OCR Contract and PO Interface

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

50331834.docx 22 of 22 12/17/2009 1:34:00 PM


Proprietary & Confidential to MTA & Accenture

You might also like