Introduction:
In this guide we’ll explain how to incomplete AR invoice in oracle apps r12 using API, along with standard API parameters explanation.
Goal:
Set AR Transaction to incomplete status using “ar_transaction_grp.incomplete_transaction” API
Forms Or Pages:
Example:
API IN/OUT Parameters :
— IN p_api_version NUMBER.
— IN p_init_msg_list VARCHAR2
— IN p_commit VARCHAR2
— IN p_validation_level NUMBER
— IN p_customer_trx_id ra_customer_trx.customer_trx_id%type.
— OUT x_return_status VARCHAR2.
— OUT x_msg_count NUMBER.
— OUT x_message_data VARCHAR2.
API Parameters clarifications:
DESCRIPTION
Incompletes the transaction after the following checks :
1. It should not have been posted to GL
2. There should not exist any activity against it
3. There should not be a chargeback for the transaction
4. There should not be debit memo reversal on the transaction
5. If none of above then update ra_customer_trx with complete_flag =N and call to maintain the payment schedules
- param p_api_version Compare version numbers of incoming calls to its current versions Default (1.0)
- param p_init_msg_list Flag to indicate initialization of message list.
- param p_commit Flag to indicate whether API should commit changes.
- param p_validation_level Validation Level of the API (Optional)
- param p_customer_trx_id customer_trx_id which we need to set it to incomplete status.
- param x_return_status Represent the API status.
- param x_msg_count Number of messages in the PI message list (not used by this API).
- param x_message_data Message in case API encounters any unexpected error.
API Calling example:
DECLARE
l_customer_trx_id NUMBER := 756709;
o_return_status VARCHAR2 (1);
o_msg_count NUMBER;
o_msg_data VARCHAR2 (2000);
l_err_msg VARCHAR2 (1000);
l_msg_index_out NUMBER;
BEGIN
ar_transaction_grp.incomplete_transaction (p_api_version => 1.0
,p_init_msg_list => fnd_api.g_false
,p_commit => fnd_api.g_true
,p_customer_trx_id => l_customer_trx_id
,x_return_status => o_return_status
,x_msg_count => o_msg_count
,x_msg_data => o_msg_data);
dbms_output.put_line ('********************************');
IF o_return_status = fnd_api.g_ret_sts_error
OR o_return_status = fnd_api.g_ret_sts_unexp_error THEN
dbms_output.put_line ('O_RETURN_STATUS = ' || o_return_status);
dbms_output.put_line ('O_MSG_COUNT = ' || o_msg_count);
IF o_msg_count > 0 THEN
FOR v_index IN 1 .. o_msg_count
LOOP
fnd_msg_pub.get (p_msg_index => v_index
,p_encoded => 'F'
,p_data => o_msg_data
,p_msg_index_out => l_msg_index_out);
o_msg_data := substr (o_msg_data, 1, 3950);
END LOOP;
dbms_output.put_line ('O_MSG_DATA = ' || o_msg_data);
END IF;
ELSE
dbms_output.put_line ('Customer Trx id: ' || l_customer_trx_id);
dbms_output.put_line ('Return Status: ' || o_return_status);
dbms_output.put_line ('AR Transaction has been setted to incomplete successfully');
END IF;
dbms_output.put_line ('********************************');
EXCEPTION
WHEN OTHERS THEN
l_err_msg := substr (sqlerrm, 0, 1000);
dbms_output.put_line ('***************************');
dbms_output.put_line ('There is an exception has been raised from API with the following error message: ' || l_err_msg);
dbms_output.put_line ('***************************');
END;
Final Result:
You may also interested in reading article: API to create AR invoice in Oracle Apps R12
In this article, we have demonstrated how to incomplete AR Transaction using API in oracle apps r12 .
Hopefully, it was clear and concise.
Please don’t use this code directly on production environment, instead test it on test environment first to make sure that API working correctly as per your requirements.
We are only giving one example of how to allocate one line as constant value.
[convertkit form=1415728]