The purpose of this document is to explore the possible way to split sales order through add-on batch routine.
Possibly there is 3rd Party Logistics company who performs distribution of goods on behalf of client based on sales order given by client. The business process:-
: Currently there are order quantity 11 which is to be labeled 3 lots quantity with 2, 3 and 4, which in return written into exiting sales order line.
As - Is data from 3rd party
Order Co | Order Number | Or Ty | Line Number | Short Item No | Business Unit | Location | Lot Serial Number | Quantity On Hand |
---|---|---|---|---|---|---|---|---|
00200 | 9999 | SO | 1.000 | 12345 | M30 | LOC | LOT-A (a) | 2 |
00200 | 9999 | SO | 1.000 | 12345 | M30 | LOC | LOT-B (b) | 3 |
00200 | 9999 | SO | 1.000 | 12345 | M30 | LOC | LOT-C (c) | 4 |
As - Is data from F4211 in EnterpriseOne
Order Co | Order Number | Or Ty | Line Number | Short Item No | Location | Lot Serial Number | Quantity Ordered | Quantity Shipped |
00200 | 3399 | SO | 1.000 | 12345 | 11 | 11 |
To-Be Data from F4211 in EnterpriseOne
Order Co | Order Number | Or Ty | Line Number | Short Item No | Location | Lot Serial Number | Quantity Ordered | Quantity Shipped |
00200 | 9999 | SO | 1.000 | 12345 | 2 | 2 | ||
00200 | 9999 | SO | 1.001 | 12345 | LOC | LOT-A | 2 | 2 |
00200 | 9999 | SO | 1.002 | 12345 | LOC | LOT-B | 3 | 3 |
00200 | 9999 | SO | 1.003 | 12345 | LOC | LOT-C | 4 | 4 |
Split the existing Sales Order line
1st split:
Order Co | Order Number | Or Ty | Line Number | Short Item No | Location | Lot Serial Number | Quantity Ordered | Quantity Shipped |
00200 | 9999 | SO | 1.000 | 12345 | 9 (UORG1) | 9 | ||
00200 | 9999 | SO | 1.001 | 12345 | LOC | LOT-A (a) | 2 | 2 |
UORG1 = 11 - (a = Quantity of LOT-A) = 9
2nd split:
Order Co | Order Number | Or Ty | Line Number | Short Item No | Location | Lot Serial Number | Quantity Ordered | Quantity Shipped |
00200 | 9999 | SO | 1.000 | 12345 | 6 (UORG2) | 6 | ||
00200 | 9999 | SO | 1.001 | 12345 | LOC | LOT-A | 2 | 2 |
00200 | 9999 | SO | 1.002 | 12345 | LOC | LOT-B | 3 | 3 |
UORG2 = 9 - (b = quantity of LOT-B) = 6
3rd split:
Order Co | Order Number | Or Ty | Line Number | Short Item No | Location | Lot Serial Number | Quantity Ordered | Quantity Shipped |
00200 | 9999 | SO | 1.000 | 12345 | 2 (UORG3) | 2 | ||
00200 | 9999 | SO | 1.001 | 12345 | LOC | LOT-A | 2 | 2 |
00200 | 9999 | SO | 1.002 | 12345 | LOC | LOT-B | 3 | 3 |
00200 | 9999 | SO | 1.003 | 12345 | LOC | LOT-C | 4 | 4 |
UORG3 = 6 - 4 ( c = Quantity of LOT-C)
Simplified routine:
Structure Member Name | Type | Alia | Req | I/O | Others |
---|---|---|---|---|---|
idF4211LongPointer | ID | GENLNG | Req | IN | To store data pointer for the original sales order detail information. Sales Order Detail pointer can be returned by calling business function GetF4211DetailInformation (B4200210, F4211 Get Item and Pricing Information). |
cPreferenceProcessing | JCHAR | EV01 | Opt | IN | This parameter determines the calling routine to handle sales order detail
|
cBypassUpdateOnOriginalLine | JCHAR | EV02 | Opt | IN |
|
cUpdateUnitCost | JCHAR | EV03 | Opt | IN | when F4211.CSTO is not '1' (No cost override) and cUpdateUnitCost is '1' then it gets cost from F4105 for split lines and cPreferenceProcessing is NOT 8 (direct ship) and Not Kit item then get cost to override based on F4105. |
cCostLevel | JCHAR | CLEV | Opt | IN | *IMCLEV In case you want to override cost level (F4101.clev) specify cost level here. Exclude F4211.csto = '1' (overridden cost) |
mnLineIncrementer | MATH _NUMERIC |
RLLN | Opt | IN |
2. (F4211.rlit = Blank) then 0.001 2'. (F4211.rlit <> Blank) then 0.01 |
mnIncremenFromLineNumber | MATH _NUMERIC |
LNID | Opt | IN |
|
szOverrideLastShipStatus[4] | JCHAR | LTTR | Opt | IN | Available status code:
|
szOverrideLastBackorder Status[4] |
JCHAR | LTT2 | Opt | IN | Available Status Code:
|
zOverrideLastCancelStatus[4] | JCHAR | NXT2 | Opt | IN | Available status code:
|
cHardCommitFlag | JCHAR | FLD2 | Opt | IN | In case inventory commitment takes place after your split leave this parameter Blank. This routine gets called from Shipment Confirmation (and not Kit) then set 'H' |
cInventoryInterface | JCHAR | IVI | Opt | IN | *LFIVI (F40205.ivi) from line type constant based on F4211.lnty |
cWriteSalesLedger | JCHAR | WRTH | Opt | IN | cWRTH (set Y to write F42199) |
mnSplitLineOrderQty | MATH _NUMERIC |
UORG | Req | IN | Target Quantity |
cSplitToDifferentItemLocation | JCHAR | EV04 | Opt | IN | Set '1' in case you want to split to different MCU, LOCN and LOTN |
szNewBranchPlant[13] | JCHAR | MCU | Opt | IN | Target Detail Branch/Plant |
szNewLocation[21] | JCHAR | LOCN | Opt | IN | Target Location |
szNewLotNumber[31] | JCHAR | LOTN | Opt | IN | Target Lot |
cErrorCode | JCHAR | ERRC | OUT | 0 - No Error 1 - Error |
|
szProgramID[11] | JCHAR | PID | Req | IN | This parameter determines internal routine along with cPreferenceProcessing (Available values are BCW76, EP31114, EP4205, EP4210, EP42117, EP42118, ER42997, N4200860, N4201360, N4900330, PCW29, RCW06, RCW37) |
jdTodaysDate | JDEDATE | UPMJ | Opt | IN | Target F4211.upmj (If NULL date then get it from GetAuditInfo) |
mnTimeOfDay | MATH _NUMERIC |
TDAY | Opt | IN | Target F4211.tday (if zero then get it from GetAuditInfo) |
szUserID[11] | JCHAR | USER | Opt | IN | Taget F4211.USER (If NULL then get it from GetAuditInfo) |
szWorkStationID[11] | JCHAR | JOBN | Opt | IN | Target F4211.JOBN (If NULL then get it from GetAuditInfo) |
szSplitLineNextStatus[4] | JCHAR | NXTR | Opt | IN | Target value F4211.nxtr the outcome can be vary depending on cPreferenceProcessing |
szSplitLineContainerID[21] | JCHAR | CNID | Opt | IN | Target F4211.cnid |
jdSplitLineActualShipDate | JDEDATE | ADDJ | Opt | IN | Target F4211.addj (this date can be used for Price Effect Date (pefj) for price computation for splited line(s).) |
mnSplitLineCarrierNumber | MATH _NUMERIC |
CARS | Opt | IN | Target F4211.cars |
cSplitLineOHStatus | JCHAR | SO02 | Opt | IN | Target F4211.so02 (If you set this value as '1', you are not able to perform Confirm Shipment) |
mnJobnumberA | MATH _NUMERIC |
JOBS | Opt | IN | This parameter is to communicate with internal functions. Either make use of assigned value or get it from GetInternalNextNumber. |
mnAmountExtendedCost | MATH _NUMERIC |
ECST | Opt | IN | Target F4211.ecst (Override value. Do not specify when you need to honor the value of Source line) |
mnAmountForeignExtCost | MATH _NUMERIC |
FEC | Opt | IN | Same with above. |
mnAmountExtendedPrice | MATH _NUMERIC |
AEXP | Opt | IN | Same override routine |
mnAmountForeignExtPrice | MATH _NUMERIC |
FEA | Opt | IN | Save Override value |
szComputerID[16] | JCHAR | CTID | Opt | IN | If you dot specify then come from GetLocalComputerId. Since cache is machine dependent leave this value remain blank) |
mnRelatedPoSoLineNo_RLLN | MATH _NUMERIC |
RLLN | Opt | IN | You can override this value if required (in case related order is not changed then do not set any value to make target rlln is same with source) |
cDualUnitOfMeasureItem | JCHAR | DUAL | Opt | IN | Blank - Not a dual UOM item 1 - Dual UOM item 2 - Dual UOM Item with Tolerance |
cDualPickingProcessOption | JCHAR | DPPO | Opt | IN | To extend price against 2ndary UOM if needed. |
mnSplitLineOrderQty Secondary |
MATH _NUMERIC |
DQTY | Opt | ||
mnTransToSecondConvFactor | MATH _NUMERIC |
MATH06 | Opt | ||
mnAmountUnitCost | MATH _NUMERIC |
UNCS | Opt | ||
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 structures. 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.
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 parameter 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 input parameter
This note is created based on E1 application release 9.1