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 get request id?

Discussion in 'Oracle Apps Technical' started by jagadekara, May 27, 2014.

  1. jagadekara

    jagadekara Forum Guru

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

    I have a request set containing two concurrent programs.

    Request set name: XX_TEST_REQ_SET
    Programs: 1) XX_TEST_PRG1
    2) XX_TEST_PRG2

    XX_TEST_PRG2 has a condition in query like this. where request_id=:V_request_id.

    So I need to pass the value for this is XX_TEST_PRG1 's request id.
    How can I do this?
     
  2. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Hi Jagadekara,

    I don't have the complete query at hand but I'm sure you can build it up in your request parameters from the following:

    Code (SQL):
    SELECT f.request_id
    FROM fnd_concurrent_requests f
    WHERE parent_request_id IS NOT NULL
    AND parent_request_id = &pr
    AND concurrent_program_id = &cp ;
    ;
     
  3. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Sorry missed last part:

    - parent_request_id = request id of request set XX_TEST_REQ_SET
    - concurrent_program_id = conc program id of XX_TEST_PRG1
     
  4. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi Rajen,
    Thanks for reply,

    How to get that request id? and where I need to write this query?

    I need to pass XX_TEST_PRG1 's request id in XX_TEST_PRG2's query.
     
  5. rajenb

    rajenb Forum Expert

    Messages:
    361
    Likes Received:
    114
    Trophy Points:
    655
    Location:
    Mauritius
    Hi Jagadekara,

    In XX_TEST_PRG2, you can get it's request id from FND_GLOBAL.CONC_REQUEST_ID.

    Code (SQL):
    SELECT f.request_id, f.parent_request_id
    INTO l_request_id_prg2, l_parent_request_id
    FROM fnd_concurrent_requests f
    WHERE concurrent_program_id = FND_GLOBAL.CONC_REQUEST_ID;

    SELECT f.request_id
    INTO l_request_id_prg1
    FROM fnd_concurrent_requests f
    WHERE  parent_request_id IS NOT NULL
    AND parent_request_id = l_parent_request_id
    AND concurrent_program_id = l_concurrent_program_id_prg1 ;
    l_concurrent_program_id_prg1 = concurrent program id of XX_TEST_PRG1 from fnd_concurrent_programs table

    You can, of course, re-write these 2 SQL statements into a single SQL - I've split it into 2 just to show the logic and table links.

    These SQL statements have to be incorporated in the code of XX_TEST_PRG2.

    Do you mean you have to define a parameter for XX_TEST_PRG2 with a default value being the request id of XX_TEST_PRG1.
    If yes, you may then build one SQL Statement from above 2 statements but I'm not sure whether FND_GLOBAL.CONC_REQUEST_ID is populated at that moment... Need to test that - I don't have access to a test instance right now. You can try it and see if it works and let us know.
     
    jagadekara likes this.
  6. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Ok Thanks Rajen...