hi experts,
i am writing batch input program using tcode f-32. f-32 second screen it is displaying all credit and debit line items.i got all debit and credit line items in the internal tables.
I must select the credit amounts first and then according to the baseline date (bsid-zfbdt) determine the oldest debit and select that debit line.
If there is a credit balance after selecting the first line, (Field RF05A-DIFFB = debit balance) the next oldest debit line must be selected This process of allocating credits against debit lines must continue until a debit balance is calculated (Field RF05A-DIFFB = credit balance).
if the line items are like this.
customer amount baseline date
12300020 79 12.10.2006----
debit line item
12300020 59 13.10.2006----
debit line item
12300020 44 15.10.2006----
debit line item
12300020 89- 14.10.2006----
credit line item
first i must select 3rd line item,after that oldest debit line item according to baseline date i must select 1st line item,after that still
i got credit balance(89-79 = 10-).so i need to select second oldest debit line item that means 2nd line item must select.
how can i write the code for this.can anybodu please help me.
Thanks and regards
praveen
In your internal table, sort by baseline date (ascending). This will put your documents in the correct order. Then loop through that table adding the amounts until you get a debit balance. This should give you the list of documents that you have to clear.
Then in your batch input session, you can press the 'document number' radio button on the first screen of f-32 and then the 'process open items' button. That will take you to a screen where you can enter the document numbers that you just selected.
Rob
Add a comment