Columns Mapped in Purchase Order Generation from Sales Order

Purpose of Document

This document discusses columns populated in the Purchase Order when it is generated from a Sales Order. It is specific to the following types of transactions: Direct Ship Orders (SD/OD), Transfer Orders (ST/OT) and Intercompany Orders (SK/OK).

 

This document is written based on EnterpriseOne application release 9.0.

This document explains

Simplified Routine

The below relationship is to show how the system handles data, and the relationship among sales order detail, purchase order detail, and purchase order header

F4211FSEditLine: This function validates/default sales order detail information and create Sales Order Detail Cache

  • F4311BeginDoc: Based on given information in F4311EditLine it defaults and creates Purchase Order Header Cache


F4211FSEndDoc: Commit Sales Order Header/Detail Cache


As we can see above, values to Purchase Order is determined through F4211FSEditLine routine




Now we may discuss the relationship in detail.

Creation of Purchase Order Detail Cache


Currently F4211FSEditLine (B4200311) calls F4311EditLine (XT4311Z2) directly to populate Purchase Order with parameter name dsPOEditLineParms in internal function I4200310_ProcessPurchaseOrderLine.

The sequence of parameters written below is based on the sequence in internal function I4200310_ProcessPurchaseOrderLine.

Target Parameter
on dsPOEditLineParms
Source From (F4211FSEditLine)Reference/Implemented ByConsiderations
D1. szComputerID lpDS->szCMComputerID CTID for F42UI01, F42UI11, F4301Z and F4311Z are same machine name * Key for Cache
D2. cDetailActionCode lpDS->cCMLineAction   Available Action Code in F4211FSEditLine:
  • A - Add
  • C - Change
  • D - Cancel
cf., cDetailActionCode in F4311EditLine
  • A or 1 - Add
  • C or 2 - Change
  • D or 3 - Cancel
  • I or 4 - Inquiry
  • P or 0 - Physical File (F4311) Deletion
D3. cProcessEdits '1'   Hard Coded
1 indicates that validation/default take place in F4311EditLine
D4. cUpdateOrWriteWorkFile lpDS->cCMWriteToWFFlag @SAR 1956813 To determine whether to write Work File or not

Values for parameter:
  • 1 - Write Cache
  • 2 - Write Work File
If you create sales order through interactive application value 1 is to be assigned and for batch value 2 is to be assigned
D5. cPriceOverrideFlag
      (F4311.PROV)
'0' <Bug 10972526>: WRONG PRICES ON OD WHEN SD IS - SAR: 8631181 In case a Sales Quote is released for Direct Ship Order.
  • Sales Quote Released  szSalesOrderFlags[32] = '2'
  • cF40205InvInterface = 'D'
D6. szTaxRateArea
       (F4311.TXA1)
lpds4200310B->szShipToTaxArea TXA1 - from GetShipToBillingInstructions

Bug 12478367: TAX INFO NOT PASSED TO PO EDIT - SAR: 4824816
Other reference:
<Bug 12478413>: TAX RATE ON PO DETAIL WRONG - SAR: 4824525 
<Bug 12504972>: WRONG TAX RATE ON SK/OK ORDERS - SAR: 6175872
<Bug 10880526>: WRONG TXA1 & EXR1 ON ODS - SAR: 7560431
Not Transfer Order AND cOrderProcessType != '3' AND mnSupplierNo Not Zero

Note:
  • currently in calling F4211FSEditLine cOrderProcessType is NULL (not assigned) so it always come to this routine
  • For Intercompany order cOrderProcessType is to be assigned with value 3
D7. szTaxExplanationCode
      (F4311.EXR1)
lpds4200310B->szShipToTaxExplCode EXR1 - From GetShipToBillingInstructions Same routine with #D6
D8. mnOrderLineNumber
      (F4311.LNID)
&lpDS->mnLineNo <Bug 12476667>: STOT LINE INTEGRITY AFTER ERRO - SAR: 4692462 if cConsolidationFlag is '1' or 'Y' don't do anything (Do not assign mnOrderLineNumber which has to be resolved through F4311EditLine routine
D9. cRecordWrittenToWorkFile '1' <Bug 10820663>: LINE # EDIT ON ST CFG PARENT - SAR: 6792387 (Add condition for SO that has related WO and PO)
<Bug 10914769>: TEXT LINE WITHIN TRANSFER ORDE - SAR: 7970931
This parameter is to control the process in F4311EditLine whether to populate Work File or not
lpDS->cCMRecdWrittenToWF is '2', '3', or '5' and either Transfer order or Direct Ship Order
D10. mnAdjustmentRevisionLevel
     (N/A)
&lpdsF42UI11->zdodln   F4311Z.AREV to use in calling B4500250 (CalculatePurchasePrice)
D11. mnJobNumber &lpdsF42UI11->zdrjob   * Key for Cache
D12. mnOrderLineNumber
        (F4311.LNID)
&lpDS->mnRelatedPoSoLineNo   lpds4200310B->cF40205TextLineYN ==_J('Y')
  &lpdsF42UI11->zdrlln   The SO Detail Line type is not Text Line
D13. cCurrencyProcessingFlag lpds4200310B->cCMCurrencyControl F0009.GOT1 (either Y or Z) Coming from Environment Cache
D14. szOrderType
         (F4311.DCTO)
lpdsT43101->szDuplicationOrderType <Bug 10977680>: WRONG DOC TYPE OF TRANSFER ORD - SAR: 8688487 (Order Type need to be defaulted from Duplication tab of P4310) if (lpDS->szSalesOrderFlags[38] == _J('1')&& (IsStringBlank(lpDS->szRelatedOrderType)))

If version is not specified PO version ZJDE0001 is to be used
D15. szPurchaseOrderPrOptVersion lpds4200310B->szPOPurchOrdEntryVersn Version for Purchase Order Entry P4310 This version information is to be used in F4311EditLine routine
D16. cAddNewLineToExistingOrder '1' <Bug 12482498>: SK&OK WHEN SHIP SEPERATE LINES - SAR: 5085357 (add IC order condition) Only for Transfer order or Intercompany Order
When action code for header is C - Change and Action code for Detail is A - Add
D17. szOrderCompany
         (F4311.KCOO)
lpdsF42UI01->zhrkco    
D18. mnOrderNumber
        (F4311.DOCO)
lpDS->szRelatedPoSoNumber <Bug 12439991>: NO EQUIV. P4242 IN OW, TABS - SAR: 2179913 if Related PO Number is specified
D19. szOrderType
        (F4311.DCTO)
lpDS->szRelatedOrderType   if szRelatedOrderType is specified
D20. szOrderCompany
        (F4311.KCOO)
lpDS->szCompanyKeyRelated <Bug 10915525>: R4210IC - TO CANCEL OK ORDER - SAR: 7979629 (modify If condition for interbranch order) If szCompanyKeyRelated is specified and Interbranch order
D21. szLastStatus
        (F4311.LTTR)
"980"   If it is interbranch order or intercompany order
and If the Sales Order was canceled then the Puchase Order must also be canceled
D22. szNextStatus
        (F4311.NXTR)
"999"    
D23. szOrderSuffix
        (F4311.SFXO)
'000'   Hard Coded
D24. szBranchPlant
        (F4311.MCU)
lpDS->szTransferOrderToBranch <Bug 12450914>: SOE INTERCOMPANY - SAR: 2824564 When order is Interbranch or Intercompany Order
  lpdsF42UI01->zhmcu   Neither Interbranch nor Incompany then copy it based on header B/P
D25. szRelatedOrderCompany
        (F4311.RKCO)
lpDS->szOrderCo    
D26. szRelatedOrderNumber
        (F4311.RORN)
nOrderNumber <Bug 12490647>: SD SALE ORDER DISPLAY PO#00000 - SAR: 5524170 Fill in zero in front of order number to make 8 digits related order number
D27. szRelatedOrderType
         (F4311.RCTO)
lpDS->szOrderType    
D28. mnRelatedOrderLine
        (F4311.RLLN)
&lpDS->mnLineNo    
D29. mnSupplierNumber
        (F4311.AN8)
&lpds4200310B->mnTransferOrderSupplier @SAR 1066394 lpds4200310B->cPOTransferOrder == _J('1')) (that is, Transfer Order)
  &lpdsF42UI01->zhian8   when above routine fails to return supplier number
  &lpDS->mnSupplierNo   For orders other than TransferOrder
D30. mnJobNumber &lpds4200310B->lpdsF42UI02- > mnRelatedOTJobNumber <Bug 10709761>: ST/OT THREADING ISSUE - SAR: 3645912  
D31. mnShipToNumber
        (F4311.SHAN)
&lpDS->mnAddressNumberDeliveredTo <Bug 10885486>: SHIP ADDRESS WRONG-CUSTOMER SE - SAR: 7618541 (When the flag Address for Transport/Intrastat is set to "2" in CustomerSet, DeliverTo address is to be passed to the F4311 Edit Line so that the ShipTo address is the DeliverTo address in the Purchase order) When F42UI01.AUFI (Address Number to use for Transportation)= '2'
  • 1: Ship To Address
  • 2: Deliver To Address
  &lpDS->mnShipToNo   when f42ui01.aufi is not '2'
D32. jdRequestedDate
        (F4311.DRQJ)
&lpDS->jdRequestedDate    
D33. jdTransactionDate
        (F4311.TRDJ)
&lpdsF42UI01->zhtrdj    
D34. jdPromisedDate
        (F4311.PDDJ)
&lpDS->jdPromisedDlvryDate <Bug 10910195>: PDDJ NOT PASSED TO F4311 - SAR: 7913646 (Pass the Promised Delivery Date to PO Promised Date) Added by <Bug 10910103>: PDDJ NOT PASSED TO F4311 - SAR: 7913638
D35. jdCancelDate
        (F4311.CNDJ)
&lpDS->jdCancelDate   Update (Cancel) Mode only
D36. szUnformattedItemNumber
        (F4311.LITM)
dsD4001040.szPrimaryItemNumber <Bug 12485188>: TRANSFER ORDER INVALID ITEM NO - SAR: 5251386 Get Item Number based on lpDS->szTransferOrderToBranch for Transfer Order
* Transfer Order (cPOTransferOrder = '1')
  lpDS->szItemNo   Not transfer order
D37. mnQuantityOrdered
        (F4311.UORG)
&lpDS->mnQtyOrdered    
D38. szLineType
        (F4311.LNTY)
lpDS->szLineType <Bug 12494426>: T LINE TYPE AND TRANSFER ORDER - SAR: 5701295 (pass the line type if the lpds4200310B->cF40205InvInterface=='N')

<Bug 10969634>: ST/OT CREATED WITH WRONG LINE - SAR: 8598713 (Modified the SAR 5701295 fix to pass the line type to PO in the scenario when non stock line type does not have any item record)
Only when order is not intercompany order AND Inventory Interface is 'N - Non-Stock' AND EditItem is not '1' (that is F4102 does not contain this non-stock item)
D39. szDescription1
        (F4311.DSC1)
lpDS->szDescription1 <Bug 11015010>: SD OD - ALTERNATE DESCRIPTION - SAR: 8933317 (If the DSC1,DSC2 are manually entered then pass to F4311Editline) Only when szDescription1 is overridden during Sales Order Entry
D40. szDescription2
        (F4311.DSC2)
lpDS->szDescription2   Only when szDescription2 is overridden
D41. szDetailLineBranchPlant
        (F4311.MCU)
lpDS->szTransferOrderToBranch <Bug 12450914>: SOE INTERCOMPANY - SAR: 2824564 When order is either Interbranch or Intercompany Order
  lpDS->szBusinessUnit   Not interbranch or intercompany
D42. szLocation
        (F4311.LOCN)
lpDS->szLocation   Except Transfer Order
D43. szLotNumber
       (F4311.LOTN)
lpDS->szLotNo    
D44. szTransactionUoM
        (F4311.UOM)
lpDS->szTransactionUOM    
D45. szSubledger
        (F4311.SBL)
lpds4200310B->szSubledger    
D46. szLandedCostRule
        (F4311.PDP5)
lpDS->szLandedCost   cf., F4301.PRP5
D47. szPrintMessage
        (F4311.INMG)
lpDS->szPrintMesg <Bug 12479850>: PRINT MESSAGE NOT PASSED TO OD - SAR: 4911522
<Bug 11022154>: TRANSFER ORDER PRINT MESSAGE - SAR: 8940874
<Bug 13241237> - Revert SAR 8940874 fix
Through a  bug 13241237 F4211.INMG should not be assigned to F4301.INMG
D48. cTaxable
        (F4311.TX)
'N' <Bug 12484510>: BYPASS TAXES ON OK NOT WORKING - SAR: 5205398 (pass N if Tax is Off) lpds4200310B->cPOTurnOffTaxable == _J('1'))
D49. cTransferOrder
        (F4311.PS01)
'1' SAR 2520261 Pass in the SO11 or cPOTransferFlag to PO EditLine Data Structure
<Bug 10739207>: REGENERATE PO AFTER REC ROUTE - SAR: 4608662
Transfer Order
  • lpDS->szSalesOrderFlags[ORDER_TYPE_ALPH11] == TRANSFER_1_ALPH11
  • OR lpds4200310B->cPOTransferOrder == _J('1'))
  '3' SAR 7105198, Check for Intercompany order Intercompany Order (lpDS->cOrderProcessType == _J('3'))
  ' ' (a Space)   Neither Interbranch Nor Intercompany
D50. szGLClassCode
        (F4311.GLC)
lpds4200310B->szGlClass <Bug 10695197>: G/L CLASS NOT POPULATED - SAR: 3182719 lpds4200310B->cF40205InvInterface ==_J('D') but not Transfer Order
D51. cSourceRequestingPOGeneration '3'   Hard Coded to indicate PO is created from SO
D52. szProgramID
        (F4311.PID)
"EP4210"   Hard Coded to indicate PO is created via F4211FSEditLine routine
D53. szUserID
        (F4311.USER)
lpDS->szUserID    
D54. mnUniqueKey
        (F4311.UKID)
&lpDS->mnDRPKeyId   N/A (PO is generated through MRP messages)
D55. mnCarrierNumber
        (F4311.ANCR)
&lpDS->mnCarrier <Bug 10707218>: CARRIER# IS NOT ON THE OD - SAR: 3579687  
D56. szFreightHandlingCode
        (F4311.FRTH)
lpds4200310B->szFreightCode <Bug 12473901>: FREIGHT CODE NOT PASSED TO OD - SAR: 4548858  
D57. mnProcessID &lpDS->mnProcessID <Bug 10701620>: CONSOLIDATE BASED ON PEID,TSID - SAR: 3406866 * Key for Cache
D58. mnTransactionID &lpDS->mnTransactionID Refer D57 * Key for Cache
D59. szModeOfTransport
        (F4311.MOT)
lpDS->szModeOfTransport <Bug 12483511>: REHOOK/PASS MOT TO XT4311Z2 - SAR: 5145233  
D60. szReference1
        (F4311.VR01)
lpDS->szCustomerPO_VR01 <Bug 11031555> - Pass VR01, VR02 to OD  
D61. szReference2
        (F4311.VR02)
lpDS->szReference2Vendor_VR02    
D62. szPromotionID
       (F4311.PMTN)
lpDS->szPromotionID <Bug 12484164>: PINNACLE -PROMOTION ID TO PO - SAR: 5183643 If szPromotionID is populated from Sales side.
D63. mnProjectNumber
       (F4311.PRJM)
&lpDS->mnProjectNumber Refer #D61 If mnProjectNumber is populated
D64. mnTaskOrderNumber &lpDS->mnDescTaskOrderNumber <Bug 12490362>: MPM-PURCHASED ITEMS CODING - SAR: 5510106 To interface with Manufacturing (Assign PO No)
When &lpDS->mnDescTaskOrderNumber is not zero
D65. szTaskOrderType lpDS->szDescTaskOrderType   To interface with Manufacturing
D66. szItemNumberRelatedKit
        (F4311.RLIT)
lpDS->szRelatedKitItemNo   lpDS->szRelatedKitItemNo is not zero and Intercompany Order
D67. jdGLDate
        (F4311.DGL)
&lpDS->jdRequestedDate <Bug 12503862>: EPM DIRECT SHIP ORDER ERROR - SAR: 6133921 Only when &lpDS->mnProjectNumber is not zero
D68. mnProductionNumberShort &lpDS->mnProductionNumberShort <BUG 11904731> - PMPN Enhancements 9.1 only
D69. szProjectMfgProductionNumb lpDS->szProjectManufacturingProd    
D70. mnWeight &lpDS->mnItemWeight    


Important: Data Structure used in the routine (To identify the source of data)

Note:

 


Creation of Purchase Order Header Cache

Next, the F4311EditLine calls F4311BeginDocument to populate the Purchase Order Header based on the value handled in the Edit Line routine.

Internal function IXTF4311Z2_CallBeginDocForNewHeaderRec() in XT4311Z2 gets/assigns the data structure of dsBeginDocParms. So the column/parameter listed below is the parameter of dsBeginDocParms. A number of assignment are not used in creating purchase orders based on Sales Orders. Parameters does not have assignment in Detail for the applications P43011 or P43360.

Target Parameter on dsBeginDocParmSource From (F4311EditLine)Reference/Implemented ByConsiderations
H1. szComputerID lpDS->szCMComputerID   * Unique Cache/Work File ID
H2. mnProcessID &lpDS->mnProcessID <Bug 10691321>: CACHE SHARED WITH MULTI PROCES - SAR: 3046995 * Unique Cache/Work File ID
H3. mnTransactionID &lpDS->mnTransactionID Refer #H2 * Unique Cache/Work File ID
H4. cUpdateOrWriteWorkFile 'A'   Hard Coded to 'A' for ADD
H5. cProcessEdits lpDS->cProcessEdits   Refer #D3
H6. cUpdateOrWriteToWorkFile lpDS->cUpdateOrWriteWorkFile   Refer #D4
H7. cCurrencyProcessingFlag lpDS->cCurrencyProcessingFlag   Refer #D13
H8. szPurchaseOrderPrOptVersion lpDS->szPurchaseOrderPrOptVersion   Refer #D15
H9. szOrderCOmpany lpDS->szOrderCompany   Refer #D17
H10. mnOrderNumber &lpDS->mnOrderNumber   Refer #D18
H11. szOrderType lpDS->szOrderType   Refer #D14
H12. szOrderSuffix lpDS->szOrderSuffix   Refer #D23
H13. szBranchPlant lpDS->szBranchPlant   Refer #D24
H14. mnSupplierNumber &lpDS->mnSupplierNumber   Refer #D29
H15. mnShipToNumber &lpDS->mnShipToNumber   Refer #D31
H16. mnCarrierNumber &lpDS->mnCarrierNumber   Refer #D55
H17. jdRequestedDate &lpDS->jdRequestedDate   Refer #D32
H18. jdOrderDate &lpDS->jdTransactionDate   Refer #D33
H19. jdPromisedDate &lpDS->jdPromisedDate   Refer #D34
H20. jdCancelDate &lpDS->jdCancelDate   Refer #D35
H21. szLandedCostRule lpDS->szLandedCostRule   Refer #D46
H22. cCurrencyMode lpDS->cCurrencyMode   N/A
H23. szTransactionCurrencyCode lpDS->szTransactionCurrencyCode   N/A
H24. mnCurrencyExchangeRate &lpDS->mnCurrencyExchangeRate   N/A
H25. szProgramID lpDS->szProgramID   Refer #D52
H26. szPrintMessage lpDS->szPrintMessage <Bug 10735782>: PRINT MSG NOT ON DIRECT SHIP - SAR: 4482916 (Print Msg Not on Direct Ship Sys 43)
<Bug 10907606>: SD DETAIL PRINT MESSAGE GOING - SAR: 7883088 (Rolled back the changes made by SAR 4482916 as it was incorrectly passing the detail print message from SD to the header of OD. The SAR 4482916 has to be fixed some where else so that Print message from the SD header is passed to the OD header)
Refer #D47 Print Message is copied only for detail
For header it is disabled by SAR 7883088
H27. szPriceAdjustmentScheduleN lpDS->szAdjustmentSchedule   N/A
H28. szUserID lpDS->szUserID   Refer #D53
H29. szTaxExplanationCode lpDS->szTaxExplanationCode Pass original order information to header Refer #D7
H30. szTaxRateArea lpDS->szTaxRateArea <Bug 10743192>: SUPPLIER TAX NOT USED IN PO - SAR: 4789272 (Add Tax Rate Area) Refer #D6
H31. szOriginalOrderCompany lpDS->szOriginalOrderCompany   N/A
H32. szOriginalOrderNumber lpDS->szOriginalOrderNumber   N/A
H33. szOriginalOrderType lpDS->szOriginalOrderType   N/A
H34. szRMADocType lpDS->szRMADocType <Bug 10740506>: OTC: POE - INTEGRATED RETURNS - SAR: 4655493 (Add RMA Doc # and Doc Type into Begin Doc Parms) N/A
H35. mnRMADocNumber &lpDS->mnRMADocNumber   N/A
H36. szFreightHandlingCode lpDS->szFreightHandlingCode <Bug 10924418>: PDFRTH BLANKED AFTER PARTIAL S - SAR: 8082717 (For populating the freight handling code (FRTH) in the F4301 record for the associated OD in which the freight handling code (FRTH) entered in the SD when entering direct ship orders) Refer #D56
H37. mnBuyerNumber &lpDS->mnBuyerNumber <Bug 12504327>: BUYER # NOT DEFAULTIN ON HEADR - SAR: 6150561 (When generating POs from Purchase Order Generator, default in Buyer Number from Item/BP)
<Bug 10959726>: BUYER NUMBR NOT CARRIED OVER - SAR: 8482614 (Added an OR condition as when the PO is generated from P43360 the BuyerNumber was not copied)
N/A
Only when szProgramID is "EP43011" OR "EP43360"
H38. cSendMethod lpDS->cSendMethod <Bug 10972318>: ERROR NOT DISAPPEARING WHEN LI - SAR: 8629962 (Pass send method to begin doc.) N/A

 

Note:

 


Refer to <Document 1390905.1> E1: 42: How to maintain Order Integrity between SD/OD and ST/OT to understand integrity checking routine between Sales and Purchase when both are tightly related.

This note is created based on EnterpriseOne application release 9.0. This note can be updated to accommodate any enhancement we put in place in the future.