Issue with Get_Selected_Rows Method

Hello Everyone,
I am using ALVs in my Project (OO Approach). I have two different ALVs on two different Screens. I am selecting some rows and clicking on a Button (PRINT) and performing the required action.
Everything is fine with the ALV on one Screen, but on the other Screen starts the problem.
When i click on the Button for the first time, get_selected_rows is returning the rows that have been selected, but when i come back and click on the Button for the second time it is returning empty rows. Even if i select different rows and click on the Button, the method still returns empty rows.
How come it works fine on one Screen and not on the other? Any idea of solving this issue?
Thanks in Advance,
r a m a . .

Haii All,
One small diference i could notice is: The Grid with which i am having the problem is placed in a Container of type CL_GUI_CUSTOM_CONTAINER, whereas the other Grid which is working fine is placed in a Container of type CL_GUI_CONTAINER. Ofcourse i tried to change the container to type CL_GUI_CONTAINER but still the problem persists.
Best regards,
r a m a . .

Similar Messages

  • Issue with addPartialTarget method (Pop-up window)

    Hi, I am facing an issue with addPartialTarget method (pop-up window case). Please refer the thread Re: popup dialog problem
    If we are using addPartialTarget method, should the managed bean be in session scope? I've set it is in request scope. It works fine with 1 user. But if we test with more than 1 user using HP mercury load runner, it is failing and giving the following exception related to partial target. What should be the solution for this issue? This is very urgent. Even after setting the managed bean in session scope, I am getting the same error as shown below:
    java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.get(Unknown Source)
    at oracle.adfinternal.view.faces.renderkit.core.ppr.PPRResponseWriter._popPartialTarget(PPRResponseWriter.java:223)
    at oracle.adfinternal.view.faces.renderkit.core.ppr.PPRResponseWriter.endElement(PPRResponseWriter.java:138)
    at oracle.adfinternal.view.faces.ui.ElementRenderer.postrender(ElementRenderer.java:81)
    at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.postrender(XhtmlLafRenderer.java:225)
    at oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:83)
    at oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:69)
    at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:346)
    at oracle.adfinternal.view.faces.ui.BaseUINode.render(BaseUINode.java:301)
    at oracle.adfinternal.view.faces.ui.composite.UINodeRenderer.renderWithNode(UINodeRenderer.java:90)
    at oracle.adfinternal.view.faces.ui.composite.UINodeRenderer.render(UINodeRenderer.java:36)
    at oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177)
    at oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53)
    at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)
    at oracle.adfinternal.view.faces.renderkit.RenderUtils.encodeRecursive(RenderUtils.java:54)
    at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:242)
    at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeAllChildren(CoreRenderer.java:265)
    at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:65)
    at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:117)
    at oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:102)
    at oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:60)
    at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.delegateRenderer(CoreRenderer.java:281)
    at oracle.adfinternal.view.faces.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:60)
    at oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:169)
    at oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)
    at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:645)
    at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:568)
    at oracle.adf.view.faces.webapp.UIXComponentTag.doEndTag(UIXComponentTag.java:100)
    at app.App__cusadd_jspx._jspService(_App__cusadd_jspx.java:3274)
    at com.orionserverhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:287)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
    at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
    at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.webcache.adf.filter.PageCachingFilter.doFilter(PageCachingFilter.java:274)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
    at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.3.0) .util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Unknown Source)

    duplicate
    Frank

  • Issue with a method call in a TaskFlow (works 2 times instead of 1)

    Hi guys,
    i'm using jdev11.1.1.1.2.0 and the integrated weblo or remote weblo 10.3.2.0.
    I'm encountering a problem with a method call which is invoked inside a Task Flow.
    Let me tell us the details of :
    I'm invoking a method call which is part of a Task Flow from the backingbean of the view which is placed before the method call in the taskFlow diagram.
    AN outcome String from the method of the backing bean allows to navigate to the method of the Task flow.
    The method call is called and works normally BUT MY PROBLEM IS THAT THE METHOD IS CALLED TWO TIMES SO THE RESULT IS FALSE.
    For information, the second time the method is called it takes care of the result when it is invoked the first time. So its parameters are updated and are a little different from the first time to the second time.
    NB : This method consists of inserting a row in the database. My result is 2 rows inserted instead of one.
    Thanks for help for this strange behaviour

    Hi
    create a temp calculated column
    =IF(ISBLANK([Duration]),"",[Item Start Date]+([Duration])
    and check if it's working OK
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Issue with get_selected_rows with ZCL_SALV_TABLE (done in se24)

    Experts,
    I'm facing a problem whereby I couldn't get the selected row. My requirement is to display an ALV. User will select a row and when click on the standard SAVE button, I will run some FM. I have created a custom class in SE24 for my program and I've coded my ALV display in a method and the selection of the rows in another method.
    THis is the code in my ALV creation method:
    method DISPLAY_ALV.
      DATA:
        lo_container TYPE REF TO cl_gui_custom_container,
        lt_rows      TYPE salv_t_row,
        lt_column    TYPE salv_t_column,
        ls_cell      TYPE salv_s_cell.
      gt_data[] = ct_table[].
      IF lo_container IS NOT BOUND.
          IF cl_salv_table=>is_offline( ) = if_salv_c_bool_sap=>false.
            CREATE OBJECT lo_container
              EXPORTING
                container_name = 'CONTAINER'.
          ENDIF.
      TRY.
        CALL METHOD cl_salv_table=>factory
          EXPORTING
            r_container    = lo_container
            container_name = 'CONTAINER'
          IMPORTING
            r_salv_table   = go_alv
          CHANGING
            t_table        = gt_data.
        CATCH cx_salv_msg.
      ENDTRY.
      ENDIF.
      gr_selection = go_alv->get_selections( ).
      gr_selection->set_selection_mode( if_salv_c_selection_mode=>row_column ).
      go_alv->display( ).
    endmethod.
    What I have for the code in the row selection method is
    method GET_ALV_SELECTION.
      DATA: lt_row TYPE salv_t_row.
       lt_row = gr_selection->get_selected_rows( ).
    endmethod.
    In my PAI, I code my user command for the SAVE button. Once pressed, I call method GET_ALV_SELECTION. I just can't seems to get the line selected. LT_ROW always return an empty table. I didn't code any event. Is that the cause?
    Thanks in advance.

    Let me rephrase my question. I have a report which display an alv which allow user to perform line selection. When user click on the SAVE button, I will run some process for the selected line. Initially, I can't even get the selected line to populate lt_row (pls refer code below). After I called method get_metadata(), then I was able to grab the row selection, but only for the first time, i.e. after I click on the SAVE button (to finish some processing) and select the row again, lt_row is empty again. Not even <<POINTA>> & <<POINTB>> is fired (pls refer code below).
    I have a method (METHOD A) to display my ALV as below (coded in SE24):
    DATA:
        lo_container TYPE REF TO cl_gui_custom_container,
        lt_rows      TYPE salv_t_row,
        lt_column    TYPE salv_t_column,
        ls_cell      TYPE salv_s_cell.
      gt_data[] = ct_table[].
      IF lo_container IS NOT BOUND.
          IF cl_salv_table=>is_offline( ) = if_salv_c_bool_sap=>false.
            CREATE OBJECT lo_container
              EXPORTING
                container_name = 'CONTAINER'.
          ENDIF.
      TRY.
        CALL METHOD cl_salv_table=>factory
          EXPORTING
            r_container    = lo_container
            container_name = 'CONTAINER'
          IMPORTING
            r_salv_table   = go_alv
          CHANGING
            t_table        = gt_data.
        CATCH cx_salv_msg.
      ENDTRY.
      ENDIF.
      gr_selection = go_alv->get_selections( ).
      gr_selection->set_selection_mode( if_salv_c_selection_mode=>row_column ).
      go_alv->display( ).
    Then, I have a method (METHOD B ) to process get the selected lines, as below (coded in SE24):
      DATA:
        l_error TYPE char1,
        l_msg   TYPE char50,
        lt_msg  TYPE fmtx_t_text_uab,
        lt_row  TYPE salv_t_row,
        lw_row  LIKE LINE OF lt_row,
        lt_temp TYPE zp2p_t_plnord_delete,
        lw_temp TYPE zp2p_s_plnord_delete.
      lt_temp[] = gt_data[].
      "<< POINT A >>
      go_alv->get_metadata( ).    ---> initially when i don't put this, I can't even get lt_row to display the selected line.
      lt_row = gr_selection->get_selected_rows( ).
      "<< POINT A >>
      IF lt_row IS NOT INITIAL.
        "do something
      ENDIF.
    "<< POINT B >>
      REFRESH: lt_row.
      gr_selection->set_selected_rows(
        EXPORTING
          value = lt_row ).
      "<< POINT B >>
      go_alv->set_data(
        CHANGING
          t_table = gt_data ).
      go_alv->display( ).
    And my PAI is as below (coded in SE80):
      CASE sy-ucomm.
        WHEN lc_save.
          IF g_empty IS INITIAL.
            go_object->process_data(
              IMPORTING
                et_log        = gt_log
                e_empty_table = g_empty ).
          ELSE.
            MESSAGE S000 WITH text-050.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    So, it seems like the row selection is only fired once in my method (METHOD B). Both <<POINTA>> & <<POINTB>> is also only work once. lt_row will always be empty if this method is called another time. Seems like I'm missing some instantiation. Please do help.
    Thanks in advance.

  • Issues with access method G.

    hello,
    i am using access method G,its working fine users are able to get the print outs , but the issue is in the windows selection box only ALL is highligted and they are not able to select the page numbers its disabled.
    and one  more issue is we have 2 printers one head office and site office.In head office printer they are able to take the print out along with their company logo but in the site office with same configuration and same kind printer logo is not being displayed .
    kindly suggest me for these issues.
    thanks in advance.
    regards,
    Divya

    Usually this means, that some necessary controls are not properly registered in the registry and hence can't be found. You may solve that by removing the SAPGUI from the PC completely, booting the machine and reinstall the GUI.
    Markus

  • Issue with CHECK_CHANGED_DATA  method of CL_GUI_ALV_GRID class

    HI,
    I want to check whether my grid has any changes or not, for that i am using the CHECK_CHANGED_DATA method of CL_GUI_ALV_GRID class,
    What i am doing is.... I am doing some changes in my grid data  and clicking on SAVE . This time  CHECK_CHANGED_DATA is saying the grid have changes ,and i am displaying a pop up whether to save the changes or not. And i am saving changes.
    Till now Fine.
    If i click on SAVE again CHECK_CHANGED_DATA is showing again the Grid has changes. 
    So how can i solve this problem.
    Thanks in advance.

    Hello Narendra
    If you do not need to do any validations of the changed ALV list data then you can use a very simple approach which does not even require an event handler for event DATA_CHANGED.
    The crucial part of the coding is shown below, followed by the entire sample report ZUS_SDN_ALV_EDITABLE_1A. Basically, the ALV list is stored as a "PBO" image of the data (GT_OUTTAB_PBO). And only if the user changed the data (i.e. GT_OUTTAB_PBO <> GT_OUTTAB) the save option including the popup is executed.
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      " NOTE: retrieve changed data from frontend (grid control) into
      "       the backend (itab in ABAP)
      go_grid->check_changed_data( ).
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'SAVE'.
          IF ( gt_outtab = gt_outtab_pbo ).
            MESSAGE 'No data changed' TYPE 'S'.
          ELSE.
            CLEAR: gd_answer.
            CALL FUNCTION 'POPUP_TO_CONFIRM'
              EXPORTING
    *             TITLEBAR                    = ' '
    *             DIAGNOSE_OBJECT             = ' '
                text_question               = 'Save data?'
              IMPORTING
                answer                      = gd_answer
    *           TABLES
    *             PARAMETER                   =
              EXCEPTIONS
                text_not_found              = 1
                OTHERS                      = 2.
            IF sy-subrc <> 0.
    *       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            IF ( gd_answer = '1' ).  " yes
              MESSAGE 'Data successfully saved' TYPE 'S'.
              gt_outtab_pbo = gt_outtab.  " update PBO data !!!
            ELSE.
              MESSAGE 'Action cancelled by user'  TYPE 'S'.
            ENDIF.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *& Report  ZUS_SDN_ALV_EDITABLE
    * Flow logic of screen '100' (no elements, ok-code => gd_okcode ):
    **PROCESS BEFORE OUTPUT.
    **  MODULE STATUS_0100.
    **PROCESS AFTER INPUT.
    **  MODULE USER_COMMAND_0100.
    REPORT  zus_sdn_alv_editable_1a.
    TYPE-POOLS: abap.
    CONSTANTS:
      gc_tabname       TYPE tabname  VALUE 'KNB1'.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knb1.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gt_fcat          TYPE lvc_t_fcat,
      gs_layout        TYPE lvc_s_layo,
      gs_variant       TYPE disvariant,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    DATA:
      gs_outtab        TYPE ty_s_outtab,
      gt_outtab        TYPE ty_t_outtab,
      gt_outtab_pbo    TYPE ty_t_outtab.
    DATA:
      gd_answer        TYPE c.
    START-OF-SELECTION.
      SELECT * FROM  (gc_tabname) INTO TABLE gt_outtab UP TO 99 ROWS.
      gt_outtab_pbo = gt_outtab.  " set PBO data
      PERFORM init_controls.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent = go_docking
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      " NOTE: not required
    *  set handler:
    *    lcl_eventhandler=>handle_data_changed for go_grid.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog.
      PERFORM set_layout_and_variant.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
          is_variant      = gs_variant
          i_save          = 'A'
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE:
    * Documenation of I_SAVE ("An Easy Reference for ALV Grid Control")
    *I_SAVE
    *Determines the options available to the user for saving a layout:
    *? 'X': global saving only
    *? 'U': user-specific saving only
    *? 'A': corresponds to 'X' and 'U'
    *? SPACE: no saving
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " INIT_CONTROLS
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      " NOTE: retrieve changed data from frontend (grid control) into
      "       the backend (itab in ABAP)
      go_grid->check_changed_data( ).
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'SAVE'.
          IF ( gt_outtab = gt_outtab_pbo ).
            MESSAGE 'No data changed' TYPE 'S'.
          ELSE.
            CLEAR: gd_answer.
            CALL FUNCTION 'POPUP_TO_CONFIRM'
              EXPORTING
    *             TITLEBAR                    = ' '
    *             DIAGNOSE_OBJECT             = ' '
                text_question               = 'Save data?'
    *             TEXT_BUTTON_1               = 'Ja'(001)
    *             ICON_BUTTON_1               = ' '
    *             TEXT_BUTTON_2               = 'Nein'(002)
    *             ICON_BUTTON_2               = ' '
    *             DEFAULT_BUTTON              = '1'
    *             DISPLAY_CANCEL_BUTTON       = 'X'
    *             USERDEFINED_F1_HELP         = ' '
    *             START_COLUMN                = 25
    *             START_ROW                   = 6
    *             POPUP_TYPE                  =
    *             IV_QUICKINFO_BUTTON_1       = ' '
    *             IV_QUICKINFO_BUTTON_2       = ' '
              IMPORTING
                answer                      = gd_answer
    *           TABLES
    *             PARAMETER                   =
              EXCEPTIONS
                text_not_found              = 1
                OTHERS                      = 2.
            IF sy-subrc <> 0.
    *       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
    *         Triggers PAI of the dynpro with the specified ok-code
            IF ( gd_answer = '1' ).  " yes
              MESSAGE 'Data successfully saved' TYPE 'S'.
              gt_outtab_pbo = gt_outtab.  " update PBO data !!!
            ELSE.
              MESSAGE 'Action cancelled by user'  TYPE 'S'.
            ENDIF.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = gc_tabname
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ls_fcat-edit = abap_true.
      MODIFY gt_fcat FROM ls_fcat
          TRANSPORTING edit
        WHERE ( key NE abap_true ).
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT_AND_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout_and_variant .
      CLEAR: gs_layout,
             gs_variant.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
      gs_variant-report = syst-repid.
      gs_variant-handle = 'GRID'.
    ENDFORM.                    " SET_LAYOUT_AND_VARIANT
    Regards
      Uwe

  • Issue with close() method of BufferedReader class and FileInputStream class

    I have written the following code to a text file, called hello,txt from Windows. Everything works fine but I am trying to figure out whether calling of close() method of aforemetioned class is appropriate or necessary thing to do.
    Here are the questions:
    1. Is it necessary to call close method in this senario? And why? [it seems to me that everything gets cleaned up automatically anyways at the end of each call to the method when called from main()]
    2. If the answer for No.1 is yes, then in which order each close method should be called? Or, does the order of calling close method matter anyways?
    3. Is the reason for why in No.1 is that because calling close method on each object is a necessary step to do when dealing with mutli-thread?
    Thanks for your help in advance!
          * Below is an example to clarify my questions
         void readWinFile() {
              File objFile = new File("hello.txt");
              FileInputStream fileStream = null;
              BufferedReader bfReader = null;
              try {
                   fileStream = new FileInputStream(objFile);
                   bfReader = new BufferedReader(
                                      new InputStreamReader(fileStream, "MS932"));
                   int tmp;
                   while ((tmp = bfReader.read()) != -1) {
                        System.out.print((char)tmpLine);
              } catch (FileNotFoundException e) {
                   System.err.printf("File: %s Not Found @ DIR = %s",
                                       objFile.getName(), objFile.getParent());
              } catch (UnsupportedEncodingException e) {
                   System.err.printf("Internal failure: %s", e);
              } catch (IOException e) {
                   System.err.printf("File: %s close failure", objFile.getName());
    *          } finally {*
    *               if (bfReader != null) {*
    *                    try {*
    *                         bfReader.close();*
    *                    } catch (IOException e) {*
    *                         e.printStackTrace();*
    *               if (fileStream != null) {*
    *                    try {*
    *                         fileStream.close();*
    *                    } catch (IOException e) {*
    *                         e.printStackTrace();*
    }Edited by: Jay-K on Feb 14, 2010 8:50 PM
    Edited by: Jay-K on Feb 14, 2010 8:52 PM

    Hello CeciNEstPasUnProgrammeur,
    Thank you for taking your time and doing all these write-up for me.
    CeciNEstPasUnProgrammeur wrote:
    Pretty much every native resource, most notably DB connections because those even remain open after the client process terminates. But ports or file handlers are similar; note that a JVM does not necessarily terminate just because you close your program in "extreme cases" (shared use of JVM). In an app server this is certainly never the way. And even if it does, as long as your app is running, the stuff is certainly never released.What you meant is that if my app runs on an app server, which shared the use of JVM with multiple apps, without properly closing ports or file handlers could cause JVM to keep retaining the native resource allocated for my app. In case of that, the resource leaks would occur.
    On the other hand, if my app runs on an app server, which do not share the use of JVM, the leaks would be less likely to happen even if the ports or file handlers are not manually closed. (It could be a very poor design but technically I could reply on their finalizers to clean up the mess)
    >
    Another misconception seems to be that objects are automatically GCed the moment they run out of scope. This is not true.Is there any documentation somewhere that you could refer me to? I would like to figure out why objects are not auto-GCed when they run out of their scope.
    >
    And lastly, objects should not rely on their finalizers to release native resources, and should rather provide close/release methods. This is a common paradigm, and that's also why releasing the file handle won't work by simply letting the reader instance run out of scope. Nobody notifies the underlying OS.I see, so the JVM here interacts with the underlying OS to acquire sufficient native resource for its apps to run. Without explicit closing, which would make JVM not to notify underlying OS to release acquired resource. Am I on the ball here?
    Thanks,
    Jay

  • Issue with addPrincipal() of Interface DocumentAcl

    Hi all,
    There is an issue with the addPrincipal(String id, String format, int idType) method of interface DocumentAcl which creates/sets readers for a document and validates them on identity management system.
    When I use this method for small number of readers say 3-10, readers are properly set for the document. However when I have a thousand users/readers for a single document the method throws OutOfMemory Error and does not add a single user for the document.
    I would like to add to above scenario that for a few documents (in my case for 40 documents) readers (all thousand) were properly set. Afterwards for each document I started getting OutOfMemory Error.
    Is it an issue with addPrincipal() method?
    Need your comments.
    I am using SES 10.1.8.
    Regards,
    Shakti

    Hi all,
    There is an issue with the addPrincipal(String id, String format, int idType) method of interface DocumentAcl which creates/sets readers for a document and validates them on identity management system.
    When I use this method for small number of readers say 3-10, readers are properly set for the document. However when I have a thousand users/readers for a single document the method throws OutOfMemory Error and does not add a single user for the document.
    I would like to add to above scenario that for a few documents (in my case for 40 documents) readers (all thousand) were properly set. Afterwards for each document I started getting OutOfMemory Error.
    Is it an issue with addPrincipal() method?
    Need your comments.
    I am using SES 10.1.8.
    Regards,
    Shakti

  • Issue with STO over delivery

    I am sure this topic has been taken up so many times before. I have browsed through almost all of them. I still do not have a way of restricting STO over delivery! Require your expertise!!.
    My requirement is that STO over deliver should not occur when using VL10* transactions alone.
    We tried to export a flag (say delv_flag)from program 'RVV50R10C'  to shared buffer and import the same into BADI LE_SHP_DELIVERY_PROC (DELIVERY_FINAL_CHECK) to capture error message when STO over delivery is created. The entire logic is built based on this flag alone.We are deleting the flag in V50R_MAIN of the program 'RVV50R10C'.
    There are some issues with this method:
    1. In some cases the delete flag statement gets executed before importing from memory and hence an STO over delivery gets created. (I don't know how or why!).
    2. When VL10* transaction is executed, the delivery flag is set. At this point in time, if the user tries to delete delivery without exiting the transaction, the BADI will get triggered and error message will be displayed. This is not correct functionality since error message should be displayed only for VL10* transactions.
    Suggestion:
    If I change the location of exporting the flag to include 'LV50R_VIEWF43' (form delivery_create), do you suppose it would work? Would Idocs trigger this?
    If anybody has worked on similar requirement please share your inputs. Urgent!!!!
    PS:
    I have read about delivery tolerances too "The overdelivery tolerance functionality is available only for the deliveries created with reference to sales orders and not for deliveries created with reference for PO's or STO's".

    Dear Sapna Morey
    I think OMCQ T.Code-- Select message M7--024 Change from Waring to error
    Please try once with this it may work To control over delivery tolarency in STO
    Dear  Lakshmipathi G sir
    i have one doubt please clear me sir please
    To control Over delivery tolarance in sap standard  is not available , then what is the use of the above one.
    Because i have searched a lot , i didnt find the logic about this
    Thanks a lot sir please help me sir
    Thanks

  • Issue with isMultiSelected

    Hi
    I have a scenario where I have to select two rows from ATable and one row from BTable.
    The issue with multiselected method is : It will always ignore the first row slection from the A table.
    i.e We are able to select the first row of the A table but while checking for the condition isMultiSelected(index) it is not taking into consideration the first row.
    Also the getleadselection method from the A table is always returning 1.Please see the code and help to find what the issue is.
    the output should be two rows selected from the A table but it gives only one row.i.e the second row from the A table.
    Also the the node to which the table is bound is having selection set to 0..n
    int size = wdContext.nodeATable().size();
    int leadA = wdContext.nodeATable().getLeadSelection();
    IBCDataNode BC = wdContext.nodeBC();
    for(int index = 0; index < size ; index++){
    if(wdContext.nodeATable().isMultiSelected(index) || leadA == index){
    IBCElement newdataE1 = cardata.createBCElement();
    newdataE1.setMake(make);
    newdataE1.setModel(model);
    BC.addElement(newdataE1);
    Please suggest.
    Thanks,
    Rajani
    Edited by: Rajani Nandagiri on Dec 22, 2008 9:06 AM

    Hi,
    Please find the code :
    public void setMultiMatchCarTable( )
        //@@begin setMultiMatchCarTable()
        int size = wdContext.nodeCarTable().size();
        int leadcar = wdContext.nodeCarTable().getLeadSelection();     
       wdContext.nodeCarTableData().invalidate();
        ICarTableDataNode cardata = wdContext.nodeCarTableData();
         log.printDebug("size nodeCarTable: "+size);
         int sizeTableCar = wdContext.nodeCarTable().size();
         for(int i=0; i<sizeTableCar;++i)
              if(wdContext.nodeCarTable().getLeadSelection()==i)
                   log.printDebug("cartable.setBodytype"+wdContext.nodeCarTable().getCarTableElementAt(i).getBodyType());
                   log.printDebug("Value of i"+i);
                   log.printDebug("lead selection -
    >"+wdContext.nodeCarTable().getLeadSelection());
              }else
                   log.printDebug("No Match");
         for(int index = 0; index < size ; index++){
              log.printDebug("leadcar :" +leadcar +"index" +index);
              log.printDebug("wdContext.nodeCarTable().isMultiSelected "wdContext.nodeCarTable().isMultiSelected(index)"index"+index);
                   if(wdContext.nodeCarTable().isMultiSelected(index) || wdContext.nodeCarTable().getLeadSelection() == index){
                  log.printDebug("wdContext.nodeCarTable().isMultiSelected"+wdContext.nodeCarTable().isMultiSelected(index));
                   log.printDebug("INSIDE IF : INDEX" +index);               
                   ICarTableDataElement newcardataE1 = cardata.createCarTableDataElement();
                   String make = wdContext.nodeCarTable().getCarTableElementAt(index).getMake();
                   String model = wdContext.nodeCarTable().getCarTableElementAt(index).getModel();
                   String version = wdContext.nodeCarTable().getCarTableElementAt(index).getVersion();
                   String bodyType = wdContext.nodeCarTable().getCarTableElementAt(index).getBodyType();
                   String year = wdContext.nodeCarTable().getCarTableElementAt(index).getYear();
                   newcardataE1.setMake(make);
                   newcardataE1.setModel(model);
                   newcardataE1.setVersion(version);
                   newcardataE1.setBodyType(bodyType);
                   newcardataE1.setYear(year);                    
                   cardata.addElement(newcardataE1);
         log.printDebug("wdContext.nodeCarTableData() after for loop"+wdContext.nodeCarTableData().size());
        //@@end
    This method is called on the action of button which will pass data from node CarTable to node CarTableDate.
    Please suggest.
    Thanks,
    Rajani

  • Issue with decision popup with yes/no combination

    hI,
    I'm having issue with create_popup_2_confirm method.I'm using yes no option in my popup.But when I click on yes button in the popup though OP_YES outbound plug is getting triggered of component GS_PTC, but not able to get any fired outbound plug in the closing event of popup i.e. event handler Save. CAn anybody help me on this?
    My code is as follows:
    popup = me->comp_controller->window_manager->create_popup_2_confirm(
    iv_title = lv_title
    iv_text = lv_text
    iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_yesno ).
    Then set a close event and open the popup :
    popup->set_on_close_event( iv_view = me
    iv_event_name = 'SAVE' ).
    popup->open( ).
    Code written in Save event handler
    CHECK POPUP IS BOUND.
    lv_confirm_result = POPUP->get_fired_outbound_plug( ).
    CHECK lv_confirm_result = 'YES'.
    Thanks & Regards,
    Anirban

    Hi Anirban,
    I checked the code and I dont think there is any issue.
    The only question I could think of is  ...
    has variable POPUP been declared globally in the SAME view ?
    The outbound plug name 'YES' is case sensitive.
    Regards,
    Masood Imrani S.

  • Issue with "firstRecord" Business Component method of JAVA Data bean API.

    Hi,
    Following is my use-case scenario:
    I have to add or associate child MVG business component (CUT_Address)
    with the parent business component (Account) using JAVA Data bean API.
    My requirement is: first to check whether child business component(i.e. CUT_address) exists. If it exists then associate it with parent business component (Account)
    otherwise create new CUT_address and associate it with account.
    Code (using JAVA Data bean APIs) Goes as follows:
    SiebelBusObject sBusObj = connBean.getBusObject("Account");
    parentBusComp = sBusObj.getBusComp("Account");
    SiebelBusComp parentBusComp;
    SiebelBusComp childBusComp;
    // retrieve required account.. Please assume Account1 exists
    parentBusComp.activateField("Name");
    parentBusComp.clearToQuery();
    parentBusComp.setSearchSpec("Name", "Account1");
    sBusComp.executeQuery2(true, true);
    sBusComp.firstRecord();
    Counter = 0;
    while (counter < Number_Of_Child_Records_To_Insert)
    childBusComp = parentBusComp.getMVGBusComp("City");
    associatedChildBusComp = childBusComp.getAssocBusComp();
    childBusComp.activateField("City");
    childBusComp.clearToQuery();
    childBusComp.setSearchSpec("City", Vector_of_city[counter]);
    sBusComp.executeQuery2(true, true);
    if( sBusComp.firstRecord() )
    // Child already exist and do processing accordingly
    else
    // Child does not exist and do processing accordingly
    childBusComp.release();
    childBusComp = null;
    associatedChildBusComp.release();
    associatedChildBusComp=null;
    Now the issue with this code is: For the first iteration, SbusComp.firstRecord returns 0 if records does not exist. However from the second iteration, SbusComp.firstRecord returns 1 even if there is no record matching the search specification.
    Any input towards the issue is highly appreciable.
    Thanks,
    Rohit.

    Setting the view mode to "AllView" helped.
    Thanks for the lead!
    In the end, I also had to invoke the business component method SetAdminMode with "true" as the argument so that I could also modify the records from my script.

  • SubmitGenerateReportAsync Issue. Await operator can only be used with Async Method

    Hi,
    I am trying to submit a request to download keyword performance report using following .
     var reportId =await SubmitGenerateReportAsync(reportRequest); its giving me error 
    The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
    Here is the SubmitGenerateReportAsync method. I am already using async in definition. Not sure what else is wrong.
     private async Task<string> SubmitGenerateReportAsync(ReportRequest report)
                var request = new SubmitGenerateReportRequest
                    ReportRequest = report
                return (await Service.CallAsync((s, r) => s.SubmitGenerateReportAsync(r), request)).ReportRequestId;
    Same issue with PollGenerateReportAsync
     reportStatus =await PollGenerateReportAsync(reportId.ToString());
      private async Task<ReportRequestStatus> PollGenerateReportAsync(string reportId)
                var request = new PollGenerateReportRequest
                    ReportRequestId = reportId
                return (await Service.CallAsync((s, r) => s.PollGenerateReportAsync(r), request)).ReportRequestStatus;
    Let me know if its easy fix.

    I fixed the link to our
    code example which shows how to run such a report from the console. You would create async methods, run, and wait from within Main.
    /// <summary>
    /// The entry point for the console application.
    /// </summary>
    /// <param name="args">Arguments are not required for this example.</param>
    public static void Main(string[] args)
    var example = new KeywordPerformance();
    Console.WriteLine(example.Description);
    try
    var authentication = new PasswordAuthentication(
    "<UserNameGoesHere>",
    "<PasswordGoesHere>");
    // The OAuthHelper class is available for download with the BingAdsExamples solution.
    // OAuthDesktopMobileImplicitGrant authentication = await OAuthHelper.AuthorizeImplicitly();
    var authorizationData = new AuthorizationData
    Authentication = authentication,
    CustomerId = <CustomerIdGoesHere>,
    AccountId = <AccountIdGoesHere>,
    DeveloperToken = "<DeveloperTokenGoesHere>"
    example.RunAsync(authorizationData).Wait();
    catch (Exception ex)
    Console.WriteLine(ex.Message);
    Best regards,
    Eric

  • Issue with a resultSet.wasNull() method

    Hello all
    I'm having a small issue with a resultset, basically i wanna test if it returns a null value but it does not seems to work.
    Its a simple application that pulls football matches data out of a database base on the provided data.
    This is my code, i would like to first say that, connectivity works fine, database existing, tables existing, if correct data's are inserted the application fetches the data with no problem.
    public void getMatch(GregorianCalendar cal){
    java.sql.Date sqlDate= new java.sql.Date(cal.getTimeInMillis());
    try{
    String resultMatch="SELECT resultMatch FROM matches WHERE date=?";
    PreparedStatement pre=connection.prepareStatement(resultMatch);
    pre.setDate(1,sqlDate);
    ResultSet resMatch=pre.executeQuery();
    if(resMatch.wasNull()){
    System.out.println("No data found");
    } else {
    System.out.println("Show all datas");
    }//rest of code
    } catch(SQLException e){
    }//rest of code
    the problem arises now, if i enter a data that its in the DB, its fine, all data's are pulled out and printed (via while(resMatch.next()........))
    If i enter a non existing data....nothing comes out, not even an exception.
    Any advice?
    Thx

    enrico wrote:
    This is my code, i would like to first say that, connectivity works fine, database existing, tables existing, if correct data's are inserted the application fetches the data with no problem.The code posted does not do that.
    >
    public void getMatch(GregorianCalendar cal){
    java.sql.Date sqlDate= new java.sql.Date(cal.getTimeInMillis());
    try{
         String resultMatch="SELECT resultMatch FROM matches WHERE date=?";
         PreparedStatement pre=connection.prepareStatement(resultMatch);
    pre.setDate(1,sqlDate);
         ResultSet resMatch=pre.executeQuery();
    if(resMatch.wasNull()){There is no way that the above code returns 'data' from the database.
    A result set represents a collection of zero or more rows.
    One must first retrieve a row before doing anything with it.
    The above code does not call next() so it absolutely does not retrieve any rows.
    The JDBC tutorial might help.
    http://download.oracle.com/javase/tutorial/jdbc/basics/

  • Issue with creation of a specific field for a java program.

    Hey everyone,
    This is homework which is end of chapter "challenges" to practice what we've learnt.
    The chapter covers inheritance (super class and all things related)
    I'm having quite an annoying issue with the very beginning of the instructions, where it tells me to make the following fields:
    - Employee name
    - Employee number in the format XXX-L , where each X is a digit within the range 0-9 and the L is a letter within the range A-M.
    - Hire date
    This is what I wrote for code so far
    private String name;
    //private WTF
    private String date;I really have no idea what to do for the second field, how to even constrain integers and letters in the same field with a rule for number range and letter range, and that for each character independently, for what I understand.
    Any advice with this? It's blocking me from continuing -_-, because I can't make accessors and mutators and constructors, etc, if i'm still unsure of how the fields unfold.
    Thanks in advance.

    You can create a HireDate class.
    public class HireDate{
       private final int day;
       private final String month;
       private final int year;
       public HireDate(int day, String month, int year){
          this.day = day;
          this.month = month;
          this.year = year;
    }In the HireDate Constructor you could put if statements to ensure that only correct information is present. The fields are final because the hire date will not change. Override the toString() method so that when you print it out it will be in the correct format. Create some getter methods to get the private fields.
    Then in your other class just do this
    HireDate hired = new HireDate(10, July, 1991);Now you have an object that stores all 3 fields for you. You can use the object as you like and when it prints it will be in the format you want.
    Or you could just make hireDate a String variable. That is what I always did and I never lost marks for it. The reason I suggest this way is because you mentioned rules and constraints.

Maybe you are looking for