How to call Autoinvoice Import Program (Program short name is RAXTRX) using FND_REQUEST.SUBMIT_REQUEST API

Auto invoice Import Program takes the 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 submit the program to set the context :

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 = '&resp_name');

 
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(10178,50559,222);
l_request_id :=
fnd_request.submit_request
(application      => 'AR',
program          => 'RAXTRX',
description      => NULL,
start_time       => NULL,-- To start immediately
sub_request      => FALSE,
argument1        => 'MAIN',
argument2        => 'T',
argument3        => '1228',--batch_source_id
argument4        => 'LEGACY', --batch_source_name
argument5        => '2010/06/11 00:00:00', -- should be in format                                                     -- RR-MON-DD
argument6        => '',
argument7        => '',
argument8        => '',
argument9        => '',
argument10       => '',
argument11       => '',
argument12       => '',
argument13       => '',
argument14       => '',
argument15       => '',
argument16       => '',
argument17       => '',
argument18       => '63737', --sales_order low
argument19       => '63737', --sales_order high
argument20       => '',
argument21       => '',
argument22       => '',
argument23       => '',
argument24       => '',
argument25       => '',
argument26       => 'N',
argument27       => 'Y',
argument28       => '',
argument29       => '204', -- org_id
argument30       => chr(0) -- end with chr(0)as end of parameters
);
dbms_output.put_line(l_request_id);
END;





If you like please follow and comment