Loading

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 LOOP;
END IF;
END;
/

If the Status is 'E', check for the error message and debug log.

1 Responses to “Ar_receipt_api_pub.Create_and_apply”

Sridevi K said...
September 24, 2016 at 3:11 AM

Regards
Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.


Post a Comment

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.