Home » Applications » Oracle Fusion Apps & E-Business Suite » AR_INVOICE_API_PUB.create_single_invoice (r12,10g)
icon4.gif  AR_INVOICE_API_PUB.create_single_invoice [message #516814] Thu, 21 July 2011 01:23 Go to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
hi I am try to punch trascation by using api
AR_INVOICE_API_PUB.create_single_invoice

following code executed successfully..

but i am not able to see that transaction number in table not on application and not in error table...

can anyone please suggest me where i am get wrong....
begin
    mo_global.init('AR');
    mo_global.set_policy_context('S',107);
end;
declare
l_return_status varchar2(1);
p_count  NUMBER;
l_msg_count number;
l_msg_data varchar2(2000);
l_batch_id number;
l_cnt number := 0;
l_batch_source_rec ar_invoice_api_pub.batch_source_rec_type;
l_trx_header_tbl ar_invoice_api_pub.trx_header_tbl_type;
l_trx_lines_tbl ar_invoice_api_pub.trx_line_tbl_type;
l_trx_dist_tbl ar_invoice_api_pub.trx_dist_tbl_type;
l_trx_salescredits_tbl ar_invoice_api_pub.trx_salescredits_tbl_type;
l_customer_trx_id number;
cnt number; 
v_context varchar2(100);


BEGIN
   fnd_global.apps_initialize ( user_id      => 3959
                                ,resp_id      => 50577
                                ,resp_appl_id => 222);

-- Populate header information.
l_trx_header_tbl(1).trx_header_id := 43543;
l_trx_header_tbl(1).trx_number := '123456789';
l_trx_header_tbl(1).bill_to_customer_id := 9141;
l_trx_header_tbl(1).cust_trx_type_id := 1341;
l_trx_header_tbl(1).primary_salesrep_id := -3;
-- Populate batch source information.
l_batch_source_rec.batch_source_id := -1;
-- Populate line 1 information.
l_trx_lines_tbl(1).trx_header_id := 43543;
l_trx_lines_tbl(1).trx_line_id := 11101;
l_trx_lines_tbl(1).line_number := 1;
l_trx_lines_tbl(1).description := 'Test';
l_trx_lines_tbl(1).quantity_invoiced := 10;
l_trx_lines_tbl(1).unit_selling_price := 120;
l_trx_lines_tbl(1).line_type := 'LINE';
-- Populate Distribution Information
l_trx_dist_tbl(1).trx_dist_id := 1021;
l_trx_dist_tbl(1).trx_header_id := 43543;
l_trx_dist_tbl(1).trx_LINE_ID := 11101;
l_trx_dist_tbl(1).ACCOUNT_CLASS := 'REV';
l_trx_dist_tbl(1).AMOUNT := 1200;
l_trx_dist_tbl(1).CODE_COMBINATION_ID := 14495;
-- CAll the api
AR_INVOICE_API_PUB.create_single_invoice(
p_api_version => 1.0,
p_batch_source_rec => l_batch_source_rec,
p_trx_header_tbl => l_trx_header_tbl,
p_trx_lines_tbl => l_trx_lines_tbl,
p_trx_dist_tbl => l_trx_dist_tbl,
p_trx_salescredits_tbl => l_trx_salescredits_tbl,
x_customer_trx_id => l_customer_trx_id,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data); 

DBMS_OUTPUT.PUT_LINE('l_return_status : '||l_return_status);
IF l_return_status = 'S' THEN
dbms_output.put_line('unexpected errors found!'); 
 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;
ELSE
dbms_output.put_line(' Got Created Sucessfully : '||l_customer_trx_id);
commit;
END IF;
END;


i am checking data in::
select * from RA_CUSTOMER_TRX_all

error checking in :::
select * from ar_trx_errors_gt

please guide me to resolve out this........
Re: AR_INVOICE_API_PUB.create_single_invoice [message #517004 is a reply to message #516814] Thu, 21 July 2011 14:20 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:
following code executed successfully..
Did you enable the serveroutput and confirmed?

By
Vamsi
Previous Topic: Picklist values is not reflect according to value set maintained
Next Topic: The relation between tables and view in oracle financial
Goto Forum:
  


Current Time: Thu Apr 18 22:19:27 CDT 2024