Home » Applications » Oracle Fusion Apps & E-Business Suite » run request from database
run request from database [message #540420] Mon, 23 January 2012 08:13 Go to next message
hany_marawan
Messages: 198
Registered: April 2005
Location: Cairo - Egypt
Senior Member
I tried to run the request "Receipt Write-off Report"
from database but to give me non.
why????
this the code.
can anyone help me
--===============================

PROCEDURE insert_receipt_writeoff

IS

l_options_ok BOOLEAN;
l_request_id number;
v_result VARCHAR(100);

cursor receipt is
select acr.receipt_number
,arc.amount_applied
,acr.amount
,acr.currency_code
,acr.pay_from_customer
,ac.customer_name
,ac.customer_number
,acr.receivables_trx_id
,acr.receipt_method_id

from ar_cash_receipts_all acr
,ar_customers_all_v ac
,AR_RECEIVABLE_APPLICATIONS_all arc

where acr.customer_site_use_id =ac.CUSTOMER_ID
and acr.cash_receipt_id=arc.cash_receipt_id
and arc.display='Y'
and acr.receipt_number='47';

BEGIN
for rec in receipt loop

MO_GLOBAL.init('AR');

mo_global.set_policy_context('S',1112); -- take org_id
fnd_global.apps_initialize(50657, 1112, 222,0); -- resp_id,user_id

MO_GLOBAL.init('AR');

mo_global.set_policy_context('S',1112); -- take org_id
fnd_global.apps_initialize(50657, 1112, 222,0); -- resp_id,user_id

l_options_ok := FND_REQUEST.SET_OPTIONS (implicit => 'NO'
,protected => 'YES'
,language => ''
,territory => '');

if (fnd_request.set_print_options('', 'LANDSCAPE', 0, True, 'N')) then

IF (l_options_ok) then
fnd_request.set_org_id(1112);

l_request_id := FND_REQUEST.SUBMIT_REQUEST(application => 'AR'
,program => 'ARWRTRPT'
,description => ''
,start_time => ''
,sub_request => FALSE
,argument1 => sysdate --'P_APPLY_DATE='
,argument2 => rec.customer_number --'P_CUSTOMER_NUMBER='
,argument3 => sysdate --'P_GL_DATE='||
,argument4 => rec.currency_code
,argument5 => '' --'P_RECEIPT_DATE_FROM='
,argument6 => '' --'P_RECEIPT_DATE_TO='
,argument7 => '' --'P_RECEIPT_GL_DATE_FROM='
,argument8 => '' --'P_RECEIPT_GL_DATE_TO='
,argument9 => '' --'P_RECEIPT_METHOD_ID='
,argument10 => 'rec.receipt_number --'P_RECEIPT_NUMBER='
,argument11 => ''
,argument12 => '1.00' --'P_UNAPP_AMOUNT='
,argument13 => '' --'P_UNAPP_AMOUNT_PERCENT='
,argument14 => '' --'P_USER_ID='||
,argument15 => ''
,argument16 => ''
,argument17 => ''
,argument18 => ''
,argument19 => ''
,argument20 => ''
,argument21 => ''
,argument22 => ''
,argument23 => ''
,argument24 => ''
,argument25 => ''
,argument26 => ''
,argument27 => ''
,argument28 => ''
,argument29 => ''
,argument30 => ''
,argument31 => ''
,argument32 => ''
,argument33 => ''
,argument34 => ''
,argument35 => ''
,argument36 => ''
,argument37 => ''
,argument38 => ''
,argument39 => ''
,argument40 => ''
,argument41 => ''
,argument42 => ''
,argument43 => ''
,argument44 => ''
,argument45 => ''
,argument46 => ''
,argument47 => ''
,argument48 => ''
,argument49 => ''
,argument50 => ''
,argument51 => ''
,argument52 => ''
,argument53 => ''
,argument54 => ''
,argument55 => ''
,argument56 => ''
,argument57 => ''
,argument58 => ''
,argument59 => ''
,argument60 => ''
,argument61 => ''
,argument62 => ''
,argument63 => ''
,argument64 => ''
,argument65 => ''
,argument66 => ''
,argument67 => ''
,argument68 => ''
,argument69 => ''
,argument70 => ''
,argument71 => ''
,argument72 => ''
,argument73 => ''
,argument74 => ''
,argument75 => ''
,argument76 => ''
,argument77 => ''
,argument78 => ''
,argument79 => ''
,argument80 => ''
,argument81 => ''
,argument82 => ''
,argument83 => ''
,argument84 => ''
,argument85 => ''
,argument86 => ''
,argument87 => ''
,argument88 => ''
,argument89 => ''
,argument90 => ''
,argument91 => ''
,argument92 => ''
,argument93 => ''
,argument94 => ''
,argument95 => ''
,argument96 => ''
,argument97 => ''
,argument98 => ''
,argument99 => ''
,argument100 => ''
);

commit;
dbms_output.put_line('l_request_id ='||l_request_id);

else
dbms_output.put_line('error ....');
end if;
end if;

end loop;
END; -- Procedure
Re: run request from database [message #540442 is a reply to message #540420] Mon, 23 January 2012 10:55 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:
from database but to give me non.
What do you mean by that?

By
Vamsi
Re: run request from database [message #540453 is a reply to message #540442] Mon, 23 January 2012 13:34 Go to previous messageGo to next message
hany_marawan
Messages: 198
Registered: April 2005
Location: Cairo - Egypt
Senior Member
In the receivable, if you have receipt by 30 pound and you make apply and enter line by 29 pound there will be difference between the value of the receipt and the line applied.
so we run "Receipt Write-off Report" request to insert new line by the difference to make a balance.
I want to insert this line by the request I created in the database, I wrote this code.
But when I run this request no lines inserted.
I hope I explained good.
Re: run request from database [message #540469 is a reply to message #540453] Mon, 23 January 2012 22:43 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
1. Debug the values, which you are passing to the fnd_request by printing before calling.
2. Check whether it is a typo in the post or it is like that in that code.Quote:
,argument10 => 'rec.receipt_number --'P_RECEIPT_NUMBER='
3. Is the request_id getting printed from the above code, when you execute the procedure?
4. Did you crosscheck from the application that the request has really spawned?

By
Vamsi
Re: run request from database [message #540515 is a reply to message #540420] Tue, 24 January 2012 04:03 Go to previous messageGo to next message
eric62
Messages: 24
Registered: January 2009
Junior Member
Hello.

If the submit is on error, you can have an message with fnd_message.get.

Regards,
Eric.
Re: run request from database [message #540756 is a reply to message #540515] Wed, 25 January 2012 10:16 Go to previous messageGo to next message
hany_marawan
Messages: 198
Registered: April 2005
Location: Cairo - Egypt
Senior Member
Hello,
As you saw in the code I wrote
dbms_output.put_line('l_request_id ='||l_request_id);
to give me the request number to know if it run or not, but it gave me 0 and not gave me error message.
Re: run request from database [message #540806 is a reply to message #540756] Wed, 25 January 2012 14:57 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
I got answer for only 3rd question.
Always the returns are based on what you give....

That clarifies the issue.
It didn't submit the request itself.
How can you expect the row to be inserted?
Check the link.
Are you sure your responsibility_id is 1112?Quote:
fnd_global.apps_initialize(50657, 1112, 222,0); -- resp_id,user_id
Make sure that your user_id, responsibility_id and security_grou_id are correct.

I still wonder that you are looking at similar issue for years....
http://www.orafaq.com/forum/m/215931/45399/#msg_215931

By
Vamsi
Re: run request from database [message #541182 is a reply to message #540806] Sun, 29 January 2012 03:40 Go to previous messageGo to next message
hany_marawan
Messages: 198
Registered: April 2005
Location: Cairo - Egypt
Senior Member
Yes I asked a similar question from a year.
I solved this problem and I run a request from database in other modules, but this time it's not working.
I'm sure about the user_id, responsibility_id and security_grou_id.

Regards
Re: run request from database [message #541184 is a reply to message #541182] Sun, 29 January 2012 04:34 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Looks like you have swapped the first two parameters.
Check the links
http://www.orafaq.com/forum/m/218752/45399/#msg_218752
http://oracleebusinesssuite.wordpress.com/2007/06/15/how-to-setting-your-oracle-applications-session-fnd_globalapps_initialize-org_id /

By
Vamsi
Previous Topic: AR PAYMENT TERMS
Next Topic: Inventory
Goto Forum:
  


Current Time: Fri Mar 29 06:01:37 CDT 2024