Create_cash

Hey guys,
I'm trying to create receipt using receipt API. After running my code, I don't see the record in the table AR_CASH_RECEIPTS_ALL. I don't know what I'm doing wrong, here is how I call the API.
set serveroutput on size 100000
DECLARE
l_cash_receipt_id NUMBER(15);
l_msg_count NUMBER(10);
l_return_status VARCHAR2(200);
l_msg_data VARCHAR2(4000);
l_remittance_bank_account_id NUMBER(15) := 10053;
TYPE Msg_rec IS RECORD(Message VARCHAR2(25));
TYPE Mesg_tbl_type IS TABLE OF Msg_rec INDEX BY BINARY_INTEGER;
Mesg_tbl Mesg_tbl_type;
l_msg_data_out VARCHAR2(2000);
stack_count NUMBER;
l_mesg VARCHAR2(100);
l_attribute_rec AR_RECEIPT_API_PUB.ATTRIBUTE_REC_TYPE;
l_global_attribute_rec AR_RECEIPT_API_PUB.GLOBAL_ATTRIBUTE_REC_TYPE;
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,
p_currency_code => 'USD',
p_amount => 50.00,
p_receipt_number => 'R-101',
p_receipt_date => SYSDATE,
p_gl_date => SYSDATE,
p_customer_id => 81795,
--p_customer_number => l_customer_number,
p_deposit_date => SYSDATE,
p_receipt_method_id => 4006,
p_cr_id => l_cash_receipt_id,
p_remittance_bank_account_id => l_remittance_bank_account_id,
p_attribute_rec => l_attribute_rec,
p_global_attribute_rec => l_global_attribute_rec,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
-- Catch the error if there is one
IF l_msg_count = 1 THEN
l_msg_data_out := l_msg_data;
ELSIF l_msg_count > 1 THEN
LOOP
stack_count := stack_count + 1;
l_mesg := FND_MSG_PUB.GET();
IF l_mesg IS NULL THEN
EXIT;
ELSE
Mesg_tbl(stack_count).message := l_mesg;
DBMS_OUTPUT.PUT_LINE(l_mesg);
END IF;
END LOOP;
END IF;
END;
/

try this ...same code have been modified
SET SERVEROUTPUT ON
SPOOL Create_Cash
DECLARE
     p_api_version      NUMBER;
     p_init_msg_list               VARCHAR2(240);
     p_commit               VARCHAR2(240);
     p_validation_level          NUMBER;
     p_usr_currency_code      VARCHAR2(240);
p_usr_exchange_rate_type      VARCHAR2(240);
p_exchange_rate_type      VARCHAR2(240);
p_exchange_rate      NUMBER;
p_exchange_rate_date      DATE;
p_factor_discount_amount      NUMBER;
p_receipt_date      DATE;
p_postmark_date      DATE;
p_customer_number      VARCHAR2(240);
p_customer_bank_account_id      NUMBER;
p_customer_bank_account_num VARCHAR2(240);
p_customer_bank_account_name VARCHAR2(240);
p_location      VARCHAR2(240);
p_customer_receipt_reference      VARCHAR2(240);
p_remittance_bank_account_num VARCHAR2(240);
p_remittance_bank_account_name VARCHAR2(240);
p_receipt_method_name      VARCHAR2(240);
p_doc_sequence_value      NUMBER;
p_ussgl_transaction_code      VARCHAR2(240);
p_anticipated_clearing_date      DATE;
p_called_from      VARCHAR2(240);
     p_comments               VARCHAR2(240);
     p_issuer_name VARCHAR2(240);
p_issue_date DATE;
p_issuer_bank_branch_id NUMBER;
     p_amount               NUMBER;
     p_receipt_number          VARCHAR2(240);
     p_receipt_method_id          NUMBER;
     p_customer_name           VARCHAR2(240);
     p_customer_id               NUMBER;
     p_currency_code           VARCHAR2(10);
     p_gl_date               DATE;
     p_deposit_date           DATE;
     p_customer_site_use_id           NUMBER;
     p_override_remit_account_flag      VARCHAR2(1);
     p_remittance_bank_account_id      NUMBER;
     p_maturity_date               DATE;
     x_return_status               VARCHAR2(1);
     x_msg_count               NUMBER;
     x_msg_data               VARCHAR2(240);
     p_cr_id                NUMBER;
     p_global_attribute_rec      AR_RECEIPT_API_PUB.global_attribute_rec_type;
     p_attribute_rec           AR_RECEIPT_API_PUB.attribute_rec_type;
BEGIN
     p_amount                := 50; --- same as yours
     p_receipt_number          := 'R-101' --- same as your
     p_receipt_method_id           := 4006 --- same as your
     p_customer_id               := 81795 --- same as your
     p_currency_code           := 'USD'; --- same as your
     p_receipt_date           := SYSDATE;
     p_gl_date               := SYSDATE;
     p_deposit_date           := SYSDATE;
     p_customer_site_use_id           := 1017; ---change this
     p_override_remit_account_flag      := 'Y';
     p_remittance_bank_account_id      := '10001'; --- change this
     p_maturity_date               := SYSDATE+100;
AR_RECEIPT_API_PUB.Create_cash (
     p_api_version      => 1.0                    
     ,p_init_msg_list      => FND_API.G_FALSE
     ,p_commit      => FND_API.G_FALSE
          ,p_validation_level          => FND_API.G_VALID_LEVEL_FULL
          ,p_usr_currency_code          => p_usr_currency_code
          ,p_currency_code           => p_currency_code
,p_usr_exchange_rate_type      => p_usr_exchange_rate_type
,p_exchange_rate_type      => p_exchange_rate_type
,p_exchange_rate           => p_exchange_rate
,p_exchange_rate_date      => p_exchange_rate_date
,p_amount      => p_amount
,p_factor_discount_amount      => p_factor_discount_amount
,p_receipt_number      => p_receipt_number
,p_receipt_date      => p_receipt_date
,p_gl_date      => p_gl_date
,p_maturity_date      => p_maturity_date
,p_postmark_date      => p_postmark_date
,p_customer_id      => p_customer_id
,p_customer_name      => p_customer_name
,p_customer_number      => p_customer_number
,p_customer_bank_account_id      => p_customer_bank_account_id
,p_customer_bank_account_num      => p_customer_bank_account_num
,p_customer_bank_account_name      => p_customer_bank_account_name
,p_location      => p_location
,p_customer_site_use_id      => p_customer_site_use_id
          ,p_customer_receipt_reference      => p_customer_receipt_reference
,p_override_remit_account_flag     => p_override_remit_account_flag
,p_remittance_bank_account_id      => p_remittance_bank_account_id
,p_remittance_bank_account_num     => p_remittance_bank_account_num
,p_remittance_bank_account_name => p_remittance_bank_account_name
,p_deposit_date      => p_deposit_date
,p_receipt_method_id      => p_receipt_method_id
,p_receipt_method_name      => p_receipt_method_name
,p_doc_sequence_value      => p_doc_sequence_value
,p_ussgl_transaction_code      => p_ussgl_transaction_code
,p_anticipated_clearing_date      => p_anticipated_clearing_date
,p_called_from      => p_called_from
          ,p_global_attribute_rec      => p_global_attribute_rec
          ,p_attribute_rec          => p_attribute_rec
          ,p_comments               => p_comments
          ,p_issuer_name      => p_issuer_name
,p_issue_date      => p_issue_date
,p_issuer_bank_branch_id      => p_issuer_bank_branch_id
     ,x_return_status      => x_return_status
     ,x_msg_count      => x_msg_count
     ,x_msg_data      => x_msg_data
          ,p_cr_id               => p_cr_id                                                  
IF (x_return_status = 'S') THEN
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_cr_id                = '||p_cr_id);
ELSE
ROLLBACK;
dbms_output.put_line('Return Status     = '|| SUBSTR (x_return_status,1,255));
dbms_output.put_line('Message Count      = '|| TO_CHAR(x_msg_count ));
dbms_output.put_line('Message Data     = '|| SUBSTR (x_msg_data,1,255));
dbms_output.put_line(APPS.FND_MSG_PUB.Get ( p_msg_index => APPS.FND_MSG_PUB.G_LAST,
p_encoded => APPS.FND_API.G_FALSE));
IF x_msg_count >=0 THEN
     FOR I IN 1..10 LOOP
          dbms_output.put_line(I||'. '|| SUBSTR (FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
     END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Exception :'||sqlerrm);
END;
COMMIT;
SPOOL off;

Similar Messages

  • Error while creating a Foreign Currency Receipt using Create_Cash API

    Hi,
    I am working on AR Receipts converison in R12 and trying to create cash receipts using AR_RECEIPT_API_PUB.CREATE_CASH.
    Receipt gets created successfully when the currency_code is USD. Receipt Method i am passing is 'Manual Receipt'.
    When the currency_code is not USD (EUR in my case), I am passing the values for p_exchange_rate_type and p_exchange_rate_date.
    But the API Errors out without creating the foreign currency receipt giving the Error: AR_RAPI_RCT_MD_NAME_INVALID.
    When i was trying to look at the API for this error, I dont see this error at all in the API. I see an error with the name 'AR_RAPI_RCPT_MD_NAME_INVALID' but nothing shows up for the error 'AR_RAPI_RCT_MD_NAME_INVALID' ('P' missing in 'RCPT'). I dont know where this error is getting invoked from?
    I am not sure why the API is erroring out for foreign currency receipt saying Receipt Method Name is Invalid. But it works fine for currency_code USD having the same Receipt Method Name.
    Any help would be highly appreciated.
    Thanks in advance.
    Regards,
    Kesava

    Hi Anil,
    Thankyou so much for the response. The issue has been fixed.
    There was a configuration missing on the existing bank account setup. On the Account Information Tab, ‘Multiple Currencies Allowed’ was checked, but on the Account Controls Tab, Receivables Controls/’Multiple Currency Receipts’ was not checked.
    I have ensured that both of them are checked and I am now able to create multiple currency receipts.
    Appreciate your help.
    Thanks,
    Kesava Chunduri

  • CREATE_CASH : ORA-29282: invalid file ID

    While running the AR_RECEIPT_API_PUB.create_and_apply to create and apply a receipt in R12, i get the error:
    Message 1. CREATE_CASH : ORA-29282: invalid file ID
    Message 2. ORA-29282: invalid file ID in Package AR_RECEIPT_API_PUB Procedure Create_cash
    DECLARE
    l_return_status VARCHAR2(1);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(240);
    l_cash_receipt_id NUMBER;
    p_count number := 0;
    BEGIN
    -- 1) Set the applications context
    mo_global.init('AR');
    mo_global.set_policy_context('S','83');
    fnd_global.apps_initialize(1303, 50695, 222,0);
    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 => 1309.6,
    p_receipt_number => 'TIENDA-api2',
    p_receipt_date => '22-JUL-2012',
    p_gl_date => '22-JUL-2012',
    p_customer_number => 1007,
    p_receipt_method_id => 1000,
    p_trx_number => '145996',
    p_cr_id => l_cash_receipt_id );
    -- 3) Review the API output
    dbms_output.put_line('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;
    END;

    Please see these docs.
    Oracle Receivables Reference Guide Release 12 [ID 1077107.1]
    Oracle Receivables: Receipts API Known Issues and Patches [ID 1362066.1]
    Oracle Receivables: Receipts API Overview, Setup, Sample Scripts and Troubleshooting [ID 1361075.1]
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=AR_RECEIPT_API_PUB&c_owner=APPS&c_type=PACKAGE
    https://forums.oracle.com/forums/search.jspa?threadID=&q=AR_RECEIPT_API_PUB.create_and_apply&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • CREATE_CASH : ORA-01403: no data found

    While running the AR_RECEIPT_API_PUB.CREATE_CASH to create a receipt with Receipt method of automatic receipt class in R12, i get the error:
    .CREATE_CASH : ORA-01403: no data found
    .ORA-01403: no data found in Package AR_RECEIPT_API_PUB Procedure Create_cash
    The same code works perfectly when choosing a receipt method of Manual class. Also for the automatic type methos, receipts are getting created from the front end. Please advise.
    The sample code:
    AR_RECEIPT_API_PUB.CREATE_CASH(
    P_API_VERSION=> 1.0,
    P_INIT_MSG_LIST=> FND_API.G_TRUE,
    P_COMMIT => FND_API.G_FALSE,
    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 => 'CAD',
    P_AMOUNT      => 100,
    P_RECEIPT_NUMBER      => 'Test_Rishi23-8',
    P_RECEIPT_DATE      => sysdate-1,
    P_GL_DATE      => sysdate-1,
    P_MATURITY_DATE => sysdate-1,
    P_CUSTOMER_ID      => '15187',--cust_acct
    P_CUSTOMER_BANK_ACCOUNT_ID =>'5991',--cust_acct
    p_payment_trxn_extension_id => 4001,
    P_REMITTANCE_BANK_ACCOUNT_ID => '1000556',
    P_DEPOSIT_DATE      => sysdate-1,
    P_RECEIPT_METHOD_ID      => '7003',
    p_called_from      => 'PL/SQL Script',
    p_comments      => 'PAD receipt',
    p_cr_id      => l_cr_id);
    DBMS_OUTPUT.PUT_LINE(L_RETURN_STATUS);
    DBMS_OUTPUT.PUT_LINE(L_MSG_DATA);
    LOOP
    l_count := l_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( L_COUNT ||'.'||L_MSG_DATA);
    END LOOP;
    end;

    Please see these docs.
    Ora-01403: No Data Found In Package AR_RECEIPT_API_PUB [ID 459469.1]
    Receipts API Issue: Receipts is Not Created When REMITTANCE_BANK_ACCOUNT_NUM is Passed Instead of REMITTANCE_BANK_ACCOUNT_ID [ID 1323301.1]
    Oracle Receivables: Receipts API Known Issues and Patches [ID 1362066.1]
    Netting Batch Completes In Error when Adding Trading Partner In Inactive Relationship [ID 1315186.1]
    Thanks,
    Hussein

  • Unable to Rollback transactions while using AR_RECEIPT_API_PUB.CREATE_CASH

    Hi,
    I am working on AR Receipts converison in R12 and trying to create cash receipts using AR_RECEIPT_API_PUB.CREATE_CASH.
    As per my data file there are 3 receipts that can be created successfully, but 1 receipt that has a couple of errors.
    I dont want even a single receipt to be created in case any record in my data file fails.
    I am passing the value fnd_api.g_false to the parameter p_commit. Still this doesn't help me to achieve what i require.
    3 Receipts are automatically created, without issuing an external commit and 1 record/receipt failed with error.
    Could you please help me with a solution on how to achieve this??? Appreciate your help.
    Thanks in advance.
    Regards,
    Kesava

    Hi,
    I myself have figured out the problem.
    I have digged in to the API Code and have found that FND_API.G_FALSE is case sensitive. I was passing it in lowercase earlier due to which the problem has arised.
    It heps if we pass the value FND_API.G_FALSE in uppercase (or) even if we ignore that value it is fine as it is defaulting to the same.
    Thanks,
    Kesava Chunduri

  • Use ar_receipt_api_pub create_cash API across multiple oper units

    Hi,
    I have a requirement to create AR receipts across multiple operating units and I am using the AR_RECEIPT_API_PUB's create_cash() to do that. The APIs work fine and I can create receipt in oper unit A. But when I changed to a different operating unit B and call the API, it terminated with NO_DATA_FOUND error.
    If I run my same code with operating unit B and then oper unit A, it created receipts in oper unit B but returned NO_DATA_FOUND in oper unit A. That way I confirmed there is no set-up issues with both oper units.
    I tried following 4 different ways to switch to different operating unit but all resulted in NO_DATA_FOUND:
    1) mo_global.init('AR');
    2) mo_global.init('AR'); fnd_client_info.set_org_context(&org_id>);
    3) mo_global.init('AR'); mo_global.set_policy_context('M', &org_id) ;
    4) mo_global.init('AR'); mo_global.set_policy_context('S', &org_id) ; (My EBS set-up has multi oper units, but I tried 'S' flag because of lack of ideas)
    Please help. Thanks!
    Mike.

    @MikeLi,
    Did you find any solution for this problem? We are facing this problem on R12 while creating AR receipts across multiple operating units. We will be glad if you share the solution. We have tried all possible ways; but did not help. When we look at the mo_glob_org_access_tmp ; we have access to all organizations; but the api returns 'no data found'
    Thanks.

  • R12 Ar_receipt_api_pub.Create_cash API error

    According to Oracle Receivables Reference Guide
    Try to test the API : Ar_receipt_api_pub.Create_cash , failed with error message
    Test code :
    declare
    -- Local variables here
    l_cr_id integer;
    l_msg_count integer;
    l_msg_data varchar2(200);
    l_msg_data_out varchar2(200);
    l_count integer;
    l_return_status varchar2(20);
    begin
    fnd_global.apps_initialize (user_id => 1318,resp_id =>50559,resp_appl_id => 222);
    -- Test statements here
    Ar_receipt_api_pub.Create_cash(
    p_api_version => 1.0,
    p_init_msg_list => FND_API.G_TRUE,
    p_receipt_number => 'aj_test_api_1',
    p_amount => 1000,
    p_receipt_method_id => 1001,
    p_customer_name => 'Computer Service and Rentals',
    p_cr_id => l_cr_id,
    x_return_status => l_return_status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data);
    IF l_msg_count = 1 Then
    --there is one message raised by the API, so it has been sent out
    --in the parameter x_msg_data, get it.
    dbms_output.put_line('l_msg_data '||l_msg_data);
    ELSIF l_msg_count > 1 Then
    --the messages on the stack are more than one so call them in a loop
    -- and put the messages in a PL/SQL table.
    LOOP
    IF nvl(l_count,0) < l_msg_count THEN
    l_count := nvl(l_count,0) +1 ;
    l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
    IF l_count = 1 THEN
    dbms_output.put_line('l_msg_data 1 '||l_msg_data);
    ELSIF l_count = 2 THEN
    dbms_output.put_line('l_msg_data 2 '||l_msg_data);
    ELSIF l_count = 3 THEN
    dbms_output.put_line('l_msg_data 3 '||l_msg_data);
    ELSIF l_count = 4 THEN
    dbms_output.put_line('l_msg_data 4 '||l_msg_data);
    ELSIF l_count = 5 THEN
    dbms_output.put_line('l_msg_data 5 '||l_msg_data);
    ELSIF l_count = 6 THEN
    dbms_output.put_line('l_msg_data 6 '||l_msg_data);
    END IF;
    dbms_output.put_line('l_msg_data
    '||to_char(l_count)||': '||l_msg_data);
    ELSE
    EXIT;
    END IF;
    END LOOP;
    END IF;
    Commit;
    end;
    Output:
    l_msg_data 1 Functional currency defaulted as the receipt currency.
    l_msg_data
    1: Functional currency defaulted as the receipt currency.
    l_msg_data 2 Please correct the cash account assignment.
    l_msg_data
    2: Please correct the cash account assignment.
    l_msg_data 3 The entered values for the descriptive flexfield AR_CASH_RECEIPTS is invalid.
    l_msg_data
    3: The entered values for the descriptive flexfield AR_CASH_RECEIPTS is invalid.
    l_msg_data 4 CREATE_CASH : ORA-06502: PL/SQL: 数字或值错误
    l_msg_data
    4: CREATE_CASH : ORA-06502: PL/SQL: 数字或值错误
    l_msg_data 5 ORA-06502: PL/SQL: 数字或值错误 in Package AR_RECEIPT_API_PUB Procedure Create_cash
    l_msg_data
    5: ORA-06502: PL/SQL: 数字或值错误 in Package AR_RECEIPT_API_PUB Procedure Create_cash

    Message 1: Put the currency in the API parameter (Name: p_currency_code)
    Message 2: Check Oracle Support Note 946902.1 (disable segment value, but CCID is active????)
    Message 3: Context Field for Descriptive Flexfield 'Receipt Information' has a Default Value, but the Context Field Value for that default value is disabled, see Oracle Support Note 956214.1

  • AR_RECEIPT_API_PUB.Create_cash API error

    Hello all
    apps version 11.5
    This is the first time for me to load data via API I'm using the API called AR_RECEIPT_API_PUB.Create_cash
    with this syntax
    DECLARE
    p_api_version NUMBER;
    p_init_msg_list VARCHAR2(240);
    p_commit VARCHAR2(240);
    p_validation_level NUMBER;
    p_usr_currency_code VARCHAR2(240);
    p_usr_exchange_rate_type VARCHAR2(240);
    p_exchange_rate_type VARCHAR2(240);
    p_exchange_rate NUMBER;
    p_exchange_rate_date DATE;
    p_factor_discount_amount NUMBER;
    p_receipt_date DATE;
    p_postmark_date DATE;
    p_customer_number VARCHAR2(240);
    p_customer_bank_account_id NUMBER;
    p_customer_bank_account_num VARCHAR2(240);
    p_customer_bank_account_name VARCHAR2(240);
    p_location VARCHAR2(240);
    p_customer_receipt_reference VARCHAR2(240);
    p_remittance_bank_account_num VARCHAR2(240);
    p_remittance_bank_account_name VARCHAR2(240);
    p_receipt_method_name VARCHAR2(240);
    p_doc_sequence_value NUMBER;
    p_ussgl_transaction_code VARCHAR2(240);
    p_anticipated_clearing_date DATE;
    p_called_from VARCHAR2(240);
    p_comments VARCHAR2(240);
    p_issuer_name VARCHAR2(240);
    p_issue_date DATE;
    p_issuer_bank_branch_id NUMBER;
    p_amount NUMBER;
    p_receipt_number VARCHAR2(240);
    p_receipt_method_id NUMBER;
    p_customer_name VARCHAR2(240);
    p_customer_id NUMBER;
    p_currency_code VARCHAR2(10);
    p_gl_date DATE;
    p_deposit_date DATE;
    p_customer_site_use_id NUMBER;
    p_override_remit_account_flag VARCHAR2(1);
    p_remittance_bank_account_id NUMBER;
    p_maturity_date DATE;
    x_return_status VARCHAR2(1);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(240);
    p_cr_id NUMBER;
    p_global_attribute_rec AR_RECEIPT_API_PUB.global_attribute_rec_type;
    p_attribute_rec AR_RECEIPT_API_PUB.attribute_rec_type;
    BEGIN
    p_amount := 500; --- same as yours
    p_receipt_number := '123789456'; --- same as your
    p_receipt_method_id := 1001; --- same as your
    p_customer_id := 4046 ;--- same as your
    p_currency_code := 'EGP';
    p_receipt_date := to_date('30-06-2012','dd-mm-yyyy');
    p_gl_date := to_date('30-06-2012','dd-mm-yyyy');
    p_deposit_date := to_date('01-07-2012','dd-mm-yyyy');
    p_customer_site_use_id := 1084; ---change this
    p_override_remit_account_flag := 'Y';
    p_remittance_bank_account_id := '10013'; --- change this
    p_maturity_date := to_date('01-07-2012','dd-mm-yyyy');
    AR_RECEIPT_API_PUB.Create_cash (
    p_api_version => 1.0
    ,p_init_msg_list => FND_API.G_FALSE
    ,p_commit => FND_API.G_FALSE
    ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
    ,p_usr_currency_code => p_usr_currency_code
    ,p_currency_code => p_currency_code
    ,p_usr_exchange_rate_type => p_usr_exchange_rate_type
    ,p_exchange_rate_type => p_exchange_rate_type
    ,p_exchange_rate => p_exchange_rate
    ,p_exchange_rate_date => p_exchange_rate_date
    ,p_amount => p_amount
    ,p_factor_discount_amount => p_factor_discount_amount
    ,p_receipt_number => p_receipt_number
    ,p_receipt_date => p_receipt_date
    ,p_gl_date => p_gl_date
    ,p_maturity_date => p_maturity_date
    ,p_postmark_date => p_postmark_date
    ,p_customer_id => p_customer_id
    ,p_customer_name => p_customer_name
    ,p_customer_number => p_customer_number
    ,p_customer_bank_account_id => p_customer_bank_account_id
    ,p_customer_bank_account_num => p_customer_bank_account_num
    ,p_customer_bank_account_name => p_customer_bank_account_name
    ,p_location => p_location
    ,p_customer_site_use_id => p_customer_site_use_id
    ,p_customer_receipt_reference => p_customer_receipt_reference
    ,p_override_remit_account_flag => p_override_remit_account_flag
    ,p_remittance_bank_account_id => p_remittance_bank_account_id
    ,p_remittance_bank_account_num => p_remittance_bank_account_num
    ,p_remittance_bank_account_name => p_remittance_bank_account_name
    ,p_deposit_date => p_deposit_date
    ,p_receipt_method_id => p_receipt_method_id
    ,p_receipt_method_name => p_receipt_method_name
    ,p_doc_sequence_value => p_doc_sequence_value
    ,p_ussgl_transaction_code => p_ussgl_transaction_code
    ,p_anticipated_clearing_date => p_anticipated_clearing_date
    ,p_called_from => p_called_from
    ,p_global_attribute_rec => p_global_attribute_rec
    ,p_attribute_rec => p_attribute_rec
    ,p_comments => p_comments
    ,p_issuer_name => p_issuer_name
    ,p_issue_date => p_issue_date
    ,p_issuer_bank_branch_id => p_issuer_bank_branch_id
    ,x_return_status => x_return_status
    ,x_msg_count => x_msg_count
    ,x_msg_data => x_msg_data
    ,p_cr_id => p_cr_id
    COMMIT;
    END;
    i'm getting this error
    Error at line 1
    ORA-20000: APP-11219: Please set the Receivables system options for this operating unit and ensure that the MO: Operating Unit profile option is correctly set with an operating unit that is set up in Receivables.
    ORA-06512: at "APPS.ARP_STANDARD", line 1169
    ORA-06512: at "APPS.ARP_STANDARD", line 2688
    ORA-06512: at "APPS.ARP_STANDARD", line 2697
    ORA-06512: at "APPS.ARP_UTIL", line 30
    ORA-06512: at "APPS.AR_RECEIPT_API_PUB", line 7515
    ORA-06512: at line 68
    i've checked that Receivables system options for this operating unit and ensure that the MO: Operating Unit profile option is correctly set with an operating unit that is set up in Receivables.
    but i still have the same error.
    Respectfully
    khaled Farouk

    hello all
    I've solved this isseu it needed to run this code before calling the api
    sys.dbms_application_info.set_client_info(client_info => v_client_info);
    fnd_global.APPS_INITIALIZE(user_id=>0,resp_id=>50430,resp_appl_id=>222);
    to be like that
    DECLARE
    V_sqlerrm VARCHAR2(500);
    test1 varchar2(500);
    v_client_info VARCHAR2(500) :='102';
    p_api_version NUMBER;
    p_init_msg_list VARCHAR2(240);
    p_commit VARCHAR2(240);
    p_validation_level NUMBER;
    p_usr_currency_code VARCHAR2(240);
    p_usr_exchange_rate_type VARCHAR2(240);
    p_exchange_rate_type VARCHAR2(240);
    p_exchange_rate NUMBER;
    p_exchange_rate_date DATE;
    p_factor_discount_amount NUMBER;
    p_receipt_date DATE;
    p_postmark_date DATE;
    p_customer_number VARCHAR2(240);
    p_customer_bank_account_id NUMBER;
    p_customer_bank_account_num VARCHAR2(240);
    p_customer_bank_account_name VARCHAR2(240);
    p_location VARCHAR2(240);
    p_customer_receipt_reference VARCHAR2(240);
    p_remittance_bank_account_num VARCHAR2(240);
    p_remittance_bank_account_name VARCHAR2(240);
    p_receipt_method_name VARCHAR2(240);
    p_doc_sequence_value NUMBER;
    p_ussgl_transaction_code VARCHAR2(240);
    p_anticipated_clearing_date DATE;
    p_called_from VARCHAR2(240);
    p_comments VARCHAR2(240);
    p_issuer_name VARCHAR2(240);
    p_issue_date DATE;
    p_issuer_bank_branch_id NUMBER;
    p_amount NUMBER;
    p_receipt_number VARCHAR2(240);
    p_receipt_method_id NUMBER;
    p_customer_name VARCHAR2(240);
    p_customer_id NUMBER;
    p_currency_code VARCHAR2(10);
    p_gl_date DATE;
    p_deposit_date DATE;
    p_customer_site_use_id NUMBER;
    p_override_remit_account_flag VARCHAR2(1);
    p_remittance_bank_account_id NUMBER;
    p_maturity_date DATE;
    x_return_status VARCHAR2(1);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(240);
    p_cr_id NUMBER;
    p_global_attribute_rec AR_RECEIPT_API_PUB.global_attribute_rec_type;
    p_attribute_rec AR_RECEIPT_API_PUB.attribute_rec_type;
    BEGIN
    v_client_info := '102';
    sys.dbms_application_info.set_client_info(client_info => v_client_info);
    fnd_global.APPS_INITIALIZE(user_id=>0,resp_id=>50430,resp_appl_id=>222);
    declare cursor abc is
    select CUSTOMER_NUMBER ,CUSTOMER_ID , AMOUNT , RECEIPT_NUMBER , customer_site_use_id from X_RECEIPT
    --where RECEIPT_NUMBER<>'2881578'
    begin
    for i in abc loop
    p_amount := i.AMOUNT; --- same as yours
    p_receipt_number := i.RECEIPT_NUMBER; --- same as your
    p_receipt_method_id := 1001; --- same as your --- checks
    --select statment to get the customer_id
    p_customer_id := i.CUSTOMER_ID; --- same as your------------------kkkkkkkkkkkkkkkkkkkkkkkkkk
    p_currency_code := 'EGP'; --- same as your
    p_receipt_date := to_date('30-06-2012', 'dd-mm-yyyy');
    p_gl_date := to_date('30-06-2012', 'dd-mm-yyyy');
    p_deposit_date := to_date('01-07-2012', 'dd-mm-yyyy');
    p_customer_site_use_id := i.customer_site_use_id; ---change this
    p_override_remit_account_flag := 'Y';
    p_remittance_bank_account_id := '10013'; --- change this
    p_maturity_date := to_date('01-07-2012', 'dd-mm-yyyy');
    p_amount := 55558888.333; --- same as yours
    p_receipt_number := '123456'; --- same as your
    p_receipt_method_id := 1001; --- same as your --- checks
    --select statment to get the customer_id
    p_customer_id := 2045; --- same as your------------------kkkkkkkkkkkkkkkkkkkkkkkkkk
    p_currency_code := 'EGP'; --- same as your
    p_receipt_date := to_date('30-06-2012', 'dd-mm-yyyy');
    p_gl_date := to_date('30-06-2012', 'dd-mm-yyyy');
    p_deposit_date := to_date('01-07-2012', 'dd-mm-yyyy');
    p_customer_site_use_id := 1060; ---change this
    p_override_remit_account_flag := 'Y';
    p_remittance_bank_account_id := '10013'; --- change this
    p_maturity_date := to_date('01-07-2012', 'dd-mm-yyyy');*/
    AR_RECEIPT_API_PUB.Create_cash (
    p_api_version => 1.0
    ,p_init_msg_list => FND_API.G_FALSE
    ,p_commit => FND_API.G_FALSE
    ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
    ,p_usr_currency_code => p_usr_currency_code
    ,p_currency_code => p_currency_code
    ,p_usr_exchange_rate_type => p_usr_exchange_rate_type
    ,p_exchange_rate_type => p_exchange_rate_type
    ,p_exchange_rate => p_exchange_rate
    ,p_exchange_rate_date => p_exchange_rate_date
    ,p_amount => p_amount
    ,p_factor_discount_amount => p_factor_discount_amount
    ,p_receipt_number => p_receipt_number
    ,p_receipt_date => p_receipt_date
    ,p_gl_date => p_gl_date
    ,p_maturity_date => p_maturity_date
    ,p_postmark_date => p_postmark_date
    ,p_customer_id => p_customer_id
    ,p_customer_name => p_customer_name
    ,p_customer_number => p_customer_number
    ,p_customer_bank_account_id => p_customer_bank_account_id
    ,p_customer_bank_account_num => p_customer_bank_account_num
    ,p_customer_bank_account_name => p_customer_bank_account_name
    ,p_location => p_location
    ,p_customer_site_use_id => p_customer_site_use_id
    ,p_customer_receipt_reference => p_customer_receipt_reference
    ,p_override_remit_account_flag => p_override_remit_account_flag
    ,p_remittance_bank_account_id => p_remittance_bank_account_id
    ,p_remittance_bank_account_num => p_remittance_bank_account_num
    ,p_remittance_bank_account_name => p_remittance_bank_account_name
    ,p_deposit_date => p_deposit_date
    ,p_receipt_method_id => p_receipt_method_id
    ,p_receipt_method_name => p_receipt_method_name
    ,p_doc_sequence_value => p_doc_sequence_value
    ,p_ussgl_transaction_code => p_ussgl_transaction_code
    ,p_anticipated_clearing_date => p_anticipated_clearing_date
    ,p_called_from => p_called_from
    ,p_global_attribute_rec => p_global_attribute_rec
    ,p_attribute_rec => p_attribute_rec
    ,p_comments => p_comments
    ,p_issuer_name => p_issuer_name
    ,p_issue_date => p_issue_date
    ,p_issuer_bank_branch_id => p_issuer_bank_branch_id
    ,x_return_status => x_return_status
    ,x_msg_count => x_msg_count
    ,x_msg_data => x_msg_data
    ,p_cr_id => p_cr_id
    COMMIT;
    --delete from X ;
    commit;
    test1 := APPS.FND_MSG_PUB.Get ( p_msg_index => APPS.FND_MSG_PUB.G_LAST,p_encoded => APPS.FND_API.G_FALSE);
    INSERT INTO X VALUES('Return Status = '|| x_return_status||test1);
    --APPS.FND_MSG_PUB.Get ( p_msg_index => APPS.FND_MSG_PUB.G_LAST,p_encoded => APPS.FND_API.G_FALSE)
    COMMIT;
    --IF (x_return_status = 'S') THEN
    -- COMMIT;
    -- --INSERT INTO X VALUES('SUCCESS  : Return Status = '|| SUBSTR (x_return_status,1,255)||'Message Count = '||x_msg_count);
    -- --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_cr_id = '||p_cr_id);
    --ELSE
    -- dbms_output.put_line('Return Status = '|| SUBSTR (x_return_status,1,255));
    -- dbms_output.put_line('Message Count = '|| TO_CHAR(x_msg_count ));
    -- dbms_output.put_line('Message Data = '|| SUBSTR (x_msg_data,1,255));
    -- dbms_output.put_line(APPS.FND_MSG_PUB.Get ( p_msg_index => APPS.FND_MSG_PUB.G_LAST,p_encoded => APPS.FND_API.G_FALSE));
    -- IF x_msg_count >=0 THEN
    -- FOR I IN 1..10 LOOP
    -- dbms_output.put_line(I||'. '|| SUBSTR (FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
    -- END LOOP;
    -- END IF;
    --END IF;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    V_sqlerrm := sqlerrm;
    INSERT INTO X VALUES('Exception :'||V_sqlerrm);
    COMMIT;
    dbms_output.put_line('Exception :'||sqlerrm);
    end;
    EXCEPTION
    WHEN OTHERS THEN
    V_sqlerrm := sqlerrm;
    INSERT INTO X VALUES('Exception :'||V_sqlerrm);
    COMMIT;
    dbms_output.put_line('Exception :'||sqlerrm);
    END;

  • Getting Error - CREATE_CASH : ORA-01403: no data found

    When i use api AR_RECEIPT_API_PUB.CREATE_CASH in loop then i get error 'CREATE_CASH : ORA-01403: no data found' for second record.
    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_receipt_number => i_receipt_number
    ,p_receipt_date => TRUNC(SYSDATE)
    ,p_gl_date => TRUNC(SYSDATE)
    ,p_amount => i_receipt_amount
    ,p_currency_code => g_currency_code
    ,p_receipt_method_id => i_receipt_method_id
    ,p_customer_id => i_customer_id
    ,p_cr_id => l_cr_id
    ,p_org_id => i_org_id
    ,x_return_status => l_return_status
    ,x_msg_count => l_msg_count
    ,x_msg_data => l_msg_data
    I run it for different org. First org it's running fine but for second it's fail -
    Here is output -
    Start, Org ID - 84
    l_receipt_number - 43164
    l_receipt_amount - 74.55
    g_currency_code - USD
    l_receipt_method_id - 4000
    l_customer_id - 7040
    l_cr_id -
    l_return_status -
    l_msg_count -
    l_msg_data -
    Status - S
    Start, Org ID - 81
    l_receipt_number - 43166
    l_receipt_amount - 30
    g_currency_code - USD
    l_receipt_method_id - 4000
    l_customer_id - 7047
    l_cr_id -
    l_return_status -
    l_msg_count -
    l_msg_data -
    Error count/msg - 2-
    Error msg - CREATE_CASH : ORA-01403: no data found
    Error msg - ORA-01403: no data found in Package AR_RECEIPT_API_PUB Procedure Create_cash
    PLease help it's urgent

    Here is code which i am using...
    IF l_ar_pay_rec > 0 THEN
    l_receipt_number := ar_cash_receipts_s.NEXTVAL;
    FOR r_ar_org_records IN cr_ar_org_records
    LOOP
    IF r_ar_org_records.org_id = 81 THEN
    l_resp_id := 50677;
    ELSE
    l_resp_id := 50681;
    END IF;
    MO_GLOBAL.INIT('AR');
    MO_GLOBAL.SET_POLICY_CONTEXT('S',r_ar_org_records.org_id);
    FND_GLOBAL.APPS_INITIALIZE(g_user_id,l_resp_id,l_appl_id,0);
    DBMS_OUTPUT.PUT_LINE('User,Resp,App,Org - '||g_user_id||','||l_resp_id||','||l_appl_id||','||r_ar_org_records.org_id);
    -- Derive Receipt Method ID
    BEGIN
    SELECT receipt_method_id
    INTO l_receipt_method_id
    FROM ar_receipt_methods
    WHERE name = g_receipt_method;
    EXCEPTION
    WHEN OTHERS THEN
    g_ar_error := 'Y';
    g_ar_error_msg := g_ar_error_msg||'Receipet Method Not Found, ';
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Error While Derive Receipt Method ID');
    END;
    -- Derive Customer ID
    BEGIN
    SELECT customer_id
    ,SUM(AMOUNT_PAID)
    INTO l_customer_id
    ,l_receipt_amount
    FROM xxar_third_party_validation
    WHERE raf_code = i_raf
    AND receipt_date = i_date_paid
    AND org_id = r_ar_org_records.org_id
    AND customer_id is not null
    GROUP BY customer_id;
    EXCEPTION
    WHEN OTHERS THEN
    g_ar_error := 'Y';
    g_ar_error_msg := g_ar_error_msg||' Customer ID Not Found, ';
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Error While Customer ID');
    END;
    fnd_msg_pub.initialize;
    l_return_status := NULL;
    l_msg_count := NULL;
    l_msg_data := NULL;
    l_cr_id := NULL;
    g_currency_code := 'USD';
    DBMS_OUTPUT.PUT_LINE('Start, Org ID - '||r_ar_org_records.org_id);
    -- Create Cash for Customer
    DBMS_OUTPUT.PUT_LINE('l_receipt_number - '||l_receipt_number);
    DBMS_OUTPUT.PUT_LINE('l_receipt_amount - '||l_receipt_amount);
    DBMS_OUTPUT.PUT_LINE('g_currency_code - '||g_currency_code);
    DBMS_OUTPUT.PUT_LINE('l_receipt_method_id - '||l_receipt_method_id);
    DBMS_OUTPUT.PUT_LINE('l_customer_id - '||l_customer_id);
    DBMS_OUTPUT.PUT_LINE('l_cr_id - '||l_cr_id);
    DBMS_OUTPUT.PUT_LINE('l_return_status - '||l_return_status);
    DBMS_OUTPUT.PUT_LINE('l_msg_count - '||l_msg_count);
    DBMS_OUTPUT.PUT_LINE('l_msg_data - '||l_msg_data);
    AR_RECEIPT_API_PUB.CREATE_CASH(p_api_version => 1.0
    ,p_init_msg_list => fnd_api.g_true
    ,p_receipt_number => l_receipt_number
    ,p_receipt_date => TRUNC(SYSDATE)
    ,p_gl_date => TRUNC(SYSDATE)
    ,p_amount => l_receipt_amount
    ,p_currency_code => g_currency_code
    ,p_receipt_method_id => l_receipt_method_id
    ,p_customer_id => l_customer_id
    ,p_cr_id => l_cr_id
    ,p_org_id => r_ar_org_records.org_id
    ,x_return_status => l_return_status
    ,x_msg_count => l_msg_count
    ,x_msg_data => l_msg_data
    DBMS_OUTPUT.PUT_LINE('Status - '||l_return_status);
    IF l_return_status <> 'S' THEN
    g_ar_error := 'Y';
    DBMS_OUTPUT.PUT_LINE('Error count/msg - '||l_msg_count||'-'||l_msg_data);
    IF l_msg_count = 1 THEN
    g_ar_error_msg := g_ar_error_msg||l_msg_data;
    DBMS_OUTPUT.PUT_LINE('Error msg - '||l_msg_data);
    ELSIF l_msg_count > 1 THEN
    LOOP
    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;
    g_ar_error_msg := g_ar_error_msg||l_msg_data;
    DBMS_OUTPUT.PUT_LINE('Error msg - '||l_msg_data);
    END LOOP;
    END IF;
    xxar_log_error(r_ar_org_records.record_id,SUBSTR(g_ar_error_msg,1,120));
    ELSE
    DBMS_OUTPUT.PUT_LINE('Status - '||l_return_status);
    FOR r_ar_records IN cr_ar_records(r_ar_org_records.org_id)
    LOOP
    fnd_msg_pub.initialize;
    l_return_status := NULL;
    l_msg_count := NULL;
    l_msg_data := NULL;
    l_cr_id := NULL;
    l_receipt_amount := r_ar_records.amount_paid;
    l_trx_number := r_ar_records.transaction_number;
    g_currency_code := r_ar_records.currency_code;
    l_receipt_date := SYSDATE;
    l_gl_date := SYSDATE;
    -- Apply payments for the RAF and Date Paid
    AR_RECEIPT_API_PUB.APPLY(p_api_version => 1.0
    ,p_init_msg_list => fnd_api.g_true
    ,p_commit => fnd_api.g_false
    ,x_return_status => l_return_status
    ,x_msg_count => l_msg_count
    ,x_msg_data => l_msg_data
    ,p_receipt_number => l_receipt_number
    ,p_trx_number => l_trx_number
    ,p_amount_applied => l_receipt_amount
    ,p_org_id => r_ar_org_records.org_id
    IF l_return_status <> 'S' THEN
    g_ar_error := 'Y';
    IF l_msg_count = 1 THEN
    g_ar_error_msg := g_ar_error_msg||l_msg_data;
    ELSIF l_msg_count > 1 THEN
    LOOP
    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;
    g_ar_error_msg := g_ar_error_msg||l_msg_data;
    END LOOP;
    END IF;
    xxar_log_error(r_ar_records.record_id,SUBSTR(g_ar_error_msg,1,240));
    ELSE
    DBMS_OUTPUT.PUT_LINE('Sucess 2 - ');
    NULL;
    /* -- Call Adjustment API for Contractual Allowance
    IF NVL(r_ar_records.contractual_allowance_amt,0) > 0 THEN
    xxar_third_party_rcpt_adj(r_ar_records.record_id
    ,r_ar_records.transaction_number
    ,r_ar_records.contractual_allowance_amt
    ,i_user_id
    END IF; */
    END IF;
    END LOOP;
    END IF;
    DBMS_OUTPUT.PUT_LINE('Error Flag AR - '||g_ar_error);
    IF g_ar_error = 'Y' THEN
    xxar_log_error(r_ar_org_records.record_id,SUBSTR(g_ar_error_msg,1,240));
    END IF;
    END LOOP;

  • Numeric or value error in Package AR_RECEIPT_API_PUB Procedure Create_cash

    Hi Everyone,
    I wonder if you can help me as I 'm not sure what I'm missing. I'm trying to create a receipt using the API and getting the error ont the subject. Please see my script below:
    Thanking you in advance for your assistance.
    DECLARE
        p_api_version       NUMBER;
        p_init_msg_list     VARCHAR2(240);
        p_receipt_number    VARCHAR2(30);
        p_amount            NUMBER;
        p_receipt_method_id NUMBER;
        p_customer_number   VARCHAR2(50);   
        p_cr_id             NUMBER(15);
        x_return_status     VARCHAR2(1);
        x_msg_count         NUMBER;
        x_msg_data          VARCHAR2(240);
        l_cash_receipt_id   NUMBER;
        p_currency_code     VARCHAR2(3);
        p_receipt_date      DATE;
        p_gl_date           DATE;
        p_remittance_bank_account_id NUMBER;
    BEGIN
        p_api_version       := 1.0;
        p_init_msg_list     := FND_API.G_TRUE;
        p_receipt_number    := 'NIG001';
        p_amount            := 1000;
        p_receipt_method_id := 1003;
        p_customer_number   := '162617';
        p_cr_id             := p_cr_id;
        x_return_status     := x_return_status;
        x_msg_count         := x_msg_count;
        x_msg_data          := x_msg_data;
        p_currency_code     := 'NGN';
        p_receipt_date      := SYSDATE+45;
        p_gl_date           := SYSDATE+45;
        p_remittance_bank_account_id := 10334;
       fnd_global.apps_initialize(1844,51600,222);
        Ar_receipt_api_pub.Create_cash(
                                        p_api_version       => 1.0,
                                        p_init_msg_list     => FND_API.G_TRUE,
                                        p_receipt_number    => p_receipt_number,   
                                        p_amount            => p_amount,           
                                        p_receipt_method_id => p_receipt_method_id,
                                        p_customer_number   => p_customer_number,    
                                        p_currency_code     => p_currency_code,
                                        p_receipt_date      => p_receipt_date,
                                        p_gl_date           => p_gl_date,
                                        p_cr_id             => p_cr_id,
                                        x_return_status     => x_return_status,
                                        x_msg_count         => x_msg_count,
                                        x_msg_data          => x_msg_data);
    IF (x_return_status = 'S') THEN
       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_cr_id                  = '||p_cr_id);
    ELSE    
       ROLLBACK;
           dbms_output.put_line('Return Status    = '|| SUBSTR (x_return_status,1,255));
           dbms_output.put_line('Message Count    = '|| TO_CHAR(x_msg_count ));
           dbms_output.put_line('Message Data     = '|| SUBSTR (x_msg_data,1,255));
           dbms_output.put_line(APPS.FND_MSG_PUB.Get ( p_msg_index    => APPS.FND_MSG_PUB.G_LAST, p_encoded      => APPS.FND_API.G_FALSE));
       IF x_msg_count >=0 THEN
          FOR I IN 1..10 LOOP
                   dbms_output.put_line(I||'. '|| SUBSTR (FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
          END LOOP;
       END IF;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Exception :'||sqlerrm);
    END;

    First of all: stop swallowing errors!
    Remove this part:
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Exception :'||sqlerrm);and read:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1270688200346183091
    Second: You're better off in the {forum:id=475} Forum.

  • No data found Error in ar_receipts_api.create_cash

    Hi All,
    I am upgrading a package that uses ar_receipt_api from 11i to R12. The package creates receipts for all the orgs. I have set the profile option as follows:
    mo_global.init('AR');
    mo_global.set_policy_context('M','');
    fnd_global.apps_initialize( n_user_id,n_resp_id,n_appl_id,0);
    But the API results in error as below:
    Message 1 : CREATE_CASH : ORA-01403: no data found
    Message 2 : ORA-01403: no data found in Package AR_RECEIPT_API_PUB Procedure Create_cash
    Message 3 : CREATE_CASH : ORA-01403: no data found
    Message 4 : ORA-01403: no data found in Package AR_RECEIPT_API_PUB Procedure Create_cash
    Any suggestions as of what could be missing?
    Also I tried setting the User Profile AR: Debug Level for Lockbox and PostBatch to a bigger number to see the debug messages from the API. But I do not see any kind of messages from API in the log file.
    Is this the correct profile that needs to be used? Kindly advice.
    TIA
    Neeraja

    Small correction: API name is Ar_receipt_api_pub.Create_cash. Below is the code that is used to call the API.
    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 => c_return_status
    ,x_msg_count => n_msg_count
    ,x_msg_data => c_msg_data
    ,p_currency_code => receipt_cre_c.P_USR_CURRENCY_CODE
    ,p_amount => receipt_cre_c.P_AMOUNT
    ,p_receipt_number => receipt_cre_c.P_RECEIPT_NUMBER
    ,p_receipt_date => receipt_cre_c.P_RECEIPT_DATE
    ,p_gl_date => receipt_cre_c.P_RECEIPT_DATE
    ,p_customer_id => n_customer_id
    ,p_customer_site_use_id => n_site_use_id
    ,p_customer_receipt_reference => TRIM(receipt_cre_c.P_CUSTOMER_RECEIPT_REFERENCE)
    ,p_comments => TRIM(receipt_cre_c.P_COMMENTS)
    --,p_remittance_bank_account_num => receipt_cre_c.P_REMITTANCE_BANK_ACCOUNT_NUM
    ,p_remittance_bank_account_id => n_rem_bank_acct_id
    ,p_deposit_date => receipt_cre_c.P_RECEIPT_DATE
    ,p_receipt_method_name => receipt_cre_c.P_RECEIPT_METHOD_NAME
    ,p_cr_id => n_cash_receipt_id
    );

  • Invoking EBusiness Suite APIs from Oracle Data Integrator

    Hi,
    I am using ODI as the data migration tool to load data from oracle legacy application to ebiz.
    Is there any knowledge module available to call oracle Ebusiness APIs?
    Thanks in advance.
    -Santanu

    Thanks for your response.
    In eBusiness we have either open interface table & concurrent program or API. IKM which you have referred those are used for open interface and concurrent program. How to handle APIs where there is no open interface table. For example AR_RECEIPT_API_PUB.CREATE_CASH which is an API and there is no open inetrface table for this.
    Cheers,
    Santanu

  • Applied on account

    Hey Guys,
    I'd like to know the step to apply a receipt on account. Let's say a customer owes $90, but pays $100. How do you add the transactions technically ? I thought about doing this way:
    1. create a receipt using AR_RECEIPT_API_PUB.create_cash
    2. apply the receipt on account using AR_RECEIPT_API_PUB.apply_on_account (with p_amount set to 100)
    Another way that I thought about is:
    1. create a receipt using AR_RECEIPT_API_PUB.create_cash
    2. apply the receipt to the invoice using AR_RECEIPT_API_PUB.apply(with p_amount set to 90)
    3.apply the receipt on account using AR_RECEIPT_API_PUB.apply_on_account (with p_amount set to 10).
    If anybody else knows another way, please let me know .
    Thanks

    Thanks. when I'm on the third step of the second approach, do I pass the same receipt_id that was passed when calling AR_RECEIPT_API_PUB.apply from the 2nd step ? Or do I have to create a new receipt just for the amount of $10 and pass ithe new receipt_id to AR_RECEIPT_API_PUB.apply_on_account ?

  • An alternative to Lockbox

    Hi.
    R12.1.3
    Does AR offer any alternative to processing AR payments other than Lockbox?  Is there an API or some other mechanism?
    Thanks.

    Hi,
    Sure, you can try using AR public APIs. Here are some examples, depending on what you want to do with your receipts.
    ar_receipt_api_pub.create_cash
    ar_receipt_api_pub.apply
    ar_receipt_api_pub.create_apply_on_acc

  • Error In Create Cash Receipt API

    After execution of Create Cash Receipt API i got this error
    "Please correct the cash account assignment"
    Thanks for your help

    Declare
    l_cr_id number;
    l_return_status varchar2(20000);
    l_msg_count number;
    l_msg_data varchar2(20000);
    p_count number;
    begin
    dbms_output.put_line('Start');
    fnd_global.apps_initialize( 1297,20678,222,0);
    arp_standard.enable_debug;
    Ar_receipt_api_pub.Create_cash(
    p_api_version => 1.0,
    p_init_msg_list => FND_API.G_TRUE,
    p_validation_level => FND_API.G_VALID_LEVEL_FULL,
    p_receipt_number => '431',
    p_customer_bank_account_id=>'10024',
    p_amount => 10000,
    p_currency_code=>'QAR',
    p_commit=>FND_API.G_TRUE,
    p_receipt_method_id =>3001,
    p_customer_id => 3043,
    p_called_from => 'BR_FACTORED_WITH_RECOURSE',
    p_receipt_date=>to_date('12-11-2007','dd-mm-yyyy'),
    p_maturity_date=>to_date('12-11-2007','dd-mm-yyyy'),
    p_gl_date=>to_date('30-6-2004','dd-mm-yyyy'),
    p_cr_id => l_cr_id,
    x_return_status => l_return_status,
    x_msg_count => l_msg_count,
    x_msg_data => l_msg_data);
    dbms_output.put_line( l_cr_id || 'l');
    dbms_output.put_line( l_return_status);
    dbms_output.put_line( l_msg_data );
    dbms_output.put_line( 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;
    arp_standard.disable_debug;
    end;

Maybe you are looking for

  • Freight cost of Vendor consignment

    We have supplier sending us consignment goods by a trasnportation company, the transportation compnay charge us the freight cost , we have to pay the freight cost to the transportastoin company, and this cost should be part of the cost of  consignmen

  • How do i convert a pdf file to power point file

    how do i convert a pdf file to power point file

  • Hyp Sys 11.1.1 - Prerequisite Installations (Oracle, IIS 6.0, Sys Req)

    Re: Hyp Sys 11.1.1 - Installation Posted: Apr 12, 2009 2:23 AM in response to: JohnGoodwin Edit Reply okay, per the .pdf, i can have a successful installation having the following O/S: Boot 1 - Linux AS 4.7 Boot 2 - Windows Server 2003 SP1, or Window

  • FI-AA Financial Accounting for investments

    Hallo together, FI-AA Financial Accounting for investments. The useful life is with us a "required field" what is strictly necessary for the calculation of depreciation values ​​an entry. When customizing I can not leave the field empty. The field ne

  • How old is this Mac?

    Is there a way to tell how old this Mac is somewhere in the OS? I want to justify purchasing new ones. Below information is from the system profiler Model Name: Power Mac G5 Quad Model Identifier: PowerMac11,2 Processor Name: PowerPC G5 (1.1) Process