Thursday, September 26, 2013

Api For New Receipt creation 11i


Create Receipt: 


      SET SERVEROUTPUT ON

declare
v_return_status varchar2(32767);
l_msg_count varchar2(32767);
l_msg_data varchar2(32767);
l_cr_id          NUMBER;

begin


BEGIN
fnd_global.apps_initialize(user_id, responsibility_id, responsibility_application_id);
END;
begin

  fnd_client_info.set_org_context('204');

end;

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                => v_return_status
        ,x_msg_count                    => l_msg_count
        ,x_msg_data                     => l_msg_data
        ,p_currency_code                => 'USD'
        ,p_amount                       => 100
        ,p_receipt_number               => '12348'
        ,p_receipt_date                 => sysdate
        ,p_cr_id                        => l_cr_id
        ,p_receipt_method_name          => 'First Data'
        ,p_customer_number              =>'4932'
        --,p_customer_bank_account_name=>  'Credit Card Bank'
        ,p_customer_bank_account_id     =>'17937'
        ,p_comments                     => 'Hello Prabu'
        ,p_customer_receipt_reference   => NULL
        ,p_remittance_bank_account_id   => '10001'
      );
      COMMIT ;
     
       dbms_output.put_line('Hi Prabu: Status Is'||v_return_status);
    


      

    fnd_msg_pub.count_and_get(
    p_encoded => 'F',
    p_count => l_msg_count,
    p_data => l_msg_data);


    dbms_output.put_line('no. of FND messages :'||l_msg_count);

    for k in 1 .. l_msg_count loop
    l_msg_data := fnd_msg_pub.get(
    p_msg_index => k,
    p_encoded => 'F');
    dbms_output.put_line('Prabu E Msg: '||substr(l_msg_data,1,240));
  
    end loop;

     
      end;
     
    

 Apply Invoice to receipt:


SET SERVEROUTPUT ON

declare
l_return_status varchar2(32767);
l_msg_count varchar2(32767);
l_msg_data varchar2(32767);
l_cr_id          NUMBER;

begin

begin
  fnd_client_info.set_org_context('204');
  end;
 
AR_RECEIPT_API_PUB.APPLY
(
p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_TRUE,
p_receipt_number => '12348',
p_customer_trx_id => '215952' ,
p_amount_applied =>100 ,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data
);

dbms_output.put_line('Hi Prabu: Status Is'||l_return_status);
    
 fnd_msg_pub.count_and_get(
    p_encoded => 'F',
    p_count => l_msg_count,
    p_data => l_msg_data);


    dbms_output.put_line('no. of FND messages :'||l_msg_count);

    for k in 1 .. l_msg_count loop
    l_msg_data := fnd_msg_pub.get(
    p_msg_index => k,
    p_encoded => 'F');
    dbms_output.put_line('Prabu E Msg: '||substr(l_msg_data,1,240));
  
    end loop;

     

end;

No comments:

Post a Comment