Order Line History In API

Overview: Use the Order Line History In API to receive order line history activity for a specified order line on an order, based on XML messages from an external system, such as a warehouse management system.

In this chapter:

Order Line History API Setup

Order Line History In Process

Order Line History In Message (CWOrdLnHstIn)

Order Line History API Setup

Before you can use the Order Line History In API, you must perform the necessary setup.

Order line activity codes: Use the Working with Order Line Activity Codes (WOLA) menu option to create any user defined order line activity codes you wish to send to Order Management System in the Order Line History In Message (CWOrdLnHstIn). The system automatically creates the System Delivered Order Line Activity Codes in the Order Line Activity table and displays them on the Work with Order Line Activity Codes Screen; however, you cannot send system delivered order line activity codes in the Order Line History In message.

CWServiceIn web service: The CWServiceIn web service allows an external system to post the Order Line History In Message (CWOrdLnHstIn) directly to Order Management System and receive responses without the need of any queues.

Web service authentication? Use the Working with Web Service Authentication (WWSA) menu option to define a valid user for basic web service authentication. If you use Oracle Identity Cloud Service for password authentication, in addition to creating the web service authentication user in Work with Web Service Authentication (WWSA), you must also create a corresponding user profile in Oracle Identity Cloud Service and assign the user to the corresponding web service role defined for the Order Management application.

To use the CWServiceIn web service, you must define the endpoint:

If you are using the CWServiceIn RESTful web service: You POST inbound CWServiceIn messages to the web service’s URI, or endpoint, of the RESTful service. The individual URL for the CWServiceIn RESTful service uses the following format: http://server:port/SerenadeSeam/sxrs/application/CWServiceIn, where server:port identifies the application server where the RESTful service is located and CWServiceIn is the name of the web service to call.

If you are using the CWServiceIn SOAP-based web service: The endpoint specified in the CWServiceIn.wsdl file is where you need to post messages in order for the CWServiceIn web service to process them. The endpoint is typically set to http://server:port/CWDirectCPService/services/CWServiceIn, where server:port identifies the application server where the wsdl is located and CWServiceIn is the name of the web service to call.

Note: Since SOAP web services will be deprecated in a future release, Oracle recommends that you transition to the use of the RESTful web service.

The CWServiceIn web service requires that inbound messages be embedded in SOAP envelope tags. A sample XML message embedded in a SOAP envelope is presented below.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dom="http://dom.w3c.org">

<soapenv:Header />

<soapenv:Body>

<dom:performAction type="xsd:string">

<![CDATA[

 

<Message source="External" target="CWSerenade" type="CWORDLNHSTIN" resp_qmgr="" resp_q="">

<Header company_code="7" order_number="3963">

<ShipTos>

<ShipTo ship_to_number="1">

<OrderLineHistorys>

<OrderLineHistory order_detail_seq="1" activity_code="T" quantity="1" contact_date="101112" contact_time="101112" delivery_provider="KB" ext_sys_date="091011" user="SHELDON" ext_ref_nbr="2"/>

</OrderLineHistorys>

</ShipTo>

</ShipTos>

</Header>

</Message>

 

]]>

</dom:performAction>

</soapenv:Body>

</soapenv:Envelope>

Order Line History In Process

You can use the Order Line History In API to create order line activity for a specified line on an order. The steps are:

1.

An external system sends an Order Line History In Message (CWOrdLnHstIn) to Order Management System using the CWServiceIn web service.

2.

Order Management System receives the message and writes the message to the MQ Log if its Logging Level is set to INFO or lower.

3.

Order Management System determines if the XML message is well formed.

• If the XML message is not well formed, the system returns a simple response with the error Invalid XML Message and does not perform any further updates; see Order Line History In Errors.

• If the XML message is well formed, the system continues to the next step.

4.

Order Management System determines if any errors exist in the Header element of the message.

• If an error exists in the Header element of the message, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

• If an error does not exist in the Header element of the message, the system continues to the next step.

5.

Order Management System determines if any errors exist in the first ShipTo element of the message.

• If an error exists in the first ShipTo element of the message, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

• If an error does not exist in the first ShipTo element of the message, the system determines if any errors exist in the first OrderLineHistory element for the first ShipTo.

- If an error exists in the first OrderLineHistory for the first ShipTo, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

- If an error does not exist in the first OrderLineHistory element for the first ShipTo, the system creates a record in the Order Line History table.

Order Management System determines if any errors exist in the next OrderLineHistory element for the first ShipTo element of the message.

• If an error exists in the next OrderLineHistory element for the first ShipTo, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

• If an error does not exist in the next OrderLineHistory element for the first ShipTo, the system creates a record in the Order Line History table.

6.

Once Order Management System finishes processing the first ShipTo element and its OrderLineHistory elements, the system determines if any errors exist in the next ShipTo element of the message.

• If an error exists in the next ShipTo element of the message, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

• If an error does not exist in the next ShipTo element of the message, the system determines if any errors exist in the first OrderLineHistory element for this ShipTo.

- If an error exists in the first OrderLineHistory element for this ShipTo, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

- If an error does not exist in the first OrderLineHistory element for this ShipTo, the system creates a record in the Order Line History table.

Order Management System determines if any errors exist in the next OrderLineHistory element for this ShipTo element of the message.

• If an error exists in the next OrderLineHistory element for the ShipTo, the system returns a simple response with a description of the error and does not perform any further updates; see Order Line History In Errors.

• If an error does not exist in the next OrderLineHistory element for the ShipTo, the system creates a record in the Order Line History table.

7.

If Order Management System finishes processing the Order Line History In Message (CWOrdLnHstIn) without any errors, the system returns a simple response of OK. You can review the order line history records created on the Display Order Line History Screen.

Order Line History In Errors

If the Order Line History In Message (CWOrdLnHstIn) contains an error, the system returns a simple response with a description of the error.

Error Message

Reason For Error

Invalid XML Message

The Order Line History In Message (CWOrdLnHstIn) is not a well formed XML message.

Invalid XML Message: ERROR: Invalid Target.

The web service used to post the Order Line History In Message (CWOrdLnHstIn) directly to Order Management System is not set up correctly; see Order Line History API Setup.

Invalid XML Message: ERROR: Company is not found.

The company_code in the Order Line History In Message (CWOrdLnHstIn) is not a valid company.

Invalid XML Message ERROR: Order 9999 not found.

The order_number in the Order Line History In Message (CWOrdLnHstIn) is not a valid order number for the specified company_code.

Invalid XML Message ERROR: Order 9999 Ship To 9 not found.

The ship_to_number in the Order Line History In Message (CWOrdLnHstIn) is not a valid ship to number for the specified order_number.

Invalid XML Message ERROR: Order 9999 Ship To 9 Detail 9 not found.

The order_detail_seq in the Order Line History In Message (CWOrdLnHstIn) is not a valid order detail sequence number for the specified ship_to_number.

Invalid XML Message ERROR: Activity S is a system value.

The activity_code in the Order Line History In Message (CWOrdLnHstIn) is a system delivered activity code. See System Delivered Order Line Activity Codes.

Invalid XML Message ERROR: Activity Q not found.

The activity_code in the Order Line History In Message (CWOrdLnHstIn) is not a valid activity code in the Order Line Activity table. See Working with Order Line Activity Codes (WOLA).

Order Line History In Message: Sample XML

A sample of the Order Line History In Message (CWOrdLnHstIn) is presented below.

<Message source="WMS" target="CWSerenade" type="CWORDLNHSTIN">

<Header company_code="7" order_number="3965">

<ShipTos>

<ShipTo ship_to_number="1">

<OrderLineHistorys>

<OrderLineHistory order_detail_seq="1" activity_code="K" quantity="1" contact_date="101112" contact_time="101112" delivery_provider="KB" ext_sys_date="091011" user="SFLYE" ext_ref_nbr="2" />

<OrderLineHistory order_detail_seq="1" activity_code="L" quantity="1" contact_date="101112" contact_time="101112" delivery_provider="KB" ext_sys_date="091011" user="JJANE" ext_ref_nbr="2" />

</OrderLineHistorys>

</ShipTo>

<ShipTo ship_to_number="2">

<OrderLineHistorys>

<OrderLineHistory order_detail_seq="1" activity_code="L" quantity="1" contact_date="101112" contact_time="101112" delivery_provider="KB" ext_sys_date="091011" user="JJANE" ext_ref_nbr="2" />

</OrderLineHistorys>

</ShipTo>

</ShipTos>

</Header>

</Message>

Successful Response: If the Order Line History In message is well formed and contains valid data, Order Management System creates a record in the Order Line History table for each OrderLineHistory element passed in the message and returns a simple response of OK.

Error Response: If an error exists in the Order Line History In message, the system returns a simple response with a description of the error and does not perform any further updates. For example: Invalid XML Message ERROR: Activity S is a system value.

Order Line History In Message (CWOrdLnHstIn)

 

Order Management System receives and processes this message to create order line history records for an order line. See Order Line History In Process for processing details.

Sample message: See Order Line History In Message: Sample XML.

Name

Type

Length

Comments

Message

One Message element is required.

source

alpha

25

The source of the XML message. Informational only.

target

alpha

25

The target of the XML message, such as OROMS. Informational only.

type

alpha

25

CWORDLNHSTIN indicates the message is an Order Line History In message.

resp_qmgr

alpha

25

Informational only.

resp_q

alpha

25

Informational only.

Header

One Header element is required.

company_code

numeric

3

Required.

A code for the company where the order associated with the order line history update exists.

Updates Company in the Order Line History table.

order_number

numeric

8

Required.

The order number that contains the order line whose order line history you wish to update.

Updates Order # in the Order Line History table.

ShipTo

One or more ShipTo elements are required.

ship_to_number

numeric

3

Required.

The order ship to that contains the order line whose order line history you wish to update.

Updates Ship to # in the Order Line History table.

OrderLineHistory

One or more OrderLineHistory elements are required.

order_detail_seq

numeric

5

Required.

The order line whose order line history you wish to update.

Updates Seq # in the Order Line History table.

activity_code

alpha

1

Required.

A code for the type of activity performed against the order line.

Order line activity codes are defined in and validated against the Order Line Activity table; see Working with Order Line Activity Codes (WOLA).

You can pass any user defined activity code in the Order Line History In message.

If the activity code does not exist in the Order Line Activity table, or you pass a system delivered activity code, the system places the message in error.

Updates Activity in the Order Line History table.

quantity

numeric

5

Optional.

The quantity of the item on the order line associated with the order line activity update. Informational only. The system does not validate the quantity passed against the Ordered, Reserved, Shipped, or Printed quantity on the order line.

Updates Qty in the Order Line History table.

contact_date

numeric

7

Optional.

The date associated with the order line activity, in MMDDYYYY format.

Updates Contact date in the Order Line History table.

contact_time

numeric

6

Optional.

The time the activity occurred, in HHMMSS format.

Updates Contact time in the Order Line History table.

delivery_provider

alpha

15

Optional.

Identifies the name of the delivery provider. Informational only.

Updates Delivery provider in the Order Line History table.

ext_sys_date

numeric

7

Optional.

The date the message was processed in the external system, in MMDDYYYY format. Informational only.

Updates External system date in the Order Line History table.

user

alpha

10

Optional.

The user who performed the activity against the item on the order line.

User IDs are defined in and validated against the User table.

EXTERNAL defaults if a user ID is not passed in the message or is invalid.

Updates User in the Order Line History table.

ext_ref_nbr

alpha

20

Optional.

An external reference number provided by the external system. Informational only.

Updates External reference# in the Order Line History table.

CS05_15 OMSCS 19.0 December 2019 OHC