OracleArea51

Sponsored By Chola Global Services LLC

AR_RECEIPT_API_PUB.apply_open_receipt API

E-mail
(3 votes, average 4.67 out of 5)
This is a test script given by oracle which I had used in my project before.

Don't have an Vision instance to practice these tutorials? Visit http://cholagls.com/products-/11i-virtual-machine for details.Our smart solution to smart people like you !!

1. Login to sql plus.
2. Run the following SQL code to obtain USER_ID, RESPONSIBILITY_ID & RESPONSIBILITY_APPLICATION_ID for a given User / Responsibility.


SELECT user_id, responsibility_id, responsibility_application_id,   
 security_group_id   
FROM fnd_user_resp_groups   
WHERE user_id = (SELECT user_id   
 FROM fnd_user   
 WHER user_name = '&user_name')   
AND responsibility_id = (SELECT responsibility_id   
 FROM fnd_responsibility_vl   
 WHERE responsibility_name = '&resp_name');  


3. Run following API to apply a cash receipt in your functional currency to unapplied cash on another receipt, using a call to the API Ar_receipt_api_pub.apply_open_receipt and passing a minimum number of input parameters.

/*=======================================================================+
 |  Copyright (c) 1993 Oracle Corporation Redwood Shores, California, USA|
 |                          All rights reserved.                         |
 +=======================================================================+
 | DESCRIPTION                                                           |
 |      PL/SQL to run API AR_RECEIPT_API_PUB.apply_open_receipt          |
 +=======================================================================*/
set serveroutput on
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;
l_amount_applied NUMBER;
l_receipt_number  VARCHAR2(30);
l_open_receipt_number   VARCHAR2(30);
l_application_ref_num   VARCHAR2(30);
l_receivable_application_id NUMBER;
l_applied_rec_app_id NUMBER;
l_acctd_amount_applied_from NUMBER;
l_acctd_amount_applied_to VARCHAR2(30);
BEGIN
/*------------------------------------+
|  Setting global initialization      | 
+------------------------------------*/
FND_GLOBAL.apps_initialize(&user_id,&resp_id,&resp_appl_id);
MO_GLOBAL.init('AR'); 
/*------------------------------------+
|  Setting value to input parameters  | 
+------------------------------------*/
l_amount_applied :=  &amount_applied;
l_receipt_number  := '&receipt_number';
l_open_receipt_number   := '&open_receipt_number';
/*------------------------------------+
|  Calling to the API       |
+------------------------------------*/
AR_RECEIPT_API_PUB.apply_open_receipt
( 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_applied => l_amount_applied,
 p_receipt_number => l_receipt_number,
 p_open_receipt_number => l_open_receipt_number,
 x_application_ref_num => l_application_ref_num,
 x_receivable_application_id => l_receivable_application_id,
 x_applied_rec_app_id => l_applied_rec_app_id,
 x_acctd_amount_applied_from => l_acctd_amount_applied_from,
 x_acctd_amount_applied_to => l_acctd_amount_applied_to);
/*------------------------------------+
|  Error handling              |
+------------------------------------*/
DBMS_OUTPUT.put_line('Return status ' || l_return_status );
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;
COMMIT;
END;
/
I am an Oracle Technical Architect working on Oracle Property Manager.My Expertise includes OA Framework,SOA and OBIEE.
Sudhakar Mani
Points: 1410
Contact Author | Website : www.asksudhakar.com
 

Related Posts:

relatedArticles
Trackback(0)
Comments (0)add comment

Write comment

busy