Using The B0900049 Business Functions
1) First you’ll need a batch number. Use Business function B00042 FS OpenBatch
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
2) Now use Begin Document once to open the cache and assign a job number
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
PO jdDtForGLAndVouch1 -> jdGLDate
"AA" -> szLedgerType
VA rpt_mnBatchNumber_ICU > mnBatchNumber
VA rpt_szBatchType_ICUT > szBatchType
PO jdDtForGLAndVouch1 -> jdBatchDate
PO jdDtForGLAndVouch1 -> 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
3) Now for each journal line call the edit line function. Don’t forget to create equal and opposite journal entries and increment the journal entry line number between each call
Repeat the edit line calls for each journal line required.
0037 VA rpt_mnJournalEntryLineNo_JELN = [VA rpt_mnJournalEntryLineNo_JELN]+1
0039 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
PC Subledger - G/L -> szSubledger
PC 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
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
PC Subledger - G/L -> szSubledger
PC 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
4) When you are done, call the end document function. With the ‘UpdateBatchHeader’ flag set to 1, this function will write the cache to the F0911 table and will also update the F0011 batch header you opened up right at the start.
0028 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
"R5651800" -> szProgramID
SL UserID -> szUserID
"1" -> cUpdateBatchHeader
UNDEFINED X cBypassCurrencyConv