Professional Documents
Culture Documents
API To Revese Receipt
API To Revese Receipt
p_user_id NUMBER;
p_resp_id NUMBER;
p_resp_appl_id NUMBER;
BEGIN
fnd_global.apps_initialize
(
user_id => p_user_id,
resp_id => p_resp_id,
resp_appl_id => p_resp_appl_id
);
END;
3)SELECT RESPONSIBILITY_ID
FROM FND_RESPONSIBILITY
WHERE APPLICATION_ID=222;
)
DECLARE
p_api_version NUMBER;
p_init_msg_list VARCHAR2(200);
p_commit VARCHAR2(200);
p_validation_level NUMBER;
x_return_status VARCHAR2(200);
x_msg_count NUMBER;
x_msg_data VARCHAR2(200);
p_cash_receipt_id ar_cash_receipts.cash_receipt_id%TYPE;
p_receipt_number ar_cash_receipts.receipt_number%TYPE;
p_amount_applied
ar_receivable_applications.amount_applied%TYPE;
p_applied_payment_schedule_id
ar_payment_schedules.payment_schedule_id%TYPE;
p_link_to_customer_trx_id ra_customer_trx.customer_trx_id
%TYPE;
p_receivables_trx_id
ar_receivable_applications.receivables_trx_id%TYPE;
p_apply_date ar_receivable_applications.apply_date
%TYPE;
p_apply_gl_date ar_receivable_applications.gl_date
%TYPE;
p_ussgl_transaction_code
ar_receivable_applications.ussgl_transaction_code%TYPE;
p_attribute_rec AR_RECEIPT_API_PUB.attribute_rec_type;
p_global_attribute_rec
AR_RECEIPT_API_PUB.global_attribute_rec_type;
p_comments ar_receivable_applications.comments
%TYPE;
p_application_ref_type
ar_receivable_applications.application_ref_type%TYPE;
p_application_ref_id
ar_receivable_applications.application_ref_id%TYPE;
p_application_ref_num
ar_receivable_applications.application_ref_num%TYPE;
p_secondary_application_ref_id
ar_receivable_applications.secondary_application_ref_id%TYPE;
p_payment_set_id
ar_receivable_applications.payment_set_id%TYPE;
p_receivable_application_id
ar_receivable_applications.receivable_application_id%TYPE;
p_customer_reference
ar_receivable_applications.customer_reference%TYPE;
p_val_writeoff_limits_flag VARCHAR2(200);
p_called_from VARCHAR2(200);
p_netted_receipt_flag VARCHAR2(200);
p_netted_cash_receipt_id ar_cash_receipts.cash_receipt_id%TYPE;
p_secondary_app_ref_type
ar_receivable_applications.secondary_application_ref_type%TYPE;
p_secondary_app_ref_num
ar_receivable_applications.secondary_application_ref_num%TYPE;
BEGIN
p_cash_receipt_id := 27673;
p_receipt_number := 'TEST-UOB-7';
p_amount_applied := 3;
p_applied_payment_schedule_id := -3;
p_receivables_trx_id := 1483;
fnd_global.apps_initialize( 1290,51118,222);
AR_RECEIPT_API_PUB.Activity_application(
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 => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_cash_receipt_id => p_cash_receipt_id,
p_receipt_number => p_receipt_number,
p_amount_applied => p_amount_applied,
p_applied_payment_schedule_id => p_applied_payment_schedule_id,
p_link_to_customer_trx_id => p_link_to_customer_trx_id,
p_receivables_trx_id => p_receivables_trx_id,
p_apply_date => p_apply_date,
p_apply_gl_date => p_apply_gl_date,
p_ussgl_transaction_code => p_ussgl_transaction_code,
p_attribute_rec => p_attribute_rec,
p_global_attribute_rec => p_global_attribute_rec,
p_comments => p_comments,
p_application_ref_type => p_application_ref_type,
p_application_ref_id => p_application_ref_id,
p_application_ref_num => p_application_ref_num,
p_secondary_application_ref_id => p_secondary_application_ref_id,
p_payment_set_id => p_payment_set_id,
p_receivable_application_id => p_receivable_application_id,
p_customer_reference => p_customer_reference,
p_val_writeoff_limits_flag => p_val_writeoff_limits_flag,
p_called_from => p_called_from,
p_netted_receipt_flag => p_netted_receipt_flag,
p_netted_cash_receipt_id => p_netted_cash_receipt_id,
p_secondary_app_ref_type => p_secondary_app_ref_type,
p_secondary_app_ref_num => p_secondary_app_ref_num
);
COMMIT;
dbms_output.put_line('SUCCESS');
dbms_output.put_line('Return Status = '|| SUBSTR
(x_return_status,1,255));
dbms_output.put_line('Message Count = '||x_msg_count);
dbms_output.put_line('Message Data = '||x_msg_data);
dbms_output.put_line('p_receivable_application_id = '||
p_receivable_application_id);
ELSE
ROLLBACK;
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Exception :'||sqlerrm);
END;
The senarios is very simple as cancel, you basically booked the transaction and then reverse it to
make net effect zero.
Typically senarios is when Customer is ready to pay, you created Receipt and submitted a
cheque in Bank and then bank inform there is issue with Cheque ,in that case you are simply
reversing the transaction and notify the customer.
Once you identify the key and mandatory column , you have 50% done. What is recomended for
you to check the API version in irep with your EBS version.
Step 2 : Idetify and the mandatory column and must do pre-requsite setup for receipt.
Your Payment method , underline bank, respective accounting details must be pre-requiste step
up for creating a receipt in Oracle.
The mandatory requirement is Customer master with valid bill to and a valid transaction that
must be open.
The other mandatory column here is to pass the reason and code that must be from setup.
Input from these two screens are used to pass the value in the API's