How to Generate PO from Custom Application

Kishore03

Active Member
Hi,


I am facing an issue in a development of my JDE application. In which i am trying to create a PO from a custom application using multi select, Find below a brief explanation about the application.

1.I use find/Browse form with multi select option .
2.Select the rows from the grid and press Select button to generate PO.

Then a PO should be generate in purchase order tables.

I used

F4311 Begin Doc in Dialog initialize of the Find/Browse form
F4311EditDoc in Event rule of Select Button
F4311 EndDoc in Post Button Event

Is that correct approach?if not please correct me.
please suggest me what necessary parameters required to pass in MBF to generate PO ?

Regards
Kishore
 
This works for me

| // Setup F4301/F4311 key fields
| VA rpt_F4301DOCO [DOCO] = <NULL>
| VA rpt_F4301DCTO [DCTO] = <NULL>
| VA rpt_F4301KCOO [KCOO] = <NULL>
| F0006.FetchSingle [Index 1: Cost Center]
| PC Business Unit (F4108.0) [MCU] = TK Business Unit [MCU]
| VA rpt_F4301KCOO [KCOO] <- TK Company [CO]
| VA rpt_F4301MCU [MCU] = PC Business Unit (F4108.0) [MCU]
| //
| If PO cProofOrFinal1_EV01 [EV01] is equal to "1"
| | //
| | // John Danter Consigned Stock Phase II 02/03/2014
| | // PO or GL flag 55CS08
| | If VA rpt_55CS08ConsumptionAction [55CS08] is equal to "1"
| | | //
| | | // Get P4310 Processing Options
| | | GetP4310ProcOpts(B4301710.GetP4310ProcOpts)
| | | VA rpt_F4301DCTO [DCTO] <- szOrderType_DCT [DCT]
| | | VA evt_LineTypeLNTY [LNTY] <- szLineType_LNTY [LNTY]
| | | PO szVersionP4310_VERS [VERS] -> szVersion_VERS [VERS]
| | | //
| | | // Get PO Number
| | | GetNextOrderNumber(B4302960.GetNextOrderNumber)
| | | VA rpt_F4301DOCO [DOCO] <- mnOrderNumber [DOCO]
| | | VA rpt_F4301KCOO [KCOO] -> szOrderCompany [KCOO]
| | | VA rpt_F4301DCTO [DCTO] -> szOrderType [DCTO]
| | | VA rpt_F4301MCU [MCU] -> szBranchPlant [MCU]
| | | //
| | | //
| | | // Assign a a value of '2' to replace the workfiles with memory arrays
| | | // otherwise assign a value of '1'
| | | //
| | | // This BSFN creates a F4301 header cache automatically
| | | F4311FSBeginDoc(XT4311Z1.F4311FSBeginDoc)
| | | VA rpt_F4301JobnumberJOBS [JOBS] <> mnJobNumber [JOBS]
| | | VA rpt_F4301ComputerCTID [CTID] <> szComputerID [CTID]
| | | "A" -> cHeaderActionCode [ACTN]
| | | "1" -> cProcessEdits [EV01]
| | | "2" -> cUpdateOrWriteToWorkFile [EV01]
| | | VA rpt_cWrittenToWorkFile_EV01 [EV01] <> cRecordWrittenToWorkFile [EV01]
| | | VA rpt_CurrencyModeCRRM [CRRM] -> cCurrencyProcessingFlag [CRYR]
| | | VA rpt_F4301KCOO [KCOO] <> szOrderCOmpany [KCOO]
| | | VA rpt_F4301DOCO [DOCO] <> mnOrderNumber [DOCO]
| | | VA rpt_F4301DCTO [DCTO] <> szOrderType [DCTO]
| | | "000" -> szOrderSuffix [SFXO]
| | | VA rpt_F4301MCU [MCU] <> szBranchPlant [MCU]
| | | PC Primary / Last Supplier Number (F4108.0) [VEND] -> mnSupplierNumber [AN8]
| | | VA rpt_OrderDate_TRDJ [TRDJ] <> jdOrderDate [TRDJ]
| | | VA rpt_CurrencyModeCRRM [CRRM] -> cCurrencyMode [CRRM]
| | | VA evt_CurrencyCodeFromCRCD [CRCD] -> szTransactionCurrencyCode [CRCD]
| | | SL UserID -> szOrderTakenBy [TKBY]
| | | "EP4310" -> szProgramID [PID]
| | | PO szVersionP4310_VERS [VERS] -> szPurchaseOrderPrOptVersion [VERS]
| | | VA evt_CurrencyCodeFromCRCD [CRCD] -> szBaseCurrencyCode [CRDC]
| | | SL UserID -> szUserID [USER]
| | | VA rpt_ProcessIDPEID [PEID] <> mnProcessID [PEID]
| | | VA rpt_TransactionTCID [TCID] <> mnTransactionID [TCID]
| | | //
| | | // NB Record written to workfile flag. This is a ONE line PO so we can get
| | | // away with settign this to 0. But for multiple line POs, this must change
| | | // from 0 > 1 after the first line
| | | //
| | | // This BSFN creates the F4311 detail cache record
| | | VA rpt_cWrittenToWorkFile_EV01 [EV01] = "0"
| | | VA evt_POAmountExtendedPriceAEXP = [RV Total of Value VEND BK MATH01 GBL]*-1
| | | F4311EditLine(XT4311Z1.F4311EditLine)
| | | VA rpt_F4301JobnumberJOBS [JOBS] -> mnJobNumber [JOBS]
| | | VA rpt_F4301ComputerCTID [CTID] -> szComputerID [CTID]
| | | "1.000" -> mnOrderLineNumber [LNID]
| | | "A" -> cDetailActionCode [ACTN]
| | | "1" -> cProcessEdits [EV01]
| | | "2" -> cUpdateOrWriteWorkFile [EV01]
| | | VA rpt_cWrittenToWorkFile_EV01 [EV01] <> cRecordWrittenToWorkFile [EV01]
| | | SL CurrencyProcessing -> cCurrencyProcessingFlag [CRYR]
| | | PO szVersionP4310_VERS [VERS] -> szPurchaseOrderPrOptVersion [VL01]
| | | VA rpt_F4301KCOO [KCOO] <> szOrderCompany [KCOO]
| | | VA rpt_F4301DOCO [DOCO] <> mnOrderNumber [DOCO]
| | | VA rpt_F4301DCTO [DCTO] <> szOrderType [DCTO]
| | | "000" -> szOrderSuffix [SFXO]
| | | VA rpt_F4301MCU [MCU] -> szBranchPlant [MCU]
| | | PC Primary / Last Supplier Number (F4108.0) [VEND] -> mnSupplierNumber [AN8]
| | | PO jdDateForGL_DGJ [DGJ] -> jdTransactionDate [TRDJ]
| | | "1" -> cPriceOverrideFlag [PROV]
| | | VA evt_POAmountExtendedPriceAEXP [AEXP] -> mnExtendedPrice [AEXP]
| | | VA rpt_AcctNoInputMode_ANI [ANI] -> szUnformattedAccountNumber [ANI]
| | | "EP4310" -> szProgramID [PID]
| | | SL UserID -> szUserID [USER]
| | | VA rpt_ProcessIDPEID [PEID] -> mnProcessID [PEID]
| | | VA rpt_TransactionTCID [TCID] -> mnTransactionID [TCID]
| | | //
| | | If SV Error_Status is equal to CO ERROR
| | | | VA rpt_cVENDError_EV01 [EV01] = "Y"
| | | | RV Error Text UDF [UDF] = "Purchase Order not created for this Supplier"
| | | End If
| | | //
| | | F4311EndDoc(XT4311Z1.F4311EndDoc)
| | | VA rpt_F4301ComputerCTID [CTID] -> szComputerID [CTID]
| | | VA rpt_F4301JobnumberJOBS [JOBS] -> mnJobNumber [JOBS]
| | | "EP4310" -> szCallingApplicationName [PGM]
| | | PO szVersionP4310_VERS [VERS] -> szVersion [VERS]
| | | SL UserID -> szUserID [USER]
| | | "2" -> cUseWorkFiles [EV01]
| | | "0" -> cConsolidateLines [EV02]
| | | VA rpt_ProcessIDPEID [PEID] -> mnProcessID [PEID]
| | | VA rpt_TransactionTCID [TCID] -> mnTransactionID [TCID]
| | | //
| | | //
| | | // Cleanup the cache containing header field changes
| | | CacheProcessHeaderToDetailChange(B4002390.CacheProcessHeaderToDetailChange)
| | | VA rpt_F4301DOCO [DOCO] -> mnOrderNumber [DOCO]
| | | VA rpt_F4301DCTO [DCTO] -> szOrderType [DCTO]
| | | VA rpt_F4301KCOO [KCOO] -> szOrderKeyCompany [KCOO]
| | | "4" -> cCacheActionCode [EV01]
| | | F4311ClearWorkFiles(XT4311Z1.F4311ClearWorkFiles)
| | | VA rpt_F4301ComputerCTID [CTID] -> szComputerID [CTID]
| | | VA rpt_szJobNumber_JOBS [JOBS] -> mnJobNumber [JOBS]
| | | "1" -> cClearHeaderFile [EV01]
| | | "1" -> cClearDetailFile [EV02]
| | | "2" -> cUseWorkFiles [EV01]
| | | VA rpt_ProcessIDPEID [PEID] -> mnProcessID [PEID]
| | | VA rpt_TransactionTCID [TCID] -> mnTransactionID [TCID]
| | | //
 
Last edited:
I turn on logging and then run the stock application. In your custom application execute functions in correct order(same os the log) and make sure to clean up any caches.

Alternatively you could use z files. checkout G43A313.
 
Last edited:
Hi,

I have a requirement as a part of my current project, which i have discussed regarding PO generation.In my case before generate any PO i have to send a approval notification for the PO to the concerned Department.Can you please help me on this.

Regards
Kishore
 
Back
Top