How to call Auto invoice Import Program from Back end

Autoinvoice Import Program takes following parameters :

argv[0]  program name
argv[1]  parallel module name  [MAIN|PU?]
argv[2]  running mode  [V|T|P]
argv[3]  batch source id
argv[4]  batch source name
argv[5]  default date
argv[6]  concatenated transaction flexfield attribute value
argv[7]  transaction type id
argv[8]  low bill to customer number
argv[9]  high bill to customer number
argv[10]  low bill to customer name
argv[11] high bill to customer name
argv[12] low gl date
argv[13] high gl date
argv[14] low ship date
argv[15] high ship date
argv[16] low transaction number
argv[17] high transaction number
argv[18] low sales order
argv[19] high sales order
argv[20] low invoice date
argv[21] high invoice date
argv[22] low ship to customer number
argv[23] high ship to customer number
argv[24] low ship to customer name
argv[25] high ship to customer name
argv[26] Call RAXTRX from RAXMTR flag
argv[27] Base Due Date on invoice date flag
argv[28] Minimum Due Date offset from trx date
argv[29] Org_id
First find out user_id and RESPONSIBILITY_ID through which you will

SELECT USER_ID,RESPONSIBILITY_ID,RESPONSIBILITY_APPLICATION_ID,
SECURITY_GROUP_ID
FROM FND_USER_RESP_GROUPS
WHERE USER_ID = (SELECT USER_ID
FROM FND_USER
WHERE USER_NAME = '&user_name')
AND RESPONSIBILITY_ID = (SELECT RESPONSIBILITY_ID
FROM FND_RESPONSIBILITY_VL
WHERE RESPONSIBILITY_NAME = '&amp;resp_name');</div>

Using above query to get User ID, Resp Id and Application ID to pass in below code,


DECLARE
l_request_id NUMBER;
BEGIN
Fnd_Global.apps_initialize(userId,responsibilityId,applicationId)
-- replace the following code with correct value as get from sql above
Fnd_Global.apps_initialize(1012178,50559,222);
l_request_id :=
fnd_request.submit_request
(application      =&gt; 'AR',
program          =&gt; 'RAXTRX',
description      =&gt; NULL,
start_time       =&gt; NULL,-- To start immediately
sub_request      =&gt; FALSE,
argument1        =&gt; 'MAIN',
argument2        =&gt; 'T',
argument3        =&gt; '1228',--batch_source_id
argument4        =&gt; 'LEGACY', --batch_source_name
argument5        =&gt; '2010/06/11 00:00:00', -- should be in format                                                     -- RR-MON-DD
argument6        =&gt; '',
argument7        =&gt; '',
argument8        =&gt; '',
argument9        =&gt; '',
argument10       =&gt; '',
argument11       =&gt; '',
argument12       =&gt; '',
argument13       =&gt; '',
argument14       =&gt; '',
argument15       =&gt; '',
argument16       =&gt; '',
argument17       =&gt; '',
argument18       =&gt; '63737', --sales_order low
argument19       =&gt; '63737', --sales_order high
argument20       =&gt; '',
argument21       =&gt; '',
argument22       =&gt; '',
argument23       =&gt; '',
argument24       =&gt; '',
argument25       =&gt; '',
argument26       =&gt; 'N',
argument27       =&gt; 'Y',
argument28       =&gt; '',
argument29       =&gt; '204', -- org_id
argument30       =&gt; chr(0) -- end with chr(0)as end of parameters
);
dbms_output.put_line(l_request_id);
END;

Comments

Popular posts from this blog

Oracle Shipping Network SQL Query

Oracle Ar Invoice Numbering Sequence alter to avoid missing in between by cache