2007 May 14 12:30 PM
User Exit for the Cash Preprocessor logic needs to include the following:
1 Account AVIK-KONTO
2 Payment Amount AVIK-REWBTR
3 Payment Date AVIK-ZALDT
4 Bank Number AVIK-ZBNKL
5 Payee Acct No AVIK-ZBNKN
6 *Check Number AVIK-CHECT
22 Adv Header Text AVIK-AVTXT
7 Payment Amount AVIP-NEBTR
8 Deduction Amount AVIP-ABBTR
9 Gross Amount AVIP-WRBTR
10 Reason Code AVIP-RSTGN
11 Discount Amount AVIP-WSKTO
12 Document Number AVIP-BELNR
13 Reference AVIP-XBLNR
14 Reference Key 1 AVIP-XREF1
15 Reference Key 2 AVIP-XREF2
16 PO Number AVIP-BSTNK
17 Assignment AVIP-ZUONR
18 Alternative Acct AVIP-ABWKO
19 Text AVIP- SGTXT
20 Customer AVIP-KONTO
21 Payment Reference AVIP-KIDNO
For Like reference numbers(AVIP-XBLNR) combine the following amounts
o Payment Amount (AVIP-NEBTR), Deduction Amount (AVIP-ABBTR), Gross Amount (AVIP-WRBTR), Discount Amount (AVIP-WSKTO)
Populate the Payment Advice
Loop Through All Checks Until Finished *****
Loop Get Next Check (from AVIK table)
Use the Bank Number (AVIK-ZBNKL) and Payee Acct No fields (AVIK-ZBNKN) from the Payment Advice Header (AVIK) to identify the Payer
o If one and only one Payer is returned
 Consider the Payer found
 Populate the Account Number (AVIK-KONTO) on the Payment Advice
 Populate Payment Advice Header Text (AVIK-AVTXT) with Payer Found Via MICR #
 Continue with Loop Get First Check Line Item
Else if No Payer Returned or Multiple Payers Returned
Loop through Document Numbers (AVIP-BELNR) supplied in the payment details to identify the Payer
o Consider only positive payment amounts
Search the BSID table for the open item using the Document Number (AVIP-BELNR) and company code US39
 If only one Document is Returned
Consider the Payer found
Assign the Account Number (AVIK-KONTO) on the Payment Advice
Populate Payment Advice Header Text (AVIK-AVTXT) with Payer Found Via Document #
Continue with Loop Get First Check Line Item
 Else Multiple Returns or None Returned
Consider the Check Unidentified
Update the Account Number (AVIK-KONTO) on the Payment Advice with a *
Populate Payment Advice Header Text (AVIK-AVTXT) with Payer Not Found
If Another Check Exists
o Go To Loop Get Next Check
Else
o Processing Complete
Endif
 Endif
o Endif
Inside Each Check, Loop Through All Check Lines *****
o Loop Get First Check Line Item
o Assign AVIP-XBLNR to AVIP-ZUONR Assignment
o Assign AVIP-XBLNR to AVIP-XREF2Ref Key 2
Logic for Non-Invoice Related Deductions *****
o If Payment Amount (AVIP-NEBTR) is < 0 (deduction)
 Move Payment Amount (AVIP-NEBTR) to Deduction Amount (AVIP-ABBTR) column
 Check to see if Deduction Amount (AVIP-ABBTR) <= Cash Tolerance
 For Cash Tolerance consider Company Code and Payer (AVIK-KONTO) and execute transaction XD03. Then go into the Company Code Data View to get the Tolerance Group (KNB1-TOGRU)
 Go to OBA3 to search the Company Code and Tolerance Group (KNB1-TOGRU) for the Tolerance Amount
 If Deduction Amount (AVIP-ABBTR) <= V_T043G-BETRS (Ref B)
Assign Z98 to Deduction Reason Code (AVIP-RSTGN)
Populate Payment Advice Text (AVIP-SGTXT) (AVIP- SGTXT) with Small Balance Write-off
 Else
Assign Z00 Unexplained Deduction to the Deduction Reason Code (AVIP-RSTGN)
Populate Payment Advice Text (AVIP-SGTXT) (AVIP- SGTXT) with Non-Invoice Related Deduction
If Another Check Line exists
o Loop Get Next Check Line Item
Else
o Go To Loop Get Next Check until all checks have been processed
Endif
 Endif
o Endif
Logic for Invoice Related Payments *****
o If Payment Amount (AVIP-NEBTR) > 0 (payment)
o Use the Document Number (AVIP-BELNR) Company Code provided to locate the open item in BSID
o Capture list of Alt Payers (BSID-KUNNR) using transaction XD03 with Payer (AVIK-KONTO) and Company Code US39
o Execute SE16 on table BSID for Company Code US39, Customer (BSID-KUNNR) and Document Number (AVIP-BELNR)
o If one and only one document number can be found using a wild card search ####### for the Payer or Alt Payer group
 Move the Payer to into the Alternative Acct Field AVIP-ABWKO
 Move BSID Amount into AVIP-WRBTR Move the BSID Document Number into AVIP-BELNR
 Go to Document Number Found
o Else if Document Number Not Found
 Execute SE16 on table BSID for Company Code US39, Customer (BSID-KUNNR) and Reference Number (AVIP-XBLNR)
 Perform wild card search ######## on the Reference Number (AVIP-XBLNR)
If one and only one Reference Number is returned
o Move the Payer to into the Alternative Acct AVIP-ABWKO
o Move BSID Amount into AVIP-WRBTR
o Move the BSID Document Number into AVIP-BELNR
o Go to Document Number Found
Else
o Place an * in the first position of the Document Number (AVIP-BELNR
o Populate Payment Advice Text (AVIP-SGTXT) (AVIP- SGTXT) with Invoice Not Found
o Loop Through All Check Lines until all items are processed
Endif
 Endif
o Endif
2007 May 14 2:47 PM
as tommorrow is the final day for my object.
iam requesting any experts to help me in writing the code or the flow of the code.
Thanking you.
2007 May 14 3:08 PM
Hi,
What is your problem? You need post code jut give the details of
Enahncement/project name and User Exit name
clearly write what is your requirement not code.
Regards
Ganesh
2007 May 15 11:25 AM
Hi Ganesh,
actually this an user exit for Transactions FLB1, FB01, FB05.
we need to write an substitute exit(FM).
my requirement is that the user asked me to loop the table AVIK using fields Bank Number (AVIK-ZBNKL) and Payee Acct No fields (AVIK-ZBNKN) and get the customers(payers).
my question is we will goto KNBK and get all Customer no's.
but he is asking to check if there is one customer -
logic
many customers------- logic
no customers----
logic.
iam afraid how to write the code for differentiating them.
please help me in this.
TQ.
2007 May 15 2:51 PM
Hi,
After you fetching the data check sy-subrc
if sy-subrc eq 0.
1. Records are existing
2. in the internal table to find how many rows write the below code.
DESCRIBE TABLE ITAB LINES INTO V_LINES
IF v_line > 1.
write logic for many rows.
else.
write logic for one row.
ENDIF.
follow above steps
if any doubts reply
Regards
Ganesh