I’ve seen questions from many developers when they face the question of entering GL Journal Entries. Any developer who has worked on finance will have faced this issue & developed it at least once. Technical guys fret over the BSFN’s “F0911 Edit Line” or “F0911 Begin Doc”. Probably because they don’t know how simple it is to use.
Let’s have a small demo of using the F0911 Master Business Functions, and its parameters. I hope the Variable names are self-explanatory on what they are.
*I’ve mapped only those bare minimum fields for creating Journal Entries. Depending on your need, you will have to do more.
- To start using the F0911 MBF, you need to have a Batch number (F0011)
VA rpt_SZBatchType_ICUT = ‘G’ F0011 Open Batch UNDEFINED X cPrevBatchstatus UNDEFINED X cPostoutofbalance VA rpt_szBatchType_ICUT -> szBatchtype VA rpt_mnBatchNumber_ICU <> mnBatchnumber PO jdDtForGLAndVouch1 -> jdBatchDate UNDEFINED X cCancelBatchControl
- The whole concept of MBF’s work upon transaction control, based on Cached data. So to start the Transaction control and initiate the cache, we execute the Begin Doc BSFN
VA rpt_mnGLJobNumber_MATH01 = 0 VA rpt_mnDocVoucherInvoiceE_DOC - 0 F0911 Begin Document VA rpt_mnGLJobNUmber_MATH01 <> mnJobNumber "A" -> cDocAction UNDEFINED X cEditInstructionFlag UNDEFINED X cErrorFlag "J" -> cTypeDoc VA rpt_mnJournalEntryLineNo_JELN <> mnLastLineNumber PO szCompany -> szCompanyKey PO szDocumentType -> szDocumentType VA rpt_mnDocVoucherInvoiceE_DOC <> mnDocNumber VA rpt_DtForGLAndVouch1 -> jdGLDate "AA" -> szLedgerType VA rpt_mnBatchNumber_ICU <> mnBatchNumber VA rpt_szBatchType_ICUT <> szBatchType VA rpt_DtForGLAndVouch1 -> jdBatchDate VA rpt_DtForGLAndVouch1 -> jdBatchSystemDate UNDEFINED X mnBatchTime UNDEFINED X szTransactionCurrency UNDEFINED X mnCurrencyRate PO szNameAlphaExplanation -> szExplanation UNDEFINED X szReference1 UNDEFINED X szHomeBusinessUnit UNDEFINED X szInvoiceNumber UNDEFINED X jdInvoiceDate UNDEFINED X cReverseVoid UNDEFINED X jdHistoricalDate UNDEFINED X mnHistoricalRate UNDEFINED X cCurrencyMode UNDEFINED X szBaseCoCurrency UNDEFINED X cMultiCurrencyInterco UNDEFINED X mnAmountToDistribute UNDEFINED X mnCurAmountToDistribute UNDEFINED X cCurrencyFlag UNDEFINED X cHeaderChangedFlag UNDEFINED X cModelFlag UNDEFINED X szJEVersion UNDEFINED X cExchangeRateDateFlag UNDEFINED X cPaymentInstrument
- That’s it, now you can call the Edit Line BSFN’s to do each Journal Entry line. You need to insert the Line numbers for each Journal Entry.
VA rpt_mnJournalEntryLineNo_JELN = [VA rpt_mnJournalEntryLineNo_JELN]+1 F0911 Edit Line VA rpt_mnGLJobNUmber_MATH01 -> mnJobNumber "A" -> cLineAction "1" -> cProcessingMode UNDEFINED X cEditFlag UNDEFINED X cErrorFlag "<Zero>" -> cRecordWrittenFlag "J" -> cTypeDoc VA rpt_mnJournalEntryLineNo_JELN -> mnLineNumber VA rpt_mnJournalAmount_AA -> mnAmount VA rpt_DebitAccountNo_ANI -> szAccountNumber VA rpt_DebitAccountId_AID -> szAccountID VA rpt_DebitCostCenter_MCU -> szBusinessUnit VA rpt_DebitObjectAccount_OBJ -> szObject VA rpt_DebitSubsidiary_SUB -> szSubsidiary "2" -> cAccountMode VA rpt_FiscalYear1_FY -> mnFiscalYear VA rpt_PeriodNo_PN -> mnPeriodNumber VA rpt_Century_CTRY -> mnCentury VA rpt_Subledger - G/L -> szSubledger VA rpt_Subledger Type -> cSubledgerType UNDEFINED X mnUnits UNDEFINED X szUnitOfMeasure UNDEFINED X jdServiceDate UNDEFINED X szLineExtension UNDEFINED X szAssetID UNDEFINED X cPostedCode PO szNameAlphaExplanation -> szExplanation UNDEFINED X szReference2 UNDEFINED X szPayItem UNDEFINED X cBillCode UNDEFINED X mnDoiSub UNDEFINED X szWorkOrder001 UNDEFINED X szOutsiderLeaseWellID UNDEFINED X szOrderType UNDEFINED X mnLineID UNDEFINED X szPODocType UNDEFINED X szPOKeyCompany UNDEFINED X szPurchaseOrder UNDEFINED X szPOSuffix UNDEFINED X c1099Flag UNDEFINED X mnCurrencyAmount UNDEFINED X mnForeignTaxAmount UNDEFINED X mnForeignTaxableAmount UNDEFINED X mnTaxAmount UNDEFINED X mnAmountTaxable UNDEFINED X szTaxExplanationCode UNDEFINED X szTaxArea UNDEFINED X cCurrencyFlag UNDEFINED X szCompany UNDEFINED X jdCheckDate UNDEFINED X szDisplayKeyCompany UNDEFINED X szDisplayBaseCoCurr UNDEFINED X szDisplayTransCurrency UNDEFINED X mnDisplayExchgRate UNDEFINED X cDisplayCurrencyMode UNDEFINED X mnLastLineNo UNDEFINED X mnOriginalAmount UNDEFINED X mnOriginalAmountForeign UNDEFINED X cGlPostCodeAlt001 UNDEFINED X cGlPostCodeAlt002 UNDEFINED X cGlPostCodeAlt003 UNDEFINED X cGlPostCodeAlt004 UNDEFINED X cGlPostCodeAlt005 UNDEFINED X cGlPostCodeAlt006 UNDEFINED X cCommitmentReliefFlag UNDEFINED X cBillingControl UNDEFINED X cGlPostCodeAlt009 UNDEFINED X cGlPostCodeAlt000 UNDEFINED X cGlPostCodeAlt00X UNDEFINED X szCheckNumber UNDEFINED X jdDateCheckCleared UNDEFINED X cSummarizedCode UNDEFINED X cPurgeCode UNDEFINED X cBatchRearEndPostCode UNDEFINED X szJobCategory UNDEFINED X szJobStep UNDEFINED X mnWeeklyYear UNDEFINED X mnWeeklyPeriod UNDEFINED X cFinalPayment UNDEFINED X cAssetInputMode UNDEFINED X mnSequenceNoOperations UNDEFINED X mnOriginalDocNumber UNDEFINED X szOriginalKeyCo UNDEFINED X cClientFreeForm1 UNDEFINED X cClientFreeForm2 UNDEFINED X szGlClass UNDEFINED X cDeleteNotAllowed UNDEFINED X szIdType UNDEFINED X szSubledgerDescription UNDEFINED X szAccountDescription UNDEFINED X cBypassMEditFlag UNDEFINED X cReconciledCode UNDEFINED X mnTaxAmountGross UNDEFINED X mnForeignTaxAmountGross UNDEFINED X cPostingCode1ManagerialAccount UNDEFINED X cPostingCode2ManagerialAccount UNDEFINED X cPostingCode3ManagerialAccount UNDEFINED X cPostingCode4ManagerialAccount UNDEFINED X cPostingCode5ManagerialAccount UNDEFINED X cPostingCode6ManagerialAccount UNDEFINED X cPostingCode7ManagerialAccount UNDEFINED X cPostingCode8ManagerialAccount UNDEFINED X cPostingCode9ManagerialAccount UNDEFINED X cPostingCode10ManagerialAccoun UNDEFINED X cManagerialAnalysisType1 UNDEFINED X szManagerialAnalysisCode1 UNDEFINED X cManagerialAnalysisType2 UNDEFINED X szManagerialAnalysisCode2 UNDEFINED X cManagerialAnalysisType3 UNDEFINED X szManagerialAnalysisCode3 UNDEFINED X cManagerialAnalysisType4 UNDEFINED X szManagerialAnalysisCode4 UNDEFINED X mnIdentifierShortItem UNDEFINED X mnAddressNumber
- We also need to make sure that the reverse entry to Balance the Journal Entries created above are done. For that increment the Line number, and reverse the amount, then call the Edit Line again.
VA rpt_mnJournalEntryLineNo_JELN = [VA rpt_mnJournalEntryLineNo_JELN]+1 VA rpt_mnJournalAmount_AA = [VA rpt mnJournalAmount *-1] F0911 Edit Line VA rpt_mnGLJobNUmber_MATH01 -> mnJobNumber "A" -> cLineAction "1" -> cProcessingMode UNDEFINED X cEditFlag UNDEFINED X cErrorFlag "<Zero>" -> cRecordWrittenFlag "J" -> cTypeDoc VA rpt_mnJournalEntryLineNo_JELN -> mnLineNumber RV Total of Cum Total PC -> mnAmount VA rpt_CreditAccountNo_ANI -> szAccountNumber VA rpt_CreditAccountId_AID -> szAccountID VA rpt_CreditCostCenter_MCU -> szBusinessUnit VA rpt_CreditObjectAccount_OBJ -> szObject VA rpt_CreditSubsidiary_SUB -> szSubsidiary "2" -> cAccountMode VA rpt_FiscalYear1_FY -> mnFiscalYear VA rpt_PeriodNo_PN -> mnPeriodNumber VA rpt_Century_CTRY -> mnCentury VA rpt_Subledger - G/L -> szSubledger VA rpt_Subledger Type -> cSubledgerType UNDEFINED X mnUnits UNDEFINED X szUnitOfMeasure UNDEFINED X jdServiceDate UNDEFINED X szLineExtension UNDEFINED X szAssetID UNDEFINED X cPostedCode PO szNameAlphaExplanation -> szExplanation UNDEFINED X szReference2 UNDEFINED X szPayItem UNDEFINED X cBillCode UNDEFINED X mnDoiSub UNDEFINED X szWorkOrder001 UNDEFINED X szOutsiderLeaseWellID UNDEFINED X szOrderType UNDEFINED X mnLineID UNDEFINED X szPODocType UNDEFINED X szPOKeyCompany UNDEFINED X szPurchaseOrder UNDEFINED X szPOSuffix UNDEFINED X c1099Flag UNDEFINED X mnCurrencyAmount UNDEFINED X mnForeignTaxAmount UNDEFINED X mnForeignTaxableAmount UNDEFINED X mnTaxAmount UNDEFINED X mnAmountTaxable UNDEFINED X szTaxExplanationCode UNDEFINED X szTaxArea UNDEFINED X cCurrencyFlag UNDEFINED X szCompany UNDEFINED X jdCheckDate UNDEFINED X szDisplayKeyCompany UNDEFINED X szDisplayBaseCoCurr UNDEFINED X szDisplayTransCurrency UNDEFINED X mnDisplayExchgRate UNDEFINED X cDisplayCurrencyMode UNDEFINED X mnLastLineNo UNDEFINED X mnOriginalAmount UNDEFINED X mnOriginalAmountForeign UNDEFINED X cGlPostCodeAlt001 UNDEFINED X cGlPostCodeAlt002 UNDEFINED X cGlPostCodeAlt003 UNDEFINED X cGlPostCodeAlt004 UNDEFINED X cGlPostCodeAlt005 UNDEFINED X cGlPostCodeAlt006 UNDEFINED X cCommitmentReliefFlag UNDEFINED X cBillingControl UNDEFINED X cGlPostCodeAlt009 UNDEFINED X cGlPostCodeAlt000 UNDEFINED X cGlPostCodeAlt00X UNDEFINED X szCheckNumber UNDEFINED X jdDateCheckCleared UNDEFINED X cSummarizedCode UNDEFINED X cPurgeCode UNDEFINED X cBatchRearEndPostCode UNDEFINED X szJobCategory UNDEFINED X szJobStep UNDEFINED X mnWeeklyYear UNDEFINED X mnWeeklyPeriod UNDEFINED X cFinalPayment UNDEFINED X cAssetInputMode UNDEFINED X mnSequenceNoOperations UNDEFINED X mnOriginalDocNumber UNDEFINED X szOriginalKeyCo UNDEFINED X cClientFreeForm1 UNDEFINED X cClientFreeForm2 UNDEFINED X szGlClass UNDEFINED X cDeleteNotAllowed UNDEFINED X szIdType UNDEFINED X szSubledgerDescription UNDEFINED X szAccountDescription UNDEFINED X cBypassMEditFlag UNDEFINED X cReconciledCode UNDEFINED X mnTaxAmountGross UNDEFINED X mnForeignTaxAmountGross UNDEFINED X cPostingCode1ManagerialAccount UNDEFINED X cPostingCode2ManagerialAccount UNDEFINED X cPostingCode3ManagerialAccount UNDEFINED X cPostingCode4ManagerialAccount UNDEFINED X cPostingCode5ManagerialAccount UNDEFINED X cPostingCode6ManagerialAccount UNDEFINED X cPostingCode7ManagerialAccount UNDEFINED X cPostingCode8ManagerialAccount UNDEFINED X cPostingCode9ManagerialAccount UNDEFINED X cPostingCode10ManagerialAccoun UNDEFINED X cManagerialAnalysisType1 UNDEFINED X szManagerialAnalysisCode1 UNDEFINED X cManagerialAnalysisType2 UNDEFINED X szManagerialAnalysisCode2 UNDEFINED X cManagerialAnalysisType3 UNDEFINED X szManagerialAnalysisCode3 UNDEFINED X cManagerialAnalysisType4 UNDEFINED X szManagerialAnalysisCode4 UNDEFINED X mnIdentifierShortItem UNDEFINED X mnAddressNumber UNDEFINED X szOverrideExplanation
- Do the steps 3 & 4 for all the Journal Entries you need to do under the batch.
- Now once completed, you need to validate and finalize the Entries into the F0911 Table.
For this, you need to call the “End Document” BSFN, with the UpdateHeader flag = 1, this will write the cache into the F0911 as well as F0011 the Batch header. Updating the Header is necessary, as this is the Batch Number which you are going to Post.
F0911 End Document VA rpt_mnGLJobNUmber_MATH01 -> mnJobNumber VA rpt_ComputerID_CTID -> szComputerID UNDEFINED X cErrorFlag VA rpt_mnBatchNumber_ICU -> mnBatchNumber VA rpt_szBatchType_ICUT -> szBatchType "A" -> cPrevBatchStatus "1" -> cBatchStatus UNDEFINED X cDocInBalance UNDEFINED X cSuppressBatchControl UNDEFINED X cExitedOnAdd "A" -> cOverrideMode UNDEFINED X mnStartingDocAmount UNDEFINED X cCurrencyFlag UNDEFINED X mnNextNumberIndex UNDEFINED X szNextNumberSystemcode "J" -> cTypeOfDocument VA rpt_mnDocVoucherInvoiceE_DOC <> mnDocNumber "R550911T" -> szProgramID SL UserID -> szUserID "1" -> cUpdateBatchHeader UNDEFINED X cBypassCurrencyConv
- That’s it. You have completed the Journal Entries, and are ready to post them.
- Close the Batch and F0911 Cache using the following before you finish off.
F0911 Delete Work File VA rpt_mnGLJobNUmber_MATH01 -> BF mnJobNumber "1" -> BF cClearHeader "1" -> BF cClearDetail // // // End the Batch F0011 Close Batch VA rpt_mnBatchNumber_ICU -> BF mnBatchnumber "G" -> BF szBatchtype
Hope this fairly simple code helps you do the Journal Entries. Similar approaches are to be followed for Sales Order Entry – for F4211 MBF’s or any others like F4311 MBF’s too.
Related Articles:

![[Google]]( http://www.jdesource.com/wp-content/plugins/easy-adsenser/google-light.gif)
Brilliant!
Thanks a lot!!!