1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to submit a concurrent program multiple times through backend?

Discussion in 'Oracle Apps Technical' started by jagadekara, Jan 20, 2015.

  1. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi All,

    How to submit a concurrent program multiple times through back end?

    I have a program which has invoice_id parameter. I am passing 3 invoice_id's at a time into one variable. So How to submit it multiple times?

    How to write loop for that? Can you provide me sample code?
     
  2. yowancristo

    yowancristo Forum Advisor

    Messages:
    103
    Likes Received:
    10
    Trophy Points:
    305
    Location:
    Bangalore
    Hi Jagadekara,

    If the number of times program to be called is constant say 3 times, you can use the loop 1..3 and call concurrent program inside the loop.

    Please let me know if my understanding is wrong.
     
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Thanks Yowan,

    I done this like below.

    declare
    p_inv_num varchar2(100);
    cursor c1 is select invoice_num from ap_invoices_all where batch_id=204; --This batch have 3 invoices
    begin
    for i in c1 loop
    p_inv_num:=i.invoice_num;
    XX_MY_PROC(p_inv_num);
    end loop;
    commit;
    end;
     
  4. yowancristo

    yowancristo Forum Advisor

    Messages:
    103
    Likes Received:
    10
    Trophy Points:
    305
    Location:
    Bangalore
    Thats correct Jagadekara.:)
     
  5. Mohamed.Alaa

    Mohamed.Alaa Active Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    55
    You can utilize fnd_request.submit_request inside a loop and pass the parameter(s) in each iteration inside the loop
     
  6. blackgee

    blackgee Active Member

    Messages:
    12
    Likes Received:
    3
    Trophy Points:
    90
    Perhaps, could be more effective build a concurrent program with the parameter P_BATCH_ID and then put all you logic. This way you dont need run n times the concurrent progrom for each invoices.

    You will need to run the API submit_request and remember to perform COMMIT after in order to Manager catch it into the queue.