Reading context variable

Hi All,
In WebDynpro for ABAP can we access the value of context node of component controller
from view controller which marks that component controller as required controller.
I want to achieve this without doing context mapping.
Any sample would be a lot helpful for me.
Thank You,
Nagaraju Donikena.

Hi Nagaraju,
You will not be able to access it directly. But you can do the following.
Create a method in the component controller which will access the context node of component controller and call it from the view controller.

Similar Messages

  • Assigning & Reading Context variable

    All,
    Im setting the context variable "POS_NUM" in Component controller:
    wdThis.wdGetFormController().wdGetContext().getCurrentElement().setAttributeValue( "c_pos_num", pos_num);
    * In View controller im reading the component controller value & passing into BAPI..
    Here im getting error :Can not be converted".
      String val = wdThis.toString( wdContext.getCurrentElement().getAttributeValue( "c_pos_num") );
    bapiInput.setI_Pos_Num( val );
    can anyone tell me how to read the value of context variable..
    BM

    Nothing helpfu...
    I'm setting the value in InterfaceView as follows:
         wdThis.wdGetRequisitionFormController().wdGetContext().currentContextElement().set_pos_num("125");
    When I debugged the pos_num is initial here.
    In Componenet controller I'm reading the value as follows:
         String value = wdContext.currentContextElement().getTemp_pos_num();
    Here value is initial.
    Could anyone suggest me pls.
    BM

  • How to use one Assign action to create multiple context variables

    Hello, everyone.
    I read some tips from Oracle documentation that said:
    Avoid creating many OSB context variables that are used just once within another XQuery
    Context variables created using an Assign action are converted to XmlBeans and then reverted to the native XQuery format for the next XQuery. Multiple "Assign" actions can be collapsed into a single Assign action using a FLWOR expression. Intermediate values can be created using "let" statements. Avoiding redundant context variable creation eliminates overheads associated with internal data format conversions. This benefit has to be balanced against visibility of the code and reuse of the variables.
    Oracle® Fusion Middleware Performance and Tuning Guide
    +11g Release 1 (11.1.1)+
    Part Number E10108-03
    But I don't know how to do that. Can you show me ?
    Thank in advance
    Edited by: Doubt_Man on Aug 17, 2011 3:30 PM

    if you return sequences, you can declare the return type of your xquery as xs:double*
    (notice the asterix at the end)
    but I have the impression that in the assign action only the first element will be assigned to the context variable
    (correct me if I am wrong)
    So in fact you might indeed have to transform the sequence into a element()*, or concatenate it into a CVS string - for instance using string-join
    http://www.xqueryfunctions.com/xq/fn_string-join.html

  • How to Parse XML data directly from context variables in webdynpro

    Hello,
       I have two requirements:
    1) I have a context variable which has string value.
       I want to write the this value into a flat file.
       How do I do this in WebDynpro.
       Any sample code for this.
    2) In Webdynpro, I want to parse and process the XML data directly from a string context variable which
       has the value in XML format.
       How do I achieve this. Any pointers or sample codes for this.
    Thanks and Regards,
    Anupama.

    Anupama,
    Here is some link which talks about unpacking xml and converting to HTML.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/eb/3dfb402eb5f76fe10000000a1550b0/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/eb/3dfb402eb5f76fe10000000a1550b0/content.htm</a>
    I have done something like this in portal development and not in webdynpro.But in principle it should work very where.

  • Workflow context variable / function

    Is there any Database variable or function, which would return, whether a specific code is being called from a Workflow process or not ?
    For Ex: if the function fnd_global.user_id return a value other than -1, then the code is being executed from Oracle eBusiness suite. Similarly FND_GLOBAL.CONC_REQUEST_ID gives info about concurrent program.
    regards
    Yj

    Hi Maya,
    I dont think you need to use Context variable as a replacement for AT NEW....There would be something else out of box...
    Because Context Variable represents - Variables declared in context to the report other than declaraing globally....
    Could you please send us the part of code where you get this error?
    Best Regards,
    Ram.

  • Read HttpSession Variables in Multiples Projects...

    I'm using JDeveloper 9.0.3 with BC4J+UIXML, and I have the problem:
    One session varible using HttpSession created in the Project "A", don't be used in Classes of Project "B", after deploy processes.
    Example:
    Project "A"
    file1.uix - invoking Java Class FunSessionVar (create session variables and call file2.uix in Project "B"):
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import oracle.cabo.servlet.util.RedirectUtils;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServletRequest;
    public class FunSessionVar
    public static EventResult FunPrepSessionVar(BajaContext context
    ,Page page
    ,PageEvent event) throws Throwable
         HttpServletRequest req = context.getServletRequest();
         HttpSession sess = req.getSession(true);
         sess.setAttribute("CodPessoaEscola", event.getParameter("CodPessoaEscola"));
         sess.setAttribute("DspNomEscola", event.getParameter("DspNomEscola"));
         Page browsePage = new Page(page, "../ProjectB/file2.uix");
         return new EventResult(RedirectUtils.getRedirectPage(context, browsePage));
    Project "B"
    file2.uix - have a "null" event invoking Java Class FunReadSessionVar (read session variables and set View Object Query):
    import oracle.jbo.ViewObject;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import oracle.cabo.servlet.util.RedirectUtils;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServletRequest;
    public class FunReadSessionVar
    public static EventResult FunPrepReadSessionVar(BajaContext context
    ,Page page
    ,PageEvent event) throws Throwable
         HttpServletRequest req = context.getServletRequest();
         HttpSession sess = req.getSession(true);
         String valor1 = sess.getAttribute("CodPessoaEscola");
         String valor2 = sess.getAttribute("DspNomEscola");
         ViewObject view = ServletBindingUtils.getViewObject(context);
         view.setWhereClauseParam(0,valor1);
         view.setWhereClauseParam(1,valor2);
         view.executeQuery();
         return new EventResult(page);
    Well, the method [b]sess.getAttribute("CodPessoaEscola"); return null value, but the correct value passed in
    FunSessionVar (Project "A") is equal "180".
    Any body have a solution for this problem ?
    Thans,
    Danilo

    John, thanks for your help...
    The event parameters does not have null values, because if I write this command in the Pages of Project "A", the show values are correct:
    <flowLayout>
    <contents>
    CodPessoaEscola:
    <styledText data:text="text@getCodPessoaEscola" />
    </contents>
    </flowLayout>
    (The Data Provider return HttpSession variable of CodPessoaEscola).
    May be HttpSession variables have restrict scope inside Project ? Does the web.xml file have properties to configurations of this feature, before make deploy ?
    Thanks,
    Danilo

  • Using context variable in formcalc scripting language.

    Hi all,
             I wanted to know if it is possible to use context variables in formcalc. I wanted to use those variables in "if else" condition in formcalc scripting language. Please post the sample code also as i am new to adobe forms.
    Regards,
    Vinod

    Hi ,
    Each variable define in the context can be used on the layout of the form and/or in script linked to fields.
    This can be done in formcalc or in javascript language , without any problem . You have only to acess the correct variable in the script.
    For getting variable in a script you must define the complete name of the variable, example "Myform.Header.Data.Myvariable" get access to variable MyVariable define in the context under nodes Header/Data .
    Hope it's help you
    regards.

  • Get the name of session bean context variables

    With this lines I get the value of variable "discount":
    Context initial = new InitialContext();
    Context environment=(Context)initial.lookup("java:comp/env");
    Double discount = (Double)environment.lookup("Discount");
    but I need i know the name of the variable. How I get the names
    of context variables?
    Thanks in advance,

    For every form do like:
    <form name="searchForm" method=post action="/servlet/admin">
    <input type=hidden name="FormName" value="searchForm">
    Now req.getParameter("FormName") will return the name of the form.

  • Creating multidimensional Context Variable

    How can I create a multidimensional String array as a context variable and how can I pass values to that
    Thanks
    Fahad Hamsa

    WHat is a multidimensional String array ?
    If you require a String array , you can create a node of cardinality 0..n and a context attribute of type string
    Regards,
    Subramanian V.

  • Context variables

    Maybe I'm just missing something obvious here, but ...
    I have a JSP page that works fine under Tomcat, but it doesn't work under WebSphere.
    The JSP includes a couple of lines that retrieve context variables, as in:
    foobar=application.getInitParameter("foo.bar");In my web.xml file, there's a block that says:
    <context-param>
    <param-name>foo.bar</param-name>
    <param-value>plugh</param-value>
    </context-param>As I say, in Tomcat this works great. In WebSphere it looks like it just turns up null. Is there a differerent way to do this in WebSphere, or am I missing some subtlety?

    This functionality is detailed as part of the Servlet Specification, and as such should be implemented correctly by all J2EE containers.
    ie: It should work exactly the same under WebSphere.
    Maybe try the application.getInitParameterNames() method to see what websphere returns you?

  • Web app context variables?

    Hello all, I have another question. In my app I want all *.jsp pages to report how many currently active users are on my site. It could do this one of two ways (that i can think of),
    1) Run a count of how many sessions are in the 'sessions' table in my mysql db
    2) Read some sort of global context variable that is set everytime someone logs in
    Obviously 1) will be a smidgin more accurate but more labor intensive than 2. Can anyone think of a better way to do this? Also if i were to go the global variable route would there be a better way to do it than
    this.getServletContext().setAttribute("com.thesite.loggedin", 11)and then reading this int in the *.jsp(s), is something like this able to handle concurrent set & get (is it thread safe?)
    Thanks for any help!

    You can make use of attributeAdded() method of HttpSessionAttributeListener. Whenever any attribute is set in session, attributeAdded() method will be called and you can increment a counter in that method. Eg:
    public class SessionAttributeListener implements HttpSessionAttributeListener
    int count=0;
    public void attributeAdded(HttpSessionBindingEvent e)
         System.out.println("session attribute added");
                     count++;
    public int getCount()
    return count;
    }You can call SessionAttributeListener.getCount() method to count the number of active users.

  • OSB: Context variable changes for 'Reply' action

    HI,
    What are the differences between changes done by OSB to any of the context variables(body, inbound, outbound etc) when Reply with Success is used and Reply with failure is used.
    I have a Proxy service A consuming another proxy service B by RouteTo.
    When B has Reply with Success, A gets the response and fault does not get the generated within A.
    But when B has Reply with Error, fault gets generated within A.
    In both the cases,response xml that B is sending is same. So, what is that which makes fault generation within A. How would A know that fault is to be generated.
    Please help in understanding.
    TIA.
    Edited by: Ashish Rane on Dec 21, 2012 6:01 AM

    A Reply action will always return the content of $body variable as it is. The different between Reply with Success and Reply with failure lies in the content of transport headers being returned. In case of HTTP Service, if you do a reply with success, the calling service/application will received HTTP status code 200 or 0, which is a success status code for HTTP. In case of Reply with Failure, calling service/application will receive HTTP status code 500, which will enable the error handling in calling service/application to trigger. The best practice for SOAP based services is to always replace content of $body with a SOAP Fault when doing a Reply With Failure so that the calling application received details of fault (otherwise it just gets transport status code for failure but content of reply will still be original content of $body which might not indicate what the error was)

  • Package variable versus application context variables

    Any difference in using package level variables versus setting attribute value pairs in a session based context ?
    Thanks

    Packaged variable - can be used only by user having execute privilege on the package. Same user can modify the values of the packaged variable when logged on to the session.
    Context variable - It cannot be set by only mere value assignment, It needs to the call to a procedure(trusted program) to set the value, hence it is more secure.
    Both are global variables & can be accessed throughout the session.
    Regards,

  • Retrieve message context variables in xquery

    Hi All
    I would like to know if there is any way to retrive ALSB's message context variables ($header/$body/$inbound/etc) inside an external xquery resource
    for instance, I would like to declare a variable $envelope wich joins $header and $body variables, no matter which proxy service this xquery resource will be placed.
    is it possible?
    thanks in advance
    Edited by vitor.hirota at 12/21/2007 10:41 AM

    If by external XQuery resource you mean an XQuery stored in AquaLogic Service Bus rather than defined inline in the flow then the solution is to pass the details you need to the XQuery as parameters, in the same way as you would pass parameters to a method in another class if you were using Java.

  • Weird delay reading shared variables

    Hello,
    I'm working on a project were I'm monitoring some prodution lines. I'm using DSC module's OPC server to connect to PLCs on the production line and I've created bound variables on my labview project of the PLC's tags.
    On my project I have one main VI were I show information about the production lines and were I can access several subVIs were I show other information about those lines. Then I have a VI that is running in background were I'm reading about 50 shared variables from the PLC and where I'm registering some data in a MySQL database, datalogging data on the Citadel database and registering alarms.
    The problem I'm having is that on the VI that runs in background I noticed a delay reading the variables that are reading containers weights from the production line. It seems that all the other shared variables don't suffer any delay, only the weight variables start having some delay when the values are increasing. It also seems like that, when I'm only running that VI alone, without running the main VI, there isn't any kind of delay. I'm reading the shared variables as shared variable nodes.
    Can anybody help me understand what's happening and how can I fix this delay? The VI that runs in background is time critical and a weird delay like that messes up my data.
    Solved!
    Go to Solution.

    Hi Mateus23,
    The shared variable has various buffering capabilites, including integration with the Real-Time FIFO feature in LabVIEW Real-Time.
    I guess that the buffering settings are causing the unexpected behavior.
    Check these resources:
    Buffered Network-Published Shared Variables (whitepaper)
    Shared Variables Properties Dialog
       - Network Page
       - Real-Time FIFO Page
    ~~

Maybe you are looking for

  • How can I change the order of photos in albums on my iPad

    Hi everybody... When I place a folder with photos in it and sync it with iTunes on my iPad they are not in the order that I want to view them or play as a slideshow.  I've tried numbering the files in order, but that didn't work.  Is there away of do

  • How to get better resolution on Blu-ray (1080/60i)

    I'm experimenting with my new AG-AC160A camcorder and have been shooting youth hockey games in AVCHD mode, 1080/60i, 1/120 shutter, manual gain and white balance set appropriately, and florescent scene file setting due to lighting in rink. I have PP

  • Excise details

    hi, what are all the excise entries for vendor return? business cycle. Rgds raja

  • Active tab styles not loading

    Currently using the nightly 39.0a2 (2015-04-07) and my active tab styles are gone. I have no idea which tab is the currently opened one. I have tried with two different themes and same issue on both. Now tab mix plus offers active tab style but they

  • Content management portlet not showing images

    Hi all, sorry for asking a question maybe already answered, but I couldn't find a solution in the newsgroups. I'm trying to use the content management portlet provided with Bea WLP 8.1 SP4, but I've a problem with the images (they're not displayed at