Thursday, January 28, 2010

Ar_receipt_api_pub.Create_cash

Creates a single cash receipt, as in the case of manually created cash receipts.
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
AR_RECEIPT_API_PUB.create_cash
( 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_currency_code => '&currency_code',
p_amount => &amount,
p_receipt_number => '&receipt_number',
p_receipt_date => '&receipt_date',
p_gl_date => '&gl_date',
p_customer_number => '&customer_number',
p_receipt_method_id => &receipt_method_id,
p_cr_id => l_cash_receipt_id );
dbms_output.put_line('Status ' || l_return_status);
dbms_output.put_line('Cash Receipt id ' || l_cash_receipt_id );
dbms_output.put_line('Message count ' || l_msg_count);
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.

0 Responses to “Ar_receipt_api_pub.Create_cash”

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.