"Replace" Transaction Codes

The following example Shipment XML structure illustrates the basic rules for transaction codes starting with "R".

Shipment
	ShipmentHeader
		TransactionCode RC
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A

If the data is not found in database, the shipment is inserted into database. In this case, the RC is equivalent to IU. The use cases described in the following sections are edited from this XML.

  • Remove ShipmentStop 2 and two ShipUnitContents of ShipUnit A from the above XML.
  • Expected result: ShipmentStop 2, two shipUnitContents as well as their corresponding children are deleted from database.
Shipment
	ShipmentHeader
		TransactionCode RC
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	<!-- ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B -->
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1
	ShipUnit: ShipUnitGid=ShipUnit B
		<!--ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4 -->
	SEquipment: SEquipment_A
  • Remove ShipmentStop 2 from the original XML and add ManagedChild=ShipmentStop.
  • Expected result: ShipmentStop 2 and all its child tables are deleted from database.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild =ShipmentStop
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	<!-- ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B -->
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A

If the Is_permanent of the above stop in database equals true or the ManagedChild is set to a value other than ShipmentStop or ShipmentStopDetail, the stop as well as it child tables are not able to be removed from database.

  • Remove ShipmentStopDetail elements of ShipmentStop 2 and add ManagedChild = ShipmentStop from the original XML.
  • Expected result: ShipmentStopDs of ShipmentStop 2 are deleted from database.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild =ShipmentStop
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		<!-- ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B -->
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A

You can set ManagedChild=ShipmentStopDetail in order to get the same result.

  • Remove ShipmentStopDetail elements of ShipmentStop 2 and ShipUnitContent elements of ShipUnit A with ManagedChild= ShipmentStop from the original XML.
  • Expected result: ShipmentStopDs for ShipmentStop 2 are deleted. SShipUnitLines are unchanged. In theory, SShipUnitLines should be deleted too. However, this is an exception case since ShipUnit, SEquipment and Text are not really child or grandchild nodes of shipment. They can independently exist in database. In order to delete ShipUnitContent, you have to specify the ShipUnitContent in ManagedChild as described in next section
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild =ShipmentStop
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		<!-- ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B -->
	ShipUnit: ShipUnitGid=ShipUnit A
		<!-- ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1 -->
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A
  • Remove ShipUnitContent elements of ShipUnit A with ManagedChild=ShipUnit or ManagedChild=ShipUnitContent.
  • Expected result: The SShipUnitLines 0 and 1 are deleted from database. SShipUnit in the XML is replaced.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild = ShipUnitContent
			OR
		ManagedChild = ShipUnit
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B 
	ShipUnit: ShipUnitGid=ShipUnit A
		<!-- ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1 -->
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A
  • Add two or more ManagedChild elements (ManagedChild=ShipmentStop, ManagedChild=ShipUnit) and remove ShipmentStopDetail elements in ShipmentStop 2 and ShipUnitContent elements of ShipUnit A.
  • Expected result: ShipmentStopDs of ShipmentStop 2 and SShipUnitLines of ShipUnit A are unchanged.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild =ShipmentStop
		ManagedChild =ShipUnit
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		<! -- ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B -->
	ShipUnit: ShipUnitGid=ShipUnit A
		<!-- ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1 -->
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A
  • Remove ShipUnit A and the ShipUnitContent 3 and 4 for the remaining ShipUnit B with ManagedChild=ShipUnit.
  • Expected result: SShipUnit corresponding to ShipUnit A is unchanged. SShipUnit corresponding to ShipUnit B is replaced. The SShipUnitLines corresponding to ShipUnitContents 3 and 4 are deleted from database.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild = ShipUnit
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	<!-- ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1 -->
	ShipUnit: ShipUnitGid=ShipUnit B
		<!-- ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4 -->
	SEquipment: SEquipment_A
  • The same result can be achieved through specifying the transaction code R and ManagedChild = ShipUnitContent in ShipUnit B.
Shipment
	ShipmentHeader
		TransactionCode RC
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B 
	<!-- ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1-->
	ShipUnit: ShipUnitGid=ShipUnit B
		TransactionCode= R
		ManagedChild = ShipUnitContent
		<!-- ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4 -->
	SEquipment: SEquipment_A
  • Change ManagedChild = SEquipment with TransactionCode= RC in ShipmentHeader.
  • Expected result: SEquipment_A data in database will be replaced with SEquipment data.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild = SEquipment
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
		ShipUnitContent: LineNumber=1
	ShipUnit: ShipUnitGid=ShipUnit B
		ShipUnitContent: LineNumber=3
		ShipUnitContent: LineNumber=4
	SEquipment: SEquipment_A
  • Remove ShipmentStop 2 with ManagedChild=ShipmentStop from the original XML and change the transaction code to R.
  • Expected result: ShipmentStop 2 and all its child tables are deleted. The shipment table is replaced (This is different from transaction code RC).
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild =ShipmentStop
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0 
	SEquipment: SEquipment_A
  • Change the transaction code to RP in the XML above.
  • Expected result: Only shipment table is replaced. The ManagedChild element is ignored. ShipmentStop 2 and all its child tables are unchanged.
Shipment
	ShipmentHeader
		TransactionCode RC
		ManagedChild =ShipmentStop
	ShipmentStop=1
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B
	<!-- ShipmentStop=2
		ShipmentStopDetail: ShipUnitGid=ShipUnit A
		ShipmentStopDetail: ShipUnitGid=ShipUnit B -->
	ShipUnit: ShipUnitGid=ShipUnit A
		ShipUnitContent: LineNumber=0
	SEquipment: SEquipment_A

The value for element ManagedChild is defined in CHILD_ELEMENT_ALIAS column of INT_MANAGED_CHILDREN_MAP table. This value can be viewed or edited from Power Data page found by navigating to Business Process Automation > Power Data > Integration > Managed Children Map.