Split Sales Order and Line Number Assignment

Purpose of Document

This note discusses how a sales order detail line gets split and what is the incrementer by analyzing the business function B4200450 - AdvancedSODetailLineSplit (Advanced SO Detail Line Split).

Disclaimer: This document is intended for someone with developer level knowledge.

This note is created based on E1 application release 9.0

The sales order line split can be performed via:

Objects Calling B4200450

The following objects can call B4200450 to split a sales order detail line. The split may take place during inventory commitment.

Source Module

Description

Condition to Call B4200450

Hard

Comm

Incre

Note

B3100770 B3100770CompletionsEndDoc Parent WO (F4801.PARS is Blank) AND cItemBranchStockingType IN ('C', 'K') 1 N/A
B4200310 F4211FSEditLine
F4211FSEndDoc
Bug 12494911 (SAR 5720736) Move the warehousing split line logic to after Commitment Preference split line logic.
B4200380 InventoryAvailAndCommitment 0.1
0.01
0.001
If enough quantity is not available from this location to ship the entire line, commit from this location only the quantity that is available. Split the sales detail line into two lines. The new line will contain the quantity shippable from this item location while the original line will contain the quantities remaining, backordered and cancelled.

mnLineIncremeneter
  • 0.100: Kit (when F4211.RLIT is specified) and Default in P4205 to record quantity back order
  • 0.010: Kit Child (Component)
  • 0.001: When it is specified (e.g., Multiple Location) and default in P4210

So when F4211.RLIT (Item Number - Related (Kit)) is Blank then mnLineIncrementer is .001 else, 0.1.

B4200970 F4211UpdateBackorderInfo N/A Bug 10962693 (SAR 8519641) TMS kit component lines processed without a parent must be split and have the kit information cleared for the shippable line
B4201300 F42UI130F4211SODetailLineSplit N/A Loop through the work file records, splitting the S/O Detail & committing Inventory
B4277720 ProcessReleasefromAllocation N/A Order Fullfilment
B4601100 CrossDockingCommitments Through Cross Docking Commit, Split and Adjust N/A This function is the main allocation function in planned cross docking. It takes a supply quantity coming from PO Receipts or WO Completions and cross docks it to the sales order lines that have been selected and prioritized for cross-docking. Sales order lines are hard committed, inventory is updated, and warehouse requests are created if necessary. If sales order lines are backordered, this function tries to first release as much back ordered quantity as possible. If only partial quantity on a sales order line can be cross-docked, it splits the line and allocates only one part.
N4002540 F4211DirectShipIntegrityReceipts N/A During Partial receipt split Sales Order Detail line
N4200790 ShipConfirmEndDoc N/A Partial Shipment, Multiple Locations and Kit / Components.
Incrementer is 0.001 for multi-location and .1 for others
N4200860 BackorderReleaseEndDoc SOBK > 0 .100
N4201790 DuplicateWorkOrderComponents 0.10 Call B4201780 - ProcessKitSplitLIneCache (Process Kit Split Line Cache) to check whether to split Sales Order Line or not
N4600448 WarehouseAdjustSalesOrderLine .001
N4900330 ApproveShipment .100 evt_CommittedHS is equal to "K"
N4900960 TransportationAdjustOrderLine Undership or Overship .100
P42040 Speed Status Update F4211.SOBK <> 0 OR F4211.SOCN <> 0 N/A We need to split the sales order line if it has a Backordered or Canceled quantity. Otherwise, the backordered quantity will remain on a sales order line at the wrong status and in the warehouse. This quantity needs to stay at the status it is at and we should not create a request for any quantity that is not shippable.

Split the shippable quantity of of the backordered quantity using the Advance SO Line Splitter. This BSFN requires a pointer to the original SO line so we need to create a pointer by calling the Verify and Get SO Line BSFN.
R46150 F4211.SOBK <> 0 OR F4211.SOCN <> 0 N/A Same with P42040 (Speed Status Update)

Note:

How To Call B4200450

1. B4200210 - VerifyandGetSalesDetail (F4211 Get Sales Detail Row)
2. B4200450 - AdvancedSODetailLineSplit (Advanced SO Detail Line Split)
3. Insert a new line
3. Update F4211 (multiple BSFNs)


Default Incrementer (When mnLineIncrementer is not Specified)

When calling B4200450 - AdvancedSODetailLineSplit (Advanced SO Detail Line Split), if you do not specify mnLineIncrementer, the following values are applied:

All the values can be overridden when calling B4200450 (AdvancedSODetailLineSplit). Check for the valid routine based on the application where the split occurs.

For instance, Sales Order detail lines can be split either through Sales Order Entry (when you hard commit and you have turned on back order) or Ship Confirmation as below,


Example of Split Through Back Order Release

Place order with two different items without having any available quantity on hand
[As - Is] Sales Order Detail

LNID LITM NXTR LTTR UORG SOQS SOBK SOCN COMM BACK APTS PID NOTE
1.000 BOXTER 560 900 13.00 13.00 S Y Y EP4210 quantity 13 is backordered
2.000 CAYMAN2 560 900 2.00 2.00 S Y Y EP4210 quantity 2 is backordered


[1st Split]

LNID LITM NXTR LTTR UORG SOQS SOBK SOCN COMM BACK APTS PID NOTE
1.000 BOXTER 560 900 1.00 1.00 S Y Y EP42117 quantity 1 is relieved
1.100 BOXTER 560 900 12.00 12.00 S Y Y EP42117 quantity 12 remained as backordered
2.000 CAYMAN2 560 900 2.00 2.00 S Y Y EP4210


[3rd Split]

LNID LITM NXTR LTTR UORG SOQS SOBK SOCN COMM BACK APTS PID NOTE
1.000 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.100 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.200 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.300 BOXTER 560 900 10.00 10.00 S Y Y EP42117 Split is performed based on line 1.200
2.000 CAYMAN2 560 900 2.00 2.00 S Y Y EP4210



[10th Split]

LNID LITM NXTR LTTR UORG SOQS SOBK SOCN COMM BACK APTS PID NOTE
1.000 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.100 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.200 BOXTER 560 900 1.00 1.00 S Y Y EP42117
...
1.900 BOXTER 560 900 1.00 1.00 S Y Y EP42117
2.000 CAYMAN2 560 900 2.00 2.00 S Y Y EP4210
2.100 BOXTER 560 900 3.00 3.00 S Y Y EP42117 Splitted based on Line 1.900 but 2.000 is in use


[1st split for 2nd item]

LNID LITM NXTR LTTR UORG SOQS SOBK SOCN COMM BACK APTS PID NOTE
1.000 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.100 BOXTER 560 900 1.00 1.00 S Y Y EP42117
1.200 BOXTER 560 900 1.00 1.00 S Y Y EP42117
...
1.900 BOXTER 560 900 1.00 1.00 S Y Y EP42117
2.000 CAYMAN2 560 900 1.00 1.00 S Y Y EP42117
2.100 BOXTER 560 900 1.00 1.00 S Y Y EP42117
2.200 BOXTER 560 900 2.00 2.00 S Y Y EP42117
2.300 CAYMAN2 560 900 1.00 1.00 S Y Y EP42117 There is no available quantity for item



Note:


B4200450 - AdvancedSODetailLineSplit (Advanced SO Detail Line Split) Detail


Purpose: Use this function to split the ship quantity from the backorder/cancel quantities in a sales order detail line (F4211). After the split, the original line will contain the backorder/cancel quantities while a new line is created for the ship quantity. The new line will essentially be a mirror image of the original line with some slight differences (e.g.., status codes). You can optionally supply a split line quantity which will allow this function to write the new line with this quantity and leave any remaining quantities in the original line.

Setup Notes and Prerequisites:



Data Structure: D4200450 : Advanced Sales Order Detail Line Split
Parameters:

Structure Member Name Type Alia Req I/O Others
idF4211LongPointer ID GENLNG To store data pionter for the original sales order detail information. Sales Order Detail pointer can be returned by calling B4200210.
cPreferenceProcessing JCHAR EV01 This parameter determines the calling routine to handle sales order detail

3 - Work Order Text Lines
4 - Commitments. This allows KTLN to be populated for the new line.
5 - Warehouse - added this mode to split agreement lines in the calls from warehousing. Must be run with bypass update turned on. added this mode to handle parent mult-location agreement updates
6 - Ship Confirm (call in this mode for first child line of a mult. location split to update parent agreement line once, then call in mode 7 for all subsequent child lines.
7 - Ship Confirm
8 - Direct Shipment. added this mode for transportation so processing the commit flag will remain the same in the F4211 and not be updated when ship confirm updates the flag.
9 - Transportation
A - Kit Balancing with partial backorder (SAR 7263891 which was decided not to support any more)
B - Kit Balancing with partial Backorder from P42117
C - added this mode to implement release from fulfillment split functionality. R4277703 UBE will call splitter with mode C to split the partially fulfilled sales order line.
cBypassUpdateOnOriginalLine JCHAR EV02 ' ' not to bypass
Set on the Bypass Update on Original Line (EV02=='1') if the original line needs to be split into multiple new lines and you would like to minimize the number of updates to the original line. In the calling application or function, set this field to '1' and place the calls to this function in a loop. Change this flag to '0' before calling this function to create the last split line.
cUpdateUnitCost JCHAR EV03
cCostLevel JCHAR CLEV *IMCLEV
mnLineIncrementer MATH_NUMERIC RLLN O
  • Defaults in P4205/Kit 0.100
  • Component 0.010
  • Others 0.001 (e.g., Multiple Location) and default in P4210
mnIncremenFromLineNumber MATH_NUMERIC LNID
  • If processing a kit component line, pass into this field the kit master's line number.
  • Pass into this field the line number from which the new line number will be incremented.
  • The new line number calculated by this function will be returned.
szOverrideLastShipStatus[4] JCHAR LTTR Available status code:
  • F4211.LTTR
  • 910 - Added in Price Adjustment (not for split)
  • 912 - Added in Commitments
  • 913 - Added in Pick Confirm (warehouse)
  • 914 - Added in Ship Confirm or transportation
szOverrideLastBackorderStatus[4] JCHAR LTT2 Available Status Code:
  • F4211.LTTR
  • 900 - Backorder in S/O Entry or Multiple routine can set this
  • 902 - Backorder in Commitment
  • 903 - Backorder in Warehouse
  • 904 - Backorder in Ship Confirm or Transportation
zOverrideLastCancelStatus[4] JCHAR NXT2 Available status code:
  • F4211.LTTR
  • 980 - Canceled in Order Entry (not for split)
  • 981 - Canceled in Fulfillment (not for split)
  • 982 - Canceled in Commitments
  • 983 - Canceled in Pick Confirm (warehouse)
  • 984 - Canceled in Ship Confirm or transporation
  • 999 - Completed or Cancelled in Direct Ship
cHardCommitFlag JCHAR FLD2
cInventoryInterface JCHAR IVI *LFIVI (F40205.lfivi)
cWriteSalesLedger JCHAR WRTH cWRTH
mnSplitLineOrderQty MATH_NUMERIC UORG
cSplitToDifferentItemLocation JCHAR EV04
szNewBranchPlant[13] JCHAR MCU
szNewLocation[21] JCHAR LOCN
szNewLotNumber[31] JCHAR LOTN
cErrorCode JCHAR ERRC
szProgramID[11] JCHAR PID
jdTodaysDate JDEDATE UPMJ
mnTimeOfDay MATH_NUMERIC TDAY
szUserID[11] JCHAR USER
szWorkStationID[11] JCHAR JOBN
szSplitLineNextStatus[4] JCHAR NXTR lpdsF4211->sdnxtr
szSplitLineContainerID[21] JCHAR CNID
jdSplitLineActualShipDate JDEDATE ADDJ
mnSplitLineCarrierNumber MATH_NUMERIC CARS
cSplitLineOHStatus JCHAR SO02
mnJobnumberA MATH_NUMERIC JOBS
mnAmountExtendedCost MATH_NUMERIC ECST
mnAmountForeignExtCost MATH_NUMERIC FEC
mnAmountExtendedPrice MATH_NUMERIC AEXP
mnAmountForeignExtPrice MATH_NUMERIC FEA
szComputerID[16] JCHAR CTID
mnRelatedPoSoLineNo_RLLN MATH_NUMERIC RLLN
cDualUnitOfMeasureItem JCHAR DUAL
cDualPickingProcessOption JCHAR DPPO
mnSplitLineOrderQtySecondary MATH_NUMERIC DQTY
mnTransToSecondConvFactor MATH_NUMERIC MATH06
mnAmountUnitCost MATH_NUMERIC UNCS
cShipAscendingDateFlag JCHAR EV01
cCheckExpirationDate JCHAR EDCK
cCheckSellByDate JCHAR SBCK
cCheckBestBeforeDate JCHAR BBCK
cCommitmentDateMethod JCHAR CMDM
cQuantityFutureCommitted JCHAR DA03
mnAmountForeignUnitCost MATH_NUMERIC FUC
mnActualShipmentTime MATH_NUMERIC ADTM
mnFutureUse3Numeric MATH_NUMERIC CFS3
mnFutureUse3Numeric_2 MATH_NUMERIC CFS3
mnFutureUse3Numeric_3 MATH_NUMERIC CFS3
mnFutureUse3Numeric_4 MATH_NUMERIC CFS3
szModeOfTransport[4] JCHAR MOT
szRouteCode[4] JCHAR ROUT
cStatusInWarehouseOriginal JCHAR SWMS
jdCancelDateOriginal JDEDATE CNDJ
szGlCategory[5] JCHAR GLPT
cPricingBasedOnDate JCHAR CP01
cPriceRetrievalUOM JCHAR UMB1
cAddressNoForTransportation JCHAR AUFI
cUseKitFields JCHAR CHAR
mnKitIdentifier MATH_NUMERIC KITID
mnLineNumberKitMaster MATH_NUMERIC KTLN
mnComponentNumber MATH_NUMERIC CPNT
szItemNumberRelatedKit[9] JCHAR RLIT
cSalesOrderStatus17 JCHAR SO17
mnNumbOfCpntPerParent MATH_NUMERIC KTP
cKitComponentDirtyFlag JCHAR KITDIRTY
cPriceOverrideCode JCHAR PROV
mnKitAmtPricePerUnit MATH_NUMERIC UPRC
mnKitFrnPricePerUnit MATH_NUMERIC FUP
cTranspoPlanInterfaceFlag JCHAR OTSY49TX
cTranspoPlanSplitLineFlag JCHAR OTSPLITF
cOTMOrphanComponent JCHAR EV01 D4200450 data structure parameter cOTMOrphanComponent is not used and may be used for another purpose. If the parameter is used for another purpose, replace this comment with documentation of how cOTMOrphanComponent is being used.
mnWFLineNo MATH_NUMERIC LNIX
cCancelRuleEnabledYN JCHAR E01
cReleaseOrderRuleYN JCHAR EV01
cBypassDeterminePieceCount JCHAR EV01
idF4211TXPointer ID GENLNG
mnTaxedExtendedPrice MATH_NUMERIC TAEXP
mnForeignTaxedExtendedPrice MATH_NUMERIC TFEA
szHeaderBranchPlant[13] JCHAR MCU
cIsVertexActive JCHAR VVTX
mnVertexJobNo MATH_NUMERIC JOBS
cUseTaxedPrices JCHAR UTP
cReceiptShipmentChanged JCHAR EV01

Detail Routine:

1. Use the GENLNG to retrieve data from the Sales Order Detail data structure (F4211).
2. If SDSOQS <= 0, set error code to '1' and exit function. (Exit function if zero or negative ship quantity)
3. If IVI-parm == ' ', fetch the Inventory Interface flag (LFIVI) from Line Type Master (F4205) using SDLNTY as the key. Store the LFIVI to IVI in the parameter data strucutre. If a record is not found, assign 'N' to IVI-parm.
4. If UORG-parm != 0 and UORG-parm < SDSOQS
RemainingQty (WF) = SDSOQS - UORG-parm;
SDUORG = UORG-parm;
SDSOQS = UORG-parm;
else
SDUORG = SDSOQS;
RemainingQty (WF) = 0;
: If the split line's order quantity is specified and it is less than the original detail line's ship qty, use it (save the remaining qty to a work field which will later on be updated to the original detail line); else, use the entire ship quantity of the original line to write the new detail line.
5. If RemainingQty (WF) > 0 or SDSOBK != 0 or SDSOCN != 0, line should be split. (Use a work field to indicate line splitting or use best C technique)
6. If line splitting, save SDSOBK, SDSOCN, SDLNID, SDLTTR, SDNXTR, SDMCU, SDLOCN, SDCNID, SDADDJ, SDCARS, SDSO02, and SDLOTN to save fields.
7. If EV04-parm == '1',
SDMCU = MCU-parm;
SDLOCN = LOCN-parm;
SDLOTN = LOTN-parm;
: If updating to a different item location, use the branch, location, and lot passed
8. If line splitting, branch to the logic for splitting a sales detail line.
9. Execute the logic for adjusting the original sales detail line.

1. Zero out SDSOBK and SDSOCN.
2. Calculate the line number of the split line.

a) If the line increment (RLLN-parm) is not passed,
If SDRLIT == ' ',
default line increment to .01;
else
default line increment to .1;
b) If Increment From Line Number (LNID) in the parameter is zero,

The new line number is the current line number plus the line increment (RLLN) passed. (i.e., SDLNID = SDLNID + RLLN)
else
Calculate the new line number by adding the Kit Master Line Number and the line increment. (i.e., SDLNID = LNID + RLLN).
3. Validate against F4211 to make sure the new line number is unique. Use an existing business function. If not unique, repeat step 2b-3.
4. Using the original F4211 record as a copy, map all fields to a new F4211 record. (Use the best technique in C)
5. Assign the current line number (SDLNID) to LNID in the paramater data structure.
6. Call GetItemUOMConversionFactor and update the following fields:
7. If the Override Cost field (SDCSTO) != '1' and EV03=='1',
a) Retrieve the unit cost by calling GetItemCost (XF4105.C)
b) Then call GetItemCostInformation (XF4105.C) and free F4105 pointer after the call:
c) If SDFUC != 0, use CurrencyConvForAndDom (B0000027.C) to convert domestic cost to foreign.
: Recalculate the extended cost if the quantity shipped has changed and this is not a kit component.
8. If (RemainingQty (WF) > 0 and SDRLIT == ' ') or ((SDCSTO != '1' and EV03=='1') and SDRLIT == ' ')
a) If SDFUC != 0 and SDSOQS != 0, calculate the foreign extended cost using ComputeUnitOrExtendedAmount (B4002000.C)
b) If SDSOQS != 0, calculate the domestic extended cost by calling ComputeUnitOrExtendedAmount (B4002000.C)
: If the shipping amount of the new line is adjusted and this is not a kit component line, recalculate the price and cost extensions in foreign and domestic using the new ship quantity.
9. If RemainingQty (WF) > 0 and SDSOQS != 0 and SDRLIT == ' '
If SDFUP != 0
Calculate the foreign extended price using ComputeUnitOrExtendedAmount
Calculate the domestic extended price by calling ComputeUnitOrExtendedAmount
10. SDLTTR = LTTR (override last status in input parameter).
:If an override next status is passed, validate it before using it.
11. If NXTR-parm != ' ' and NXTR-parm != SDNXTR then assign intput parameter

Note:


Line Numbering for the Free Good lines in P4210

The additional free good line(s) in Add/Update Mode in P4210 does not make use of the business function AdvancedSODetailLineSplit (B4200450, Advanced SO Detail Line Split) described above. Rather, the business function F4072CalculatePriceAdjustments (B4500050, F4072 Calculate Price Adjustments) sets hard coded value ".01" for free good lines. As a result, the line number for free good lines will be 1.010 (when the free good is attached to 1.000) and 1.020 (it appends a new free good line because of update in the line number 1.000).

If the current line number for free good line is 1.100, and changing quantity or request date, the new free good line number = the line number of base order line + 0.01. In case this number is in use which will be 1.000 + 0.1 + 0.1 + ... till it finds the to-be free good line number is available. Because the incrementer for Free Good's line number remains same which is 0.1.

Considerations: any tables which clone F4211 must have same line number: there are tables (F49211, F42199, F4211TX, F4211DT, F4211B, F4211AU and so forth) which share same primary key with F4211, need to manipulated whenever there is manipulation on F4211.