Hi, Everyone
please help me, i need to join tmpCustVendTrans with LedgerJournalTrans/DimensionAttributeValueCombination, so that i can make a report like this

i retrieve the invoice number from tmpCustVendTrans, group it, and use it as a header.
and i put all data in one temporary table.
Here's My Query :
LedgerJournalTrans ljtr;
DimensionAttributeValueCombination dimensionAttributeValueCombination;
LedgerJournalId ledgerJournalId = '000001';
TmpBankReceiptVoucher tmpBankReceiptVoucher; // Temporary Table
while select ljtr
where ljtr.JournalNum == ledgerJournalId //JournalNum Parameter
{
tmpCustVendTrans = this.tmpCustVendTrans(ljtr.JournalNum, ljtr.Voucher);
while select dimensionAttributeValueCombination
join ledgerJournalTable
join ledgerJournalTrans
where ledgerJournalTrans.JournalNum == ledgerJournalId
&& ledgerJournalTable.JournalNum == ledgerJournalId
&&
(
dimensionAttributeValueCombination.RecId == ledgerJournalTrans.LedgerDimension ||
dimensionAttributeValueCombination.RecId == ledgerJournalTrans.OffsetLedgerDimension
)
{
tmpBankReceiptVoucher.LedgerJournalId = ledgerJournalTrans.JournalNum;
tmpBankReceiptVoucher.LedgerJournalName = ledgerJournalTable.Name;
tmpBankReceiptVoucher.TransDate = ledgerJournalTrans.TransDate;
tmpBankReceiptVoucher.LedgerDimension = dimensionAttributeValueCombination.RecId;
while select tmpCustVendTrans
{
tmpBankReceiptVoucher.InvoiceId = tmpCustVendTrans.Invoice;
}
tmpBankReceiptVoucher.insert();
}
}
the problem is, when i pull the data, i got redundant data. the OffsetLedgerDimension is repeated every row.
thanks for helping me
*This post is locked for comments
I have the same question (0)