ALV - How to set selected rows into internal table

Hi all,
I am tying to set with an 'X' flag the selected rows in my ALV using an internal table that contains all rows showed.
More exactly I have tried to follow these steps.
1) I have added the filed SEL (type SEL) to my ALV structure zrt_bo_slabsend and I defined my internal table in this way
     DATA: gt_report TYPE STANDARD TABLE OF zrt_bo_slabsend,
                gw_report TYPE zrt_bo_slabsend.
2) I have set gw_layo-box_fname = 'SEL' to gw_layo (ALV layout)
Pressing the "delete button" that I have insert on the top of the ALV, I intercept correctly my user command and I call a form (named "delete_lines") where I have this abap code
FORM delete_lines.
    DATA: l_subrc          LIKE sy-subrc,
        lw_grid_settings LIKE lvc_s_glay.
gw_layo-box_fname         = 'SEL'.
                                 "set field name to store row selection
  gw_layo-edit              = 'X'. "makes whole ALV table editable
  gw_layo-zebra             = 'X'.
gv_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY_LVC'
  exporting
      i_callback_program       = gv_repid
     i_callback_pf_status_set = gc_status
     i_callback_user_command  = gc_user_command
     is_layout_lvc            = gw_layo
     it_fieldcat_lvc          = gw_fkat
     i_grid_settings          = lw_grid_settings
      i_save                   = 'X'
      is_variant               = variant
      it_events                = gt_events
    TABLES
      t_outtab                 = gt_report
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.
  LOOP AT gt_report ASSIGNING <report> WHERE SEL = 'X'.
    DELETE gt_report.
  ENDLOOP.
ENDFORM.
I'd like to select many rows in my ALV report, than by pressing the delete button I'd like to see a refresh of my ALV, without the selected rows. I want to save it only at the end of my action, only by pressing the save button.
Any suggestion about the abap code will be well appreciated.
Thanks in advance for your kind help.
Regards.
    Giovanni

Hi Giovanni,
I am using the method:-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                =
*   I_BUFFER_ACTIVE                   =
   I_CALLBACK_PROGRAM                = gd_REPID
   I_CALLBACK_PF_STATUS_SET          = 'UDIT'
   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
*   I_CALLBACK_TOP_OF_PAGE            = ' '
*   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*   I_CALLBACK_HTML_END_OF_LIST       = ' '
*   I_STRUCTURE_NAME                  =
*   I_BACKGROUND_ID                   = ' '
   I_GRID_TITLE                      = 'Mainatin cell entry'
*   I_GRID_SETTINGS                   =
   IS_LAYOUT_LVC                     = GS_LAYOUT
   IT_FIELDCAT_LVC                   = I_FIELDCAT[]
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS_LVC             =
*   IT_SORT_LVC                       =
*   IT_FILTER_LVC                     =
*   IT_HYPERLINK                      =
*   IS_SEL_HIDE                       =
   I_DEFAULT                         = 'X'
*   I_SAVE                            = 'X'
*   IS_VARIANT                        =
   IT_EVENTS                         =
   IT_EVENT_EXIT                     =
*   IS_PRINT_LVC                      =
*   IS_REPREP_ID_LVC                  =
   I_SCREEN_START_COLUMN             = 30
   I_SCREEN_START_LINE               = 14
   I_SCREEN_END_COLUMN               = 120
   I_SCREEN_END_LINE                 = 25
*   IT_EXCEPT_QINFO_LVC               =
*   I_HTML_HEIGHT_TOP                 =
*   I_HTML_HEIGHT_END                 =
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER           =
*   ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          = IT_ZCP_DEMAND_SYS1
* EXCEPTIONS
*   PROGRAM_ERROR                     = 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.
I have made five buttons on my toolbar (add, delete, save, back, exit).
Kindly tell me how can I catch the sy-ucomm of these buttons.
NOTE: this FM is written inside an user-exit, so I cannot make forms.
Thanks in advance.

Similar Messages

  • Get Multiple Rows into internal Table using Webdynpro Alv Display ..

    Hi guys ,
    I need to find out the logic for getting all the selected rows into the internal table.
    When i display the ALV Output on webdypro screen .
    USer Selects multiple rows for further processing ..
    Ineed to get all the rows selected by user into an internal table .
    Please let me know how to achive this ...
    Thanks in advance for quick reply
    Regards
    Saurabh Goel

    Hi,
    You need to use the method GET_SELECTED of IF_WD_CONTEXT_NODE to get the rows selected. Also ccheck for the paramters of that method, this retruns the element set.
    This meets your requirement.
    Regards,
    Lekha.

  • How to get editable data into internal table

    Hi ABAPers,
    I am displaying REUSE_ALV_GRID_DISPLAY report with one editable field and i have post button in report. Once i select post button i need to get editable data to internal table which i passed to REUSE_ALV_GRID_DISPLAY.
    actually i am writing below code but data is not coming to internal table.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                          =  sy-repid
         i_callback_pf_status_set                  = 'PF-STATUS'
         i_callback_user_command               = 'USER_COMMAND '
         it_fieldcat                                        = t_field[]
         i_default                                          = 'X'
        TABLES
          t_outtab                          =   <fs_display1>.       "t_display
    FORM user_command USING g_ucomm LIKE sy-ucomm
                   rs_selfield TYPE slis_selfield.
      g_test1 = g_ucomm.
      CASE g_ucomm.
        WHEN 'POST'.
          READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1.    "Just for testing index 1
          IF sy-subrc = 0.
            w_display = <fsw_display1>.
            APPEND w_display TO t_display.
            CLEAR : w_display.
          ENDIF.
          PERFORM v1.
          PERFORM bapi_call.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Please help me how to get.
    Regards,
    Raju.

    Hi,
    Try the following:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_callback_pf_status_set = 'PF-STATUS'
    i_callback_user_command = 'USER_COMMAND '
    it_fieldcat = t_field[]
    i_default = 'X'
    TABLES
    t_outtab = <fs_display1>. "t_display
    FORM user_command USING g_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    g_test1 = g_ucomm.
    CASE g_ucomm.
    WHEN 'POST'.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    READ TABLE <fs_display1> ASSIGNING <fsw_display1> INDEX 1. "Just for testing index 1
    IF sy-subrc = 0.
    w_display = <fsw_display1>.
    APPEND w_display TO t_display.
    CLEAR : w_display.
    ENDIF.
    PERFORM v1.
    PERFORM bapi_call.
    ENDCASE.
    ENDFORM. "USER_COMMAND
    Hope it helps.
    Regards,
    Gilberto Li

  • How to convert xml file into internal table in ABAP Mapping.

    Hi All,
    I am trying with ABAP mapping. I have one scenario in which I'm using below xml file as a sender from my FTP server.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MTO_ABAP_MAPPING xmlns:ns0="http://Capgemini/Mumbai/sarsingh">
      <BookingCode>2KY34R</BookingCode>
    - <Passenger>
      <Name>SARVESH</Name>
      <Address>THANE</Address>
      </Passenger>
    - <Passenger>
      <Name>RAJESH</Name>
      <Address>POWAI</Address>
      </Passenger>
    - <Passenger>
      <Name>CARRON</Name>
      <Address>JUHU</Address>
      </Passenger>
    - <Flight>
      <Date>03/03/07</Date>
      <AirlineID>UA</AirlineID>
      <FlightNumber>125</FlightNumber>
      <From>LAS</From>
      <To>SFO</To>
      </Flight>
      </ns0:MTO_ABAP_MAPPING>
    AT the receiver side I wnat to concatenate the NAME & ADDRESS.
    I tried Robert Eijpe's weblog (/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach)
    but couldnt succeed to convert the xml file into internal table perfectly.
    Can anybody help on this. 
    Thanks in advance!!
    Sarvesh

    Hi Sarvesh,
    The pdf has details of ABAP mapping. The example given almost matches the xml file you want to be converted.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
    Just in case you have not seen this
    regards
    Vijaya

  • How to load text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA,      IO TEST1,      IO TEST 1,        CHAR,         20
    ZIO_TEST2, CHA,      IO TEST2,      IO TEST 2,        CHAR,         20
    Regards,
    Mau

    Hi,
    U can use GUI_UPLOAD for this...
    Declare an internal table like
    data: begin of itab occurs 0,
    string(1200),
    end of itab.
    check the sample code:
    cange as you need
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: BEGIN OF ITAB occurs 0,
    TXT(1024),
    END OF ITAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
    FILENAME = DATEI_PC
    FILETYPE = 'ASC'
    CHANGING
    DATA_TAB = ITAB[]
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    NOT_SUPPORTED_BY_GUI = 17
    ERROR_NO_GUI = 18
    OTHERS = 19.
    IF SY-SUBRC NE 0. WRITE: / 'Error in Uploading'. STOP. ENDIF.
    WRITE: / 'UPLOAD:'.
    LOOP AT ITAB. WRITE: / ITAB-TXT. ENDLOOP.

  • How to set selected row in alv display?

    Hi,
    How do I select some particular row in alv - say at first display i want to highlight 4th row. How can i do that?
    Thanks,
    Sheel

    try to use method set_selected_rows just after method for first display.

  • How to get all values in the range of select option into internal table?

    Hi,
    I need to capture all entries coming in the range of select option into one internal table.
    How to do get that?
    For E.g
    select-options: matnr for mara-matnr.(select option)
    IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
    and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
    Regards,
    Mrunal

    Hello Mrunal Mhaskar  ,
    What i understand you can do one thing  go in debug mode
    Try this code : -
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-low IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-low.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    LOOP AT s_matnr_ex.
      IF s_matnr_ex-high IS NOT INITIAL.
        i_matnr-matnr = s_matnr_ex-high.
        i_matnr-option = s_matnr_ex-option.
        APPEND i_matnr.
        CLEAR : i_matnr.
      ENDIF.
    ENDLOOP.
    In the i_matnr table high and low values are there.
    Regards,
    Vandana.

  • How to control selected row in result table on a search page?

    Using JDeveloper 10.1.3.2.0
    I have attempted to create an ADF page that contains a search and result table in the same page.
    I have questions related to the result table. Let's say the result table shows 10 rows per page.
    If I page forward there is no default selected row "clicked" on the page. Only if you return to
    the very first 10 rows do you see a default selection in row number one of the results.
    How would I go about making the first row of each page the default selection?

    You'll need to code this into the RangeChangeEvent event of the table.
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/apidocs/oracle/adf/view/faces/component/core/data/CoreTable.html
    That said - I'm not sure this will be very helpful for the end user - after all in any case they'll need to first select a row before doing an operation on it.

  • Select (join) into internal table with nested structures

    Hello Experts,
    i wonder about the correct notation of a select statement.
    I have an internal table it_zoll including  two structures as defined below.
    The select is a join on the two tables zollp and zolls. As coded below the select is syntactically correct, but the fields
    in the nested structures are not filled ....
    Any ideas how to write the select statement ? (The internal table it_zoll must have the nested structures for other reasons ..)
    Declaration:
    TYPES: BEGIN OF ty_zollp,
      belnr     TYPE  zollp-belnr,
      werks     TYPE  zollp-werks,
      gebnr     TYPE  zollp-gebnr,
           END OF ty_zollp.
    TYPES: BEGIN OF ty_zolls,
      grnum     type  zolls-grnum,
      werks     type  zolls-werks,
      name1     TYPE  zolls-name1,
           END OF ty_zolls.
    DATA: BEGIN OF wa_zoll.
    DATA: zollp type ty_zollp.
    DATA: zolls type ty_zolls.
    DATA: END OF wa_zoll.
    DATA: it_zoll LIKE TABLE OF wa_zoll.
    Select:
      SELECT
        zollp~belnr   zollp~werks  zollp~gebnr
        zolls~grnum zolls~werks  zolls~name1
          FROM zollp
          JOIN zolls ON   zolls~werks = zollp~werks
                     AND  zolls~grnum = zollp~grnum
          INTO CORRESPONDING FIELDS OF TABLE it_zoll
          WHERE zollp~werks = werks
          AND   zollp~gebnr IN s-gebnr
          AND ...
    Thank you !

    DATA: BEGIN OF ty_zollp,
      belnr     TYPE  zollp-belnr,
      werks     TYPE  zollp-werks,
      gebnr     TYPE  zollp-gebnr,
           END OF ty_zollp.
    DATA: BEGIN OF ty_zolls,
      grnum     type  zolls-grnum,
      werks     type  zolls-werks,
      name1     TYPE  zolls-name1,
           END OF ty_zolls.
    DATA: BEGIN OF wa_zoll.
    Include structure ty_zollp.
    Include structure ty_zolls.
    DATA: END OF wa_zoll.
    The above declaration had worked. Please try.
    Regards,
    Satish Kanteti

  • Help to set selected row in adf table!

    Hello,
    I have a problem with adf table, when I select one row in table, I want to set selecte to next row or first row , or end row . . .
    How can I do that.
    If anyone know it, please help me
    Thanks in advance.

    <af:table value="#{bindings.BuddyView1.collectionModel}" var="row" partialTriggers="id"
    rows="#{bindings.BuddyView1.rangeSize}"
    emptyText="#{bindings.BuddyView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.BuddyView1.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.BuddyView1.collectionModel.selectedRow}"
    *selectionListener="#{bindings.BuddyView1.collectionModel.makeCurrent}"*
    rowSelection="single" binding="#{backing_untitled1.t1}"
    id="t1">
    You will have to create your own selection listener method.
    Cheers
    Venkat
    Edited by: Venkat81 on Jun 10, 2010 11:12 AM

  • Improving performance:How to know selected rows in af:table through chk box

    Hi,
    I've a VO which has 3 transient variables. 2 of these transient variables getting the values from a view accessor. Using the other transient variable in the Ui to select the rows in the af:table.
    In my UI, I've a table and a Check Box to select the rows. I want to get the selected rows through the check box, in the backing bean for my business requirements.
    I've used below logic to get the selected rows. Here, I am iterating through the entire viewobject rows, so it is impacting the performance of the UI. How can I know the selected rows in the bean? or How can I improve the performance?
    I also applied below view criteria, but still its not performant.
    // ViewCriteria vc = vo.createViewCriteria();
    // //.getViewCriteriaManager().getViewCriteria("SelectedMerchantCriteria");
    // ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    // vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE | ViewCriteria.CRITERIA_MODE_QUERY);//MerchantName1
    // //vcr.setAttribute("MerchantName1", "1017 CAFE");
    // vcr.setAttribute("SelectToMap", "true");
    // vc.addRow(vcr);
    // vo.applyViewCriteria(vc);
    // vo.executeQuery();
    public void mapSupplierMerchant2(ActionEvent actionEvent) {
    // Add event code here...
    OperationBinding method = null;
    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
    Map pageFlowScope = adfFacesContext.getPageFlowScope();
    ArrayList merchantMappingList = new ArrayList();
    Long primaryVendorId = null, groupId = null;
    CollectionModel tableModel = (CollectionModel) this.getMerchantTable().getValue();
    JUCtrlHierBinding tableBinding = (JUCtrlHierBinding) tableModel.getWrappedData();
    ViewObject vo = tableBinding.getViewObject();
    // ViewCriteria vc = vo.createViewCriteria();
    // //.getViewCriteriaManager().getViewCriteria("SelectedMerchantCriteria");
    // ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    // vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE | ViewCriteria.CRITERIA_MODE_QUERY);//MerchantName1
    // //vcr.setAttribute("MerchantName1", "1017 CAFE");
    // vcr.setAttribute("SelectToMap", "true");
    // vc.addRow(vcr);
    // vo.applyViewCriteria(vc);
    // vo.executeQuery();
    List<JUCtrlHierNodeBinding> merchantList = (List<JUCtrlHierNodeBinding>)tableBinding.getChildren();
    JUCtrlHierNodeBinding merchantNode = null;
    List supToMap = new ArrayList();
    boolean isMerchantSelected = false, isMasterSup = false;
    Long merchantIdToMap = null, masterSupId = null;
    Row r = vo.first();
    while(r!=null) {
    System.out.println("================================ " + r.getAttribute("MerchantName1") + " " + r.getAttribute("SelectToMap") );
    if(r.getAttribute("SelectToMap")!=null) {
    isMerchantSelected = (Boolean) r.getAttribute("SelectToMap");
    if(isMerchantSelected) {
    merchantIdToMap = (Long) r.getAttribute("MerchantMapId");
    if(merchantIdToMap!=null) merchantMappingList.add(merchantIdToMap);
    r = vo.next();
    if(merchantMappingList.size()>0) {
    primaryVendorId = (Long) pageFlowScope.get("primaryVendorId");
    groupId = (Long) pageFlowScope.get("groupId");
    method = (OperationBinding) ADFUtil.findOperation("mapSupplierMerchant");
    if(method!=null) {
    Map paramMap = method.getParamsMap();
    paramMap.put("vendorId", primaryVendorId);
    paramMap.put("groupId", groupId);
    paramMap.put("merchantList", merchantMappingList);
    Boolean result = (Boolean) method.execute();
    List errors = method.getErrors();
    if(result!=null && result) {                   
    this.getMerchantMappedFlag().setValue(true);
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.getMerchantMappedFlag());
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.getMerchantTable());
    tableBinding.getViewObject().setRangeSize(25);
    FacesMessage message = new FacesMessage("The selected merchants have been mapped to the group. Please save the changes. " );//+ adfFacesContext.getPageFlowScope().get("merchantGroupName") );
    message.setSeverity(FacesMessage.SEVERITY_INFO);
    FacesContext.getCurrentInstance().addMessage(null, message);
    } else {
    FacesMessage message = new FacesMessage("No merchants have been selected for mapping. Please select atleast one merchant." );//+ adfFacesContext.getPageFlowScope().get("merchantGroupName") );
    message.setSeverity(FacesMessage.SEVERITY_ERROR);
    FacesContext.getCurrentInstance().addMessage(null, message);
    }

    Hi
    Please check this post [http://adfwithejb.blogspot.in/2012/08/hi-i-came-across-one-common-use-case.html].
    It has clear explanation of how to provide a checkbox for selection of rows. You can also go through my comments at the end of the post. That should solve your problem of iterating through the entire VO.
    Thanks,
    Rakesh

  • How To get selected row in a table

    Hi experts
                        I have been using a table in which I am using a column Tree by nesting . I have written code for dynamically expanding table tree . But I want to know current selected element of the table, for this i have done following
    steps
    1) created an action on Action <b>lead select </b> of the table .
    which has a parameter with type node element .
    2) now i need to use parameter mapping in domodify view .
    as
    IWDTable tab =  (IWDTable) view.getElement("CatalogTable");
            tab.mappingOfOnLeadSelect().addSourceMapping<b>("XYZ",</b> "element");
    But i dont know what is correct parameter <b>XYZ</b> to be passed.
    also if i am wrong in approach please let me know .
    Regards
    Abhay

    Hi
                I have used following code also but its not working
    IWDTable table  =  (IWDTable) view.getElement("CatalogTable");
    table.mappingOfOnLeadSelect().addSourceMappin               ("IWDNodeElement", "LeadSelect");
    and I have created an action
    public void onActionOnleadSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tut.wd.treetable.wdp.IPrivateTreeTableView.ICatalogElement LeadSelect )
        //@@begin onActionOnleadSelect(ServerEvent)
        wdContext.currentContextElement().setDebug4(LeadSelect.getID());
        //@@end
    but when i select one row its giving error
    <b>com.sap.tc.webdynpro.services.exceptions.WDIllegalArgumentException: Parameter IWDNodeElement not found</b>

  • How to maintain selected row in adf table displayed after refresh

    Hi,
    I am using jdev 11g
    I my jsf page I have a table with multiple rows.
    When i scroll and click on one of the rows its selected but if the page is refreshed the row is always selected but not displayed.
    I need to be able to maintain the selected row after the refresh of the page, so my table will look like its already scrolled to the selected row..
    I tried to use the attribute displayRow="selected" but it won't do the trick.
    Any hints
    Emile

    Hi Branislav,
    Kindly answer the following if you may.
    Is there a way to refresh the table after the selectListner is fired.
    Automatically when i select the table i need to refresh it.
    Why after refresh the selected row changes skin.
    Regards

  • How to add a row in internal table at first row

    Hi All,
                  I need to add a row in an internal table which already has some contents.I want to add this row in the first row.
    Please advice.
    Thanks in advance.

    You mean - you  want to replace the 1st record in the internal table. or you want to sum the new values to the existed record.
    If you want to replace - then you can use as
    read table itab index 1.
    if sy-subrc = 0.
        itab-f1 = 'new value'.
        modify itab index sy-tabix.
    endif.
    Regards,
    Satya

  • How to set selected row on startup of an alv tree build with cl_salv_tree

    HI,
    I have a cl_salv_tree and want the tree structure to open a specific node when starting the report. My coding is something like that:
      DATA: lr_selections       TYPE REF TO cl_salv_selections_tree,
            lr_nodes            TYPE REF TO cl_salv_nodes,
            lr_node             TYPE REF TO cl_salv_node,
            lv_node_index(12)   TYPE c,
            lt_nodes            TYPE salv_t_nodes,
            ls_nodes            TYPE salv_s_nodes,
            lr_item             TYPE REF TO cl_salv_item.
    lr_selections = lr_tree->get_selections( ).
    lt_nodes = lr_selections->get_selected_nodes( ).
    lr_item = lr_selections->get_selected_item( ).
    IF lr_item IS NOT BOUND.
      lr_nodes = lr_tree->get_nodes( ).
      lr_node = lr_nodes->get_node( lv_node_index ).  "lv_node_index is the index of the node i want to be open on startup
      ls_nodes-key = lv_node_index.
      ls_nodes-node = lr_node.
      APPEND ls_nodes TO lt_nodes.
      lr_selections->set_selected_nodes( lt_nodes ).
    ELSE.
      ls_nodes-node = lr_item->get_node( ).
      ls_nodes-key = ls_nodes-node->get_key( ).
      APPEND ls_nodes TO lt_nodes.
      lr_selections->set_selected_nodes( lt_nodes ).
    ENDIF.
    This coding is also used, when the report is running and someone clicks an a row. So thats why I check if a item is marked
    or the total row.
    But the tree always starts without opening the node.
    Do I use the right methods or am I totally wrong ????
    Thx for your help in advance
    dinodini
    Edited by: dinodini on Nov 16, 2010 6:51 PM

    What you are looking for is the similar functionality which could be achieved by the method EXPAND_NODE of the ALV Tree created using CL_GUI_ALV_TREE. In SALV Tree, you can use the method EXPAND of the class CL_SALV_NODE to show all the subnodes of that node, not by using the SELECTION.
    Once you add the Node using the method ADD_NODE, you should call the method EXPAND to expand that subtree.
                lr_nodes  = lr_tree->get_nodes( ).
                lr_node =  lr_nodes->ADD_NODE( ... )
                lr_node->EXPAND( COMPLETE_SUBTREE = 'X' ).
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Dial Up Connection Problems

    I had a great connection months ago, but recently began getting disconnected within a few minutes of being online. I get a message that the modem has unexpectedly hung up. Since my friends computer stays online for hours with no issues, I know the ph

  • How can I sent my video and foto from iPhone to iPad ????

    How can I sent my video and foto from iPhone to iPad ????,

  • RSCONN01 send PO (pdf format) as Confidential

    Hello... We have the following issue... we have 2 SAP clients... in one client the messages sents via RSCONN01 program via Internet are not flag as Confidential. And the other client, sending the messages via RSCONN01 program via internet are set as

  • Downloading Oracle Warehouse Builder

    When I click on the link to download the zip file for OWB, I get a page-not-available error. Couldn't see a link for Webmaster... Please let me know if this gets fixed. Thanks, David null

  • What has happened to my events in I-Cal?

    Suddenly all my personal entries on my calendar have disappeared. I can create a new event. But the only items on it are the standard calendar events such as national holidays and birthdays. All of my calendars in the left side bar are checked. Have