This discussion is archived
1 2 Previous Next 20 Replies Latest reply: Apr 14, 2013 3:20 AM by Mini RSS

APPS initialization is not working in APEX(under VPD)

Mini Journeyer
Currently Being Moderated
Hi guys,

Im trying to extend the EBS session to the APEX, by doing some apps_initialization stuff under VPD of the security attributes like below
IF :FND_GLOBAL_USER_ID IS NOT NULL THEN
FND_GLOBAL.apps_initialize(
:FND_GLOBAL_USER_ID,
:FND_GLOBAL_RESP_ID,
:FND_GLOBAL_RESP_APPL_ID);
END IF;
But this is not working. Any help is appreciated.

Brgds,
Mini
  • 1. Re: APPS initialization is not working in APEX(under VPD)
    VC Guru
    Currently Being Moderated
    Mini wrote:
    Hi guys,

    But this is not working. Any help is appreciated.
    Explain why do you think it is not working. Possibly post any error message.
  • 2. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Hi VC,

    Thanks for the reply.

    I have to pass the user environment language variable to APEX from EBS(as i have APEX integrated with EBS). Like as mentioned in docs
    If the APEX application requires every session to
    be initialized for the E-Business Suite user and
    responsibility then this can be achieved by
    entering a call to the
    FND_GLOBAL.apps_initialize procedure into
    Virtual Private Database (VPD) security attribute
    for the APEX application like below
    
    IF :FND_GLOBAL_USER_ID IS NOT NULL THEN
    FND_GLOBAL.apps_initialize(
    :FND_GLOBAL_USER_ID,
    :FND_GLOBAL_RESP_ID,
    :FND_GLOBAL_RESP_APPL_ID);
    END IF;
    I have a apex responsibility in EBS, in which soon after i clicked that responsibility it will redirect to the APEX home page(Without login page).

    Inorder to take the USERENV('LANG') variable of EBS to APEX, as mentioned in docs they asked to do some apps initialization. I tried by passing like below

    IF
    *:FND_GLOBAL_USER_ID IS NOT NULL THEN*
    FND_GLOBAL.apps_initialize(0,50982,0);
    END IF;

    where 0-> is the login ebs user id
    50982-> is the responsibility id (where the apex is integrated in EBS)
    0-> is the responsibility application id

    I tried in the above manner for passing the ebs user language to the APEX for showing the data in the language they logged in via application. But it is not working.

    Any ideas??

    Brgds,
    Mini
  • 3. Re: APPS initialization is not working in APEX(under VPD)
    VC Guru
    Currently Being Moderated
    Mini wrote:
    Hi VC,

    Thanks for the reply.

    I have to pass the user environment language variable to APEX from EBS(as i have APEX integrated with EBS). Like as mentioned in docs
    If the APEX application requires every session to
    be initialized for the E-Business Suite user and
    responsibility then this can be achieved by
    entering a call to the
    FND_GLOBAL.apps_initialize procedure into
    Virtual Private Database (VPD) security attribute
    for the APEX application like below
    
    IF :FND_GLOBAL_USER_ID IS NOT NULL THEN
    FND_GLOBAL.apps_initialize(
    :FND_GLOBAL_USER_ID,
    :FND_GLOBAL_RESP_ID,
    :FND_GLOBAL_RESP_APPL_ID);
    END IF;
    I have a apex responsibility in EBS, in which soon after i clicked that responsibility it will redirect to the APEX home page(Without login page).

    Inorder to take the USERENV('LANG') variable of EBS to APEX, as mentioned in docs they asked to do some apps initialization. I tried by passing like below
    But I don't see any code that derives USERENV('LANG') in your code
    IF
    *:FND_GLOBAL_USER_ID IS NOT NULL THEN*
    FND_GLOBAL.apps_initialize(0,50982,0);
    END IF;
    This only initializes the apps session for the given values
    where 0-> is the login ebs user id
    50982-> is the responsibility id (where the apex is integrated in EBS)
    0-> is the responsibility application id

    I tried in the above manner for passing the ebs user language to the APEX for showing the data in the language they logged in via application. But it is not working.
    Again I don't see any code that passes user language ..only thing I can see is of initializing apps/ebs session

    Try following, whilst make sure FND_GLOBAL_USER_ID is not null when your apex is launched from EBS
    create a application item called EBS_USER_LANG in your apex application
    IF
     :FND_GLOBAL_USER_ID IS NOT NULL THEN
        FND_GLOBAL.apps_initialize(0,50982,0);
        :EBS_USER_LANG :=USERENV('LANG');
    END IF;
    And then launch the apex app from EBS and check the value of EBS_USER_LANG in the APEX session state
  • 4. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Hi Vikram,

    Thanks for your reply, will try your way and update the post shortly.

    Brgds,
    Mini
  • 5. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Dear VC,

    Sorry for the late reply.

    I tried in the way like you said as

    <li> Created application item called EBS_USER_LANG with a state: global and a session state protection: unrestricted

    <li> Then under the security attributes, in db session initialization pl/sql code i have given the following like
    IF
     :FND_GLOBAL_USER_ID IS NOT NULL THEN
        FND_GLOBAL.apps_initialize(0,50982,0);
        :EBS_USER_LANG :=USERENV('LANG');
    END IF;
    <li> As a next step, what i did is i tried to capture the USERENV('LANG') of the EBS session to an apex item by creating a apex item like P1_EBS_LANG and for the value of the item i passed like below
    P1_EBS_LANG--> &EBS_USER_LANG.
    But then also im not sure why i couldnt capture or initiate the EBS user session language to the apex page or item.

    Whether im missing anything.

    Thanks

    Brgds,
    Mini
  • 6. Re: APPS initialization is not working in APEX(under VPD)
    VC Guru
    Currently Being Moderated
    Hello,

    If you follow my steps then what was the out come of my last step??
    And then launch the apex app from EBS and check the value of EBS_USER_LANG in the APEX session state
  • 7. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Hi VC,

    +>>And then launch the apex app from EBS+

    From the above you mean, of redirecting to APEX from the EBS menu. If it so, yes im launching apex app from EBS menu.

    +>>and check the value of EBS_USER_LANG in the APEX session state+

    Sorry, i dont know how to check the value of EBS_USER_LANG in session state. Can you guide me of how to check, so that i can confirm you.

    Thanks

    Brgds,
    Mini
  • 9. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Hi VC,

    I checked in the session state of that page item but it seems there is not any value set for that item. I logged into apex via(EBS by switching to Arabic 'AR', expecting my apex item :P16_EBS_LANG to capture the code 'AR' from EBS userenv('lang'))

    I had a item P16_EBS_LANG, in which i have given like
    Source Type: plsql expression
    Source value or exp :EBS_USER_LANG
    But still no luck.

    Brgds,
    Mini
  • 10. Re: APPS initialization is not working in APEX(under VPD)
    VC Guru
    Currently Being Moderated
    in that case change your above code to set the page item insead
    IF
     :FND_GLOBAL_USER_ID IS NOT NULL THEN
        FND_GLOBAL.apps_initialize(0,50982,0);
        :P16_EBS_LANG :=nvl(USERENV('LANG'),'NULL LANG');
    END IF;
    reproduce the issue > And verify the session state of your page item now
  • 11. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Hi VC,

    I tried in that way too, that is under the security attributes in the pl/sql initialization block, i gave like below
    IF
     :FND_GLOBAL_USER_ID IS NOT NULL THEN
        FND_GLOBAL.apps_initialize(0,50982,0);
        :P16_EBS_LANG :=nvl(USERENV('LANG'),'NULL LANG');
    END IF;
    After that i navigated to the page 16 where my item :P16_EBS_LANG located, but still no any userenv lang is setted for that item, as i have logged in via EBS with Arabic language and also with the sysadmin user who has the userid-->0

    i checked in session state too, but then too i couldnt see any value for that item.

    Now for the item :P16_EBS_LANG i setted like below
    Source Used:Always replacing an existing session state
    Source Type:static assignment
    Dont know where im missing.

    Whether the apex_util.set_session_lang api will be useful for capturing the ebs session lang to APEX session.

    Thanks

    Brgds,
    Mini
  • 12. Re: APPS initialization is not working in APEX(under VPD)
    VC Guru
    Currently Being Moderated
    Mini wrote:
    Hi VC,

    I tried in that way too, that is under the security attributes in the pl/sql initialization block, i gave like below
    Try this code into a on-load before header application process
    IF
    :FND_GLOBAL_USER_ID IS NOT NULL THEN
    FND_GLOBAL.apps_initialize(0,50982,0);
    :P16_EBS_LANG :=nvl(USERENV('LANG'),'NULL LANG');
    END IF;
    After that i navigated to the page 16 where my item :P16_EBS_LANG located, but still no any userenv lang is setted for that item, as i have logged in via EBS with Arabic language and also with the sysadmin user who has the userid-->0
    Don't NAVIGATE AWAY TO ANY PAGE, JUST CHECK the session state as soon as you launch the apex from ebs.
    i checked in session state too, but then too i couldnt see any value for that item.

    Now for the item :P16_EBS_LANG i setted like below

    Source Used:Always replacing an existing session state
    Change to 'Only when value is null'
  • 13. Re: APPS initialization is not working in APEX(under VPD)
    Mini Journeyer
    Currently Being Moderated
    Hi Vikram,

    I tried to create a process - on load before application process and after that i checked with the page item but then too i couldnt capture the EBS session user lang code in that item.

    I checked in the session state of the page where my page item is created, but it is showing like page has no items.
    I checked in the apex page which is launched directly from the EBS menu.

    Mini
  • 14. Re: APPS initialization is not working in APEX(under VPD)
    VC Guru
    Currently Being Moderated
    you have to debug above plsql block yourself and see whether its running and may be check the view source or inspect the element the page and check the html markup
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points