Thursday, January 28, 2010
Ar_receipt_api_pub.Create_and_apply
Creates a cash receipt and applies it to a specified installment of a debit item in one pass.
Application fails if the creation fails due to some reason.
This api works only when you set the org_id using DBMS_APPLICATION.SET_CLIENT_INFO(&v_org_id)
But dont forget to set the session through FND_GLOBAL.APPS_INITIALISE because it will set the
necessary profile values defaulted to user
Script
DECLARE
l_return_status VARCHAR2(1);l_msg_count NUMBER;
l_msg_data VARCHAR2(240);
l_count NUMBER;
l_cash_receipt_id NUMBER;
l_msg_data_out VARCHAR2(240);
l_mesg VARCHAR2(240);
p_count number;
BEGIN
-- Api start here
AR_RECEIPT_API_PUB.create_and_apply
( p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_TRUE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_amount => &amount,
p_receipt_number => '&receipt_number',
p_receipt_date => '&receipt_date',
p_gl_date => '&gl_date',
p_customer_number => '&customer_number',
p_location => '&location_value',
p_receipt_method_id => &receipt_method_id,
p_trx_number => '&trx_number',
p_cr_id => l_cash_receipt_id );
dbms_output.put_line('Message count ' || l_msg_count);
dbms_output.put_line('Cash Receipt ID ' || l_cash_receipt_id );
IF l_msg_count = 1 Then
dbms_output.put_line('l_msg_data '||l_msg_data);
ELSIF l_msg_count > 1 Then
LOOP
p_count := p_count+1;
l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
if l_msg_data is NULL Then
EXIT;
END IF;
dbms_output.put_line('Message' || p_count ||' ---'||l_msg_data);
END
END IF;
END;
/
If the Status is 'E', check for the error message and debug log.
Do you think this Article is useful?
Subscribe to:
Post Comments (Atom)
Disclaimer
The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.
1 Responses to “Ar_receipt_api_pub.Create_and_apply”
March 22, 2019 at 12:16 PM
Hi Can this API do partial receipts?
Post a Comment