Running the E-Commerce Order Comparison Program

Purpose: Use the e-commerce order comparison program to generate a report identifying any discrepancies between the e-commerce orders sent by an integrated system, and the actual orders that were created in CWSerenade.

In this topic:

Generating the E-Commerce Order Comparison Report

Deleted Order Table

E-Commerce Order Comparison Report

Generating the E-Commerce Order Comparison Report

Order comparison process: The ECOMMCH periodic function:

• compares the records in the Ecommerce Order Comparison table with the records in the Order Header, Order Header Extended, and Deleted Order tables to determine whether each order in the Ecommerce Order Comparison table is accounted for.

• generates a report listing the results.

About the Ecommerce Order Comparison table: In order for the comparison to take place, the external system that sends orders to CWSerenade through the order API populates this table with all orders that should have been created in CWSerenade. Each record identifies the external system’s information on:

• the e-commerce order number sent by the external system in the CWOrderIn message. When CWSerenade creates the order, it writes this order number to the E-comm order number field in the Order Header Extended table.

• the order number assigned by CWSerenade.

What is a match? In order for the comparison program to qualify an order as a match, an existing or deleted order in CWSerenade must match both the order number and the e-commerce order number of a record in the Ecommerce Order Comparison table. If an order matches on only one of these fields (either order number or e-commerce order number, but not both), it is a mismatched order.

Why check the Deleted Order table? An order received through the order API could be deleted in a number of ways, including the Order Reject Request Message (CWORDERREJECT), the EC_CLEANUP process, deleting an order from an order batch, or rejecting the entire batch. Since the comparison program checks the Deleted Order table, you can determine whether the order was ever received into CWSerenade; and, if it was deleted, you can use the Deleted Order table to establish how it was deleted. See the Deleted Order Table for more information.

How to run the comparison program: The ECOMMCH periodic function (Program name: PFORDXCHK) runs the comparison and generates the E-Commerce Order Comparison Report.

The report identifies:

• the number of existing matching orders

• the number of matching orders that were created and then deleted

• mismatched orders (the e-commerce order number and CWSerenade order number are not consistent) that are either existing or deleted

• missing orders that were never created in CWSerenade

See the E-Commerce Order Comparison Report for more information on the report.

Examples:

Matched existing order

Ecommerce Order Comparison record:

• Ecommorder: ORD123

• Ordnbr: 54321

 

Matching Order Header Extended record:

• E-comm order number: ORD123

• Order #: 54321

 

Result: The order is included in the Matched orders total on the E-Commerce Order Comparison Report.

Matching deleted order

Ecommerce Order Comparison record:

• Ecommorder: ORD456

• Ordnbr: 87654

 

Matching Deleted Order record:

• EcommOrder: ORD456

• Ordernbr: 87654

 

Result: The order is included in the Deleted matched orders total on the E-Commerce Order Comparison Report.

E-commerce cross-reference found for existing order, but order number does not match

Ecommerce Order Comparison record:

• Ecommorder: ORDXYZ

• Ordnbr: 99999

 

Mismatched Order Header Extended record:

• E-comm order number: ORDXYZ

• Order #: 99997

 

Result: The order is included in the Mismatched orders total and listed with a reason of E-commerce order found with different Serenade # on the E-Commerce Order Comparison Report.

E-commerce cross-reference found for deleted order, but order number does not match

Ecommerce Order Comparison record:

• Ecommorder: ORDQRX

• Ordnbr: 56565

 

Mismatched Deleted Order record:

• EcommOrder: ORDQRX

• Ordernbr: 56566

 

Result: The order is included in the Mismatched orders total and listed with a reason of Deleted E-commerce Order found with different Serenade # on the E-Commerce Order Comparison Report.

Order number found for existing order, but e-commerce order number does not match

Ecommerce Order Comparison record:

• Ecommorder: ORDSVV

• Ordnbr: 23232

 

Mismatched Order Header Extended record:

• E-comm order number: blank

• Order #: 23232

 

Result: The order is included in the Mismatched orders total and listed with a reason of Order found with different E-Commerce # on the E-Commerce Order Comparison Report.

Note: The result would be the same if the E-comm order number for the existing order were not blank, but instead any number that did not match the Ecommerce Order Comparison record.

Order number found for deleted order, but e-commerce order number does not match

Ecommerce Order Comparison record:

• Ecommorder: ORDSRB

• Ordnbr: 27272

 

Mismatched Deleted Order record:

• EcommOrder: ORDHEB

• Ordernbr: 23232

 

Result: The order is included in the Mismatched orders total and listed with a reason of Order found with different E-Commerce # on the E-Commerce Order Comparison Report.

Note: The result would be the same if the EcommOrder for the deleted order were blank.

Order not found

E-Commerce Order Comparison record:

• Ecommorder: ORDZZZ

• Ordnbr: 22222

 

Order Header Extended table and Deleted Order table: No records match either e-commerce order number or order number.

 

Result: The order is included in the Orders not found total and listed with a reason of Deleted order found with different E-Commerce # on the E-Commerce Order Comparison Report.

Note: Matching is not case-sensitive. An Ecommorder of abcde matches an E-comm order number of ABCDE.

Updating the Ecommerce Order Comparison table: After the process completes and generates the E-Commerce Order Comparison Report, it updates the Dateprocessed and Status in the Ecommerce Order Comparison table.

Purging records from the Ecommerce Order Comparison table and the Deleted Order table: The COMPARE_AND_DELETE_PURGE_DAYS property in Working with Cloud Properties (CPRP) indicates how long to retain records in the  Deleted Order Table and Ecommerce Order Comparison table based on the Date deleted for the Deleted Order record and the Dateprocessed for the Ecommerce Order Comparison record.

When you restart the CWSerenade application server, the system purges records older than the number of days defined in the property. If you do not define a number of days in the COMPARE_AND_DELETE_PURGE_DAYS property, the system purges records once they are 30 days old.

Deleted Order Table

Purpose: Use this table to:

• enable the e-commerce order comparison program to identify orders that were not created or retained as expected through the order API. See the Running the E-Commerce Order Comparison Program for more information.

• research and troubleshoot general questions related to deleted orders.

Records written when? The system writes a record to this table when you delete an order through:

• rejecting an order batch

• deleting an order in an order batch

• purging an individual order through the Purge Orders by Order Number (MORP) option

• purging suspended orders through the Purging Suspended Orders (PSOR) option

• using the Order Reject Request Message (CWORDERREJECT)

• the EC_CLEANUP job

Records not written when: The system does not write a record when:

• you reject an order in order entry

• the order API replaces an existing order without payment after receiving an additional CWOrderIn message for the same order, identified by the e-commerce cross-reference number

• you run the PURGEOR periodic function to purge closed orders

• you use the Purging Orders (MPOR) option to purge closed orders

Information in the Deleted Order table:

• Company code (Company)

• Order number (Ordernbr)

Job: Possible jobs and when they are written:

EC_CLEANUP: The EC_CLEANUP job deletes an abandoned order. In this case, the Process is E-Commerce Cleanup. See E-Commerce Processes for background.

ORDREJTAPI: You receive the Order Reject Request Message (CWORDERREJECT).

PURGE_SUSP: You purge a range of suspended orders through Purging Suspended Orders (PSOR). In this case, the Process is Purge Suspended Orders.

REJECT_BAT: You reject a batch in batch order entry. In this case, the Process is Reject Order Batch. See Rejecting the Batch for background.

• User session ID, such as QPADEV039C: Either you delete an order from a batch at the Work with Orders Within a Batch Screen (in this case, the Process is Deleted Order from Batch); or you use the Purge Orders by Order Number (MORP) (in this case, the Process is Individual Order Purge); or you delete an individual suspended order through the Purging Suspended Orders (PSOR) option (in this case, the Process is Individual Suspended Order Purge)

• User ID (UserId): Identifies the user who performed the action or submitted the job that deleted the order. Set to your default user when you receive the Order Reject Request Message (CWORDERREJECT).

• Date deleted (DateDeleted): The date and time when the deletion occurred. Datetime format.

Process: Possible processes and when they are written:

Deleted Order from Batch: You delete an order from a batch.

E-Commerce Cleanup: The EC_CLEANUP job deletes an abandoned e-commerce order. In this case, the User ID is EC_CLEANUP.

Individual Order Purge: You purge a single order through the Purge Orders by Order Number (MORP) option. In this case, the Job is the session ID, such as QPADEV039C.

Individual Suspended Order Purge: You purge a single order through the Purging Suspended Orders (PSOR) option. In this case, the Job is the session ID, such as QPADEV039C.

Order Reject API: You receive the Order Reject Request Message (CWORDERREJECT).

Purge Suspended Orders You purge a range of suspended orders through the Purging Suspended Orders (PSOR) option. In this case, the Job is PURGE_SUSP.

Reject Order Batch: You reject a batch in batch order entry. In this case, the Job is REJECT_BAT.

• System date (SystemDate): The system date when the deletion occurred. YYMMDD format.

• Program stack (PgmStack): The programs in the stack when the order was deleted.

• E-commerce order number (EcommOrder): The e-commerce order number, if any, from the Order Header Extended table, identifying the order to an external system:

• Set to None Found if there was no Order Header Extended record for the order.

• Blank if there was an Order Header Extended record, but the E-commerce order cross reference number field was blank.

For more information: For information on purging orders using the above methods, see:

• EC_CLEANUP: Working with E-Commerce Job Control (EJCT)

Purging Suspended Orders (PSOR)

Purge Orders by Order Number (MORP)

• deleting an order from a batch or rejecting the entire batch: Accepting or Rejecting the Order Batch

Rejecting the Order (Order API)

Purging outdated records: The COMPARE_AND_DELETE_PURGE_DAYS property in Working with Cloud Properties (CPRP) indicates how long to retain records in the Deleted Order table based on the Date deleted for the Deleted Order record. The same entry applies to records in the Ecommerce Order Comparison record based on the Dateprocessed; see Running the E-Commerce Order Comparison Program for background.

When you restart the CWSerenade application server, the system purges records older than the number of days defined in the property. If you do not define a number of days in the COMPARE_AND_DELETE_PURGE_DAYS property, the system purges records once they are 30 days old.

SO10_20 OROMS 5.0 2018 OTN