How to get current view name on clicking device back button?

Hi,
iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
code samples will be helpful.
my app.controller.js looks like below
sap.ui.controller("com.opensap.App", {
  onInit : function() {
  document.addEventListener("deviceready", onDeviceReady, false);
  onBeforeShow : function(evt) {
  navButtonTap : function(evt) { 
function onBackKeyDown(){
  //alert("hai");
  //sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
  //sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
  //sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
function onDeviceReady(){
   document.addEventListener("backbutton", onBackKeyDown, false);

I somehow managed to find the solution
function onBackKeyDown(){
  var app = sap.ui.getCore().byId("LoginDetail").app;
  app.back();

Similar Messages

  • How to get the values retained on clicking the back button in jsp page

    Hi All,
    I had two jsp's search and results. In the search page when i enter some values in the text fields, the rsults will be displayed for that search criteria. I had a back button in the results page. When i click on this back button i will get back to my search page. I am using the following code for this back button.
    <INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1)" class="button">
    Now the problem is when i get back to search page using this back button, i am not able to get the values in the search page which i entered, i am getting all blank values. What should i change to get these values back in the search page. Should i maintain any sessions for this?

    You have no control at all over the back button process. To the server, it's indistinguishable from the user simply tying the URL of your search page. So, you need to store this data server side*.
    When your search page is submitted and processed, store the values you received for each of the fields into the user's session. Then, when the search page is generated, check the session for these values, and for any values that are not null, put their values into the html as the default values for the textboxes and controls you are using. This lets you handle the whole matter on the server's side.
    *barring convoluted, unportable, black-magic javascript trickery which you should definitely avoid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get current function name?

    Hello, everyone!
    I want to get the current function name for debug purpose. I simply want to dump out current class name, function name (and better line number) of current executing statement. For example, I can embed my debugger inside my source codes if I can get the current function name as the following,
    <code>
    class foo
    void function goo()
    //operations
    myDebugger (getCurrentFunctionName(), informationString)
    </code>
    Then my debugger will have richer information which indicates in which function information is dumped. Have I made myself understood? If Java does not have such apporach to get current function name automatically, I have to define a function local variable which contains function name manually in each function I want to debug. And pass the variable to my debugger which seems rather silly.
    Can anyone help?
    Thanks in advance,
    George

    To elaborate a little: be sure to read the API on getStackTrace: because of JVM optimization
    there may be missing stack trace info, so look before you leap:
    public class Client {
        public static void main(String[] args) {
            f();
        static void f() {
            Debugger.log("testing");
    class Debugger {
        public static void log(String msg) {
            StackTraceElement[] trace = new Throwable().getStackTrace();
            if (trace.length >= 1) {
                StackTraceElement elt = trace[1];
                System.out.println(elt.getFileName() + ": " + elt.getClassName() + "." +
                    elt.getMethodName() + "(line " + elt.getLineNumber() + "): " + msg);
            } else
                System.out.println("[UNKNOWN CALLER]: " + msg);
    }

  • BDC - How to ignore skipped screens when user click on back button

    Hello all,
    I am working on a module pool program. From this custom transaction I am calling a standard SAP screen using BAC call transaction. I am calling this screen by skipping 2-3 screens and user can directly see the 3 screen on an event on my custom transaction.
    Now my issue is whenever the user want to back, he clicks on back button then user have to back from all the screens that I skipped.
    Is this any way by which if user click on back then he can directly go to my custom transaction.
    Please suggest.
    FYI..
    I am calling IA06 - Inspection characterstics screen from my custom screen using BDC.
    Thanks,
    Sanket Sethi

    Hi Jovito,
    I also think the same that it's not possible. Now my issue is how to get my requirement.
    FYI..
    To open Classification screen directly we have a function module CLFM_OBJECT_CLASSIFICATION. But if I want to open IA06
    Inspection characterstics screen we don't have any FM or API to do the same.
    So how will I get my requirement done. That why I use the BDC call transaction to open IA06 Insp. characterstics screen but here I am facing this Back issue.
    Please advice if there is any suggestion.

  • Issue of data getting wiped out when user clicks on back button..

    Hello Gurus,
    I have a selection program which displays ALV on execution. Now I have programmed the "Back" Button of standard toolbar so that when comeone clicks on it, it should leave to selection screen.
    WHEN 'TBACK'.
          LEAVE TO TRANSACTION SY-TCODE.
    But when I do that, the values entered by user during execution of selection screen wipes out and all the selection fields become empty. How can I make sure that when sure clicks on 'Back' button, the selectiuon screen is presented but with values in which user put during execution.
    Regards,
    Rajesh.

    Hi Rajesh ,
    Leave to transaction sy-tcode is as as good as call transaction...so basically using this statement will start the transaction afresh..and give a new selection screen....
    Better option would be to leave to screen 0 (preferaby used for a report )which will take you back to the previous screen processed or leave to screen XXXX for a particular screen( in case of a module pool )
    Hope it helps
    Regards
    Byju

  • How to get current tab name or tab id or related info?

    Hi ,
    I would like to hide/show tabs according to users' page privileges list. So I need get current tab ID or tab Name in runtime environment to know if show/hide it for current user. :APP_USER
    Could you please provide any info about this requirement? Or do you have alternative method to control tabs' hide/show?
    thanks
    Ruiping

    最爱用中文 wrote:
    Hi Jari,
    Thanks for your info. Even if set authorize schema to tabs, I still need to get the relationship between "current tab" and "privilege&users". So I think evrm's hard-code method above is avaliable.I agree with Jari: APEX provides Authorization schemes specifically for this purpose. You need to reverse your thinking on how to implement this.
    For more information consult the documentation on APEX security, specifically using authorization schemes to restrict access to pages and control rendering of components.
    Tutorial: Adding Security to your Database Application (APEX 4.0)
    Use Authorization Schemes to control access/rendering for security ("only managers see/access this page and it's associated tab"); and Conditions to control rendering for functional reasons ("region only displayed if account is in arrears").
    Authorization Schemes have the benefits of being reusable, performing better, and allowing central maintenance of security-related code. This makes it easier to change the implementation&mdash;say moving from role information held in database tables to groups defined in LDAP.
    I worked for a number of years with an application where authorization schemes are not properly used (decisions made before my involvement) and all security and business logic relating to rendering and processing is wrapped up in spaghetti code in conditions. It's impossible to maintain.
    It is of course advisable to make both authorization scheme and business logic condition code more reusable and maintainable by locating it in API packages.

  • How to get current viewed task

    For an external synchronization requirement I need to maintain or be able to retrieve the current viewed task by a user. I'm hopeful that this has been solved before. Does anyone have any insight there? I'm considering setting up a table to maintain the current viewed taskid for the user, but even that is proving challenging with my lack of ADF exposure. I see the 'TaskSelectedEvent' in the wizard generated task form I'm using but I'm not sure how I might leverage that.
    Any help is appreciated.

    Yes. there is no API to get the current task.
    Try this:
    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("wi_id");
    But i still say a bit confused with your requirement.
    The task id gets created only upon creation of a task. And you want this current task id in the BPM Process context? How is it possible unless and until some action takes place and the data is passed from WDJ to BPM Context?
    Please clear my doubt.

  • How to get the view name by passing the window name from table

    Hi All,
    would like to knew about the standard table from which we want to "retrieve the VIEW name by passing WINDOW name"
    as we have standard tables like WDY_WINDOW, WDY_VIEW,WDY_APPLICATION but our ZComponent details
    are not updated in this WDY_WINDOW table.
    Is there any other table exists on the above condition
    Regards
    Jaipal.E

    Hello friend,
    There are many structure names started with WDY_WB_VC*where the details of the windows and views are stored just search those structures and see where its getting the tables in run time so that you can get the source tables.
    I think this will be useful for you.
    Thanks,
    Sri Hari

  • How to get the view in editable mode with OCA button.

    Dear Experties,
    I am new to CRM WEB UI ,I have got the requirement to develope a view with OCA button on it and when i click on the button it should direct to the second view  and it should open with edit mode.
    The Source view is table type and target view is form type.
    I am able to achieve this but unable to get it in editable mode.
    I have added the below code in do_prep_output method but getting dump  at the line
    lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_first( ).
    The error message is
    Long text During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The source type '\CLASS=CL_BSP_WD_MIXED_NODE' is not compatible for assigning with the target type '\CLASS=CL_CRM_BOL_ENTITY'.
    Please somebody help me on this
    lv_display = me->view_group_context->is_view_in_display_mode( me ).
      IF lv_display EQ abap_false.
      ELSE.
         me->view_group_context->set_view_editable( me ).
      ENDIF.
      DATA:    lr_tx           TYPE REF TO if_bol_transaction_context,
              lr_entity       TYPE REF TO cl_crm_bol_entity,
               lr_comp type REF TO ZL_BT131QI__BSPWDCOMPONEN_IMPL.
      lr_comp ?= me->comp_controller.
      Check lr_comp is BOUND.
      lr_entity ?= lr_comp->typed_context->BTADMINI->collection_wrapper->get_current( ).
      CHECK lr_entity IS BOUND.
      IF lr_entity->lock( ) = abap_true.
        me->view_group_context->set_view_editable( me ).
      ENDIF.
      lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_first( ).
      WHILE lr_entity IS BOUND.
        lr_entity->lock( ).
        lr_entity ?= me->typed_context->EMAINLEG->collection_wrapper->get_next( ).
      ENDWHILE.
    The following error text was processed in the system:
    Source type \CLASS=CL_BSP_WD_MIXED_NODE is not compatible, for the purposes of assignment, with target type \CLASS=CL_CRM_BOL_ENTITY
    Exception Class CX_SY_MOVE_CAST_ERROR
    Error Name MOVE_CAST_ERROR
    Program ZL_ZBT131QI_EMAINLEG_IMPL=====CP
    Include ZL_ZBT131QI_EMAINLEG_IMPL=====CM00C
    ABAP Class ZL_ZBT131QI_EMAINLEG_IMPL
    Method EH_ON_EDIT
    Line 33 
    Long text During a 'CAST' operation ('?=' oder 'MOVE ? TO')a type conflict occurred. The source type '\CLASS=CL_BSP_WD_MIXED_NODE' is not compatible for assigning with the target type '\CLASS=CL_CRM_BOL_ENTITY'.
    Thanks in advance!!!

    Hi,
    in CRM a context can consist of model nodes,  value nodes and, unfortunately, mixed nodes. While mixed nodes implement the same interface as model nodes they can't be casted into a CL_CRM_BOL_ENTITY directly. Instead you need to perform the following conversion in order to get the model node from the mixed node:
    DATA:  mixed_node     TYPE REF TO cl_bsp_wd_mixed_node,
               entity              TYPE REF TO cl_crm_bol_entity.
    mixed_node = me->typed_context->EMAINLEG->collection_wrapper->get_first( ).
    entity = ?= mixed_node->if_bsp_wd_ext_property_access~get_model_node( ).
    Best,
    Christian

  • How to call custom BSP application on click of BACK button for SC in EBP.

    Hi All,
    We are implementing OCI using custom BSP applications.In EBP SC screen ,in step1 (Select Goods/Services), the links for these BSP applications are displayed.
    The user can create a shopping cart using these applications , after the items are transfered from BSP to SC on standard  EBP screen , in step2
    there are four buttons ,
    1)Refresh
    2)Check
    3)Back
    4)Continue.
    We need to call one of our custom BSP applications on click of  this BACK button
    How can i acchieve the same?
    Do i need to make changes in the standard ITS application or thers some other way?
    Thanks,
    Anubhav.
    Edited by: Anubhav Jain on Jul 1, 2008 7:24 AM

    To call a wd abap application from BSP use the method CL_WD_UTILITIES=>CONSTRUCT_WD_URL then just create a link in bsp with the url returned like this:
    <a href="url">Link</a>
    To pass data from wd abap to bsp or vice versa that a look at this blog: /people/koen.labie2/blog/2006/11/29/eating-cookies-with-webdynpro-and-bsp
    regards,
    Fabio Louzada Saito

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to get the function name/ID  of the current page

    HI,
    I searched the forum and google, but it is not clear on how to get the function name of the current page.
    I have 4 functions in my self service A ,B,C,D (seeded page links ) they all have to go to a page called hhhPG. Based on which function user is clicks I have to show the data in hhhPG.
    so my question is how to get the function name ? I mean I need to know if user click on link A , B, C or D link and came to this page.
    I found below in one forum and also there is getfunctionID in pageContext , but I do not know what to pass to getfunctionid("???") to get value.
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    Or is there a better way of know where user is coming from ? like geturl....
    Please help, I need this ASAP.
    Thank you.

    Use below to find out how the user came into the page
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    boolean isFunc1 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME1"));
    boolean isFunc2 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME2"));
    boolean isFunc3 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME3"));
    boolean isFunc4 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME4"));
    So one of them will be true based on the function the user came in.
    Write your logic based on these flags.
    Regards,
    Peddi.

  • How to get Current Log in BO user name in data access driver

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    Shweta,
    The link you provided was the Auditor guide for BO 6.x, I'm not sure it that is going to help Karen or not.
    Karen,
    There is function called connection
    (usage:  =connection([Query Name]), where [Query Name]
    denotes the name of the tab for the query under Edit Query)
    Here is some of the output from connection:
    4;ODBC18;MS SQL Server 2000166; VERSION=7; USER=xxxxx;
    PASSWORD=; DBTYPE=Relational; DATABASE=xxx_xxxx;
    ODBC_USER=xxxxxx; ODBC_PASSWORD=; BO_DSN=xxxx_xxxx;
    BO_DRV_CONNECT_MODE=0; 224; VERSION=6; Name=xxxxx; Shared=4;
    LoginTimeout=600; Timeout=600; Pool Time=60; Array Fetch Size=10;
    Array Bind Size=5; RecommendedLenTransfert=1000; Password_Encryption=x;
    AliasTable=; MeasureDimension=; Hint=; ConnectInit=; ArrayFetch=1;
    I'm not sure if this info helps out either, being that connection provides info on a post-processing basis and it sounds like you need to get out ahead of the SQL generation.  The @variable('bouser') would seem like the place to be, however, in allowing custom SQL to take place you loose the bouser due to an individual could customize the SQL to the point that it gets unwantingly yanked out.  The end_sql might be your answer...
    Thanks,
    John

  • How to get current logged-in user name in data access driver or in universe

    In universe, to get the current log in user is via @Variable('BOUSER').
    Right now, I need to be able to get the user name in the data access driver. I am writing a customized data access driver because we need to patch some where clause on the the query generated by the universe based on the logged-in user info. I only think of using end_sql parameter or adding an universe level filter to patch the @Variable('BOUSER') to the query, which would not work if user want to use customized query.
    Can anyone tell me how to get currentBO user name from connection server ? or how @Variable('BOUSER') is translated into the logged-in user name in the universe?

    I do not know your EJB Service. But you should pass the credentials of the current logged on portal user to your service. That's not by default I think.
    I had a similar problem with CAF developed webservices. I had to turn on permission checks in my web service and passed the credentials via logon ticket.
    Regards, Bernd

  • How to get the specific name of the workset which is currently selected by the user in sap portal 7.0

    Dear Expert,
    I have one requirement like to read the selected workset name in portal by the current user.I have read two documents regarding how to retrieve the PCD contents (iViews, Pages, Worksets and Roles) and its properties like Created by, Changed by, Last changed by and others using PCD API.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508baf88-9335-2d10-efa6-c6ad61e5fc4b?quicklink=index&overridelayout=true
    But I am not able to understand how to get the specific name of the workset which is currently selected by the user.Can you please help me.
    I am using portal 7.0.
    Thanks & Regards,
    Patralekha

    Hi Expert,
    I found that we can use Interface INavigationHelperService to read Portal Role selected by user at runtime from http://scn.sap.com/thread/52194
    But this class is available in SAP NetWeaver 7.30 Enterprise Portal .
    But in SAP NetWeaver 7.0 Enterprise Portal that interface is not available.
    INavigationService is available there.
    But didn't get any proper discussion on this interface for the same requirement.
    Can you please help me.
    Thanks & Regards,
    Patralekha

Maybe you are looking for

  • Problem in String Search using OKAPI in 9i Lite

    We are creating an Symbian EPOC application using Oracle 9iLite in stand-alone mode. We have managed to create a C++ program that creates an Oracle database on the Nokia Communicator 9210. The problem is that a string search returns either null or al

  • How to print date with prefix in oracle reports?

    Hi Everyone, Please help to get solution for this problem. How can we generate View image: oracle Reports in Oracle Reports RDF ? we can print date , but i want to print date and st in smaller case and in top right side of date. for eg  31st   st sho

  • Attachment lost in BPM

    Hi Experts, we upgraded from PI 7.0 to PI 7.1 At 7.0 we had one scenario where a message with an attachment was received in a Business Process and later send via ABAP proxy to a SAP ECC. On 7.1 this is not working anymore, we just see the attachment

  • Problems when starting up my Mac Pro

    Hi all, When I start up my Mac Pro (2.66) it the light on the mac will turn on but there is no chime, no display. The second time I start up the Mac it chimes and the display runs up to the grey screen but then it pauses and a fan (don't know which o

  • Where do previews go when deleted

    When I upgraded to 1.5 I had aperture make previews of my library of about 12000 images. The size of my library jumped and I decided I did not want the previews after I learned I had little use for them (slideshows were fast enough on dual processor