Object Model - cl_salv_hierseq_table Check box hide and Display

I am making use of Object model for creating the hierseq ALV.
I have added a checkbox to my ALV by making use of
gr_selections = gr_table->get_selections( level = 1 ).
gr_selections->set_selection_mode(cl_salv_selections=>if_salv_c_selection_mode~multiple ).
As u can make out by the Value Level = 1 the checkbox is at the header level.
1.) My query is that i want to Enable the checkbox for some header level records and and Disable some header level records based on a condition.
2.) Second query is that I want to read records from the alv in which the checkbox is checked..
Kindly answer.
Thanks,
Nikhil Juneja

Hi aRs.  You need to use the class CL_SALV_SELECTIONS for this.  See here,  
DATA: gt_parent TYPE TABLE OF scarr.
DATA: gt_child TYPE TABLE OF sflight.
DATA: gr_table  TYPE REF TO cl_salv_hierseq_table.
DATA: gr_selections TYPE REF TO cl_salv_selections.
DATA: lt_binding TYPE salv_t_hierseq_binding.
DATA: ls_binding TYPE salv_s_hierseq_binding.
SELECT * FROM scarr INTO CORRESPONDING FIELDS OF TABLE gt_parent.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_child.
ls_binding-master = 'CARRID'.
ls_binding-slave  = 'CARRID'.
APPEND ls_binding TO lt_binding.
CALL METHOD cl_salv_hierseq_table=>factory
  EXPORTING
    t_binding_level1_level2 = lt_binding
  IMPORTING
    r_hierseq               = gr_table
  CHANGING
    t_table_level1          = gt_parent
    t_table_level2          = gt_child.
gr_selections = gr_table->get_selections( level = 1 ).
gr_selections->set_selection_mode( cl_salv_selections=>if_salv_c_selection_mode~multiple ).
gr_table->display( ).
This will give you the checkboxes in the parent level, you still need to write the code to get the selected rows.
Regards.
Rich Heilman

Similar Messages

  • Object Model - cl_salv_hierseq_table Check box in the parent entry

    Hi,
    I am doing a report with cl_salv_hierseq_table (Object Model) , in that i  need to put a check box in the t_table_level1 level. I know that SALV is not have an option to edit.
    My requirement is from the list user select multiple parent entries (ie t_table_level1 ) and selected entries must be converted to web template and send to HTML repository.
    Currently i am struck up with creating a check box in HIERSEQ list
    Any Info?

    Hi aRs.  You need to use the class CL_SALV_SELECTIONS for this.  See here,  
    DATA: gt_parent TYPE TABLE OF scarr.
    DATA: gt_child TYPE TABLE OF sflight.
    DATA: gr_table  TYPE REF TO cl_salv_hierseq_table.
    DATA: gr_selections TYPE REF TO cl_salv_selections.
    DATA: lt_binding TYPE salv_t_hierseq_binding.
    DATA: ls_binding TYPE salv_s_hierseq_binding.
    SELECT * FROM scarr INTO CORRESPONDING FIELDS OF TABLE gt_parent.
    SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_child.
    ls_binding-master = 'CARRID'.
    ls_binding-slave  = 'CARRID'.
    APPEND ls_binding TO lt_binding.
    CALL METHOD cl_salv_hierseq_table=>factory
      EXPORTING
        t_binding_level1_level2 = lt_binding
      IMPORTING
        r_hierseq               = gr_table
      CHANGING
        t_table_level1          = gt_parent
        t_table_level2          = gt_child.
    gr_selections = gr_table->get_selections( level = 1 ).
    gr_selections->set_selection_mode( cl_salv_selections=>if_salv_c_selection_mode~multiple ).
    gr_table->display( ).
    This will give you the checkboxes in the parent level, you still need to write the code to get the selected rows.
    Regards.
    Rich Heilman

  • How do you get different check box fields to display based upon a list box selection?

    I am a relative newbie with LifeCycle Designer ES using v.8.2.1 to create interactive forms to replace manual hardcopies.  I am working on a form that has a few pull down list boxes.  I want different check box fields to display based upon the selection of an item from one of the pull down lists.
    Any guidance on the best way to accomplish this would be greatly appreciated.

    Hi,
    Here is a sample with script in the change event of the dropdown. You may want to clear previous checkbox choices once the subform is hidden.
    It is good to group objects in a subform - that way you only need to hide the subform and not each object in turn.
    Good luck,
    Niall

  • Hide and Display submit button on the Simple search page.

    Heading 1: h1 Hide and Display submit button on the Simple search page.
    I'm trying to set the enabled property of the submit button on the simple search page. The business case is to disable the button if the VO has not returned any rows.
    The Submit button is on the page button bar.
    regards
    Abhi

    Hi,
    I have already added this in my ProcessRequest, the issue I am facing is it the submit button is disabled while I load >the page which is fine. but when I do a search and the query returns rows still the submit button is disabled.---Will nt reuired SPEL here..
    ---On go button click setsession value.
    Follow below steps:
    CO PR:*
    OASubmitButtonBean continueBtn=(OASubmitButtonBean)flowLayout.findChildRecursive("continueBtn");
    if(continueBtn != null && "D".equals(oapagecontext.getSessionValue("Flag"))
    continueBtn.setDisabled(false);
    else if(continueBtn != null )
    continueBtn.setDisabled(true);
    CO PFR:_
    if(pageContext.getParameter("Go") != null)
    oapagecontext.putSessionValue("Flag","D");
    Regards
    Meher Irk
    Edited by: Meher Irk on Mar 22, 2011 7:48 PM
    Edited by: Meher Irk on Mar 22, 2011 7:48 PM

  • Required Check Boxes - Yes and No

    Good Morning everyone - I have a form and I have two Check boxes Yes and NO that the user needs to check one, but if the user checks one the other should be turned off (sort of speaking) and allow the user to continue to submit or print, etc. Is this possible. Thank you kindly.

    In Acrobat Forms, you need to group the check boxes or radio buttons by using the same name for the buttons and setting the export value to different values so the individual box/button widget. can differentiated from the other boxes/buttons. Use the Radio Buttons if with a default value if you want a froced selection. Check boxes allow for the deselection of a selected check box, but radio buttons can only deselected by selecting another radio button.

  • How to create a group/list of check box variables for display in text field, in appended format

    I need to identify a series of single-response checkbox variables and display the ones selected (as a group) in a text field in an appended (comma, space) format. Last week, you provided a great little script for a similar need using List Box (multiple response) variables. This time I need to know how to formally identify the checkbox variables and, I presume, use a similar script to display the results in a comma, space format.
    You've been of great help.
    Thanks

    Here's the script adapted to this situation. It assumes there are ten check boxes named cb1, cb1, cb2, ...cb10.
    // Custom Calculate script for text field
    (function () {
        // Initialize the string
        var v, s = "";
        // Loop through the check boxes to build up a string
        for (var i = 1; i < 11; i++) {
            // Get the value of the current check box
            v = getField("cb" + i).value;
            if (v !== "Off") {
                if (s) s += ", ";  // Add a comma and a space if needed
                s += v;  // Add the selected value
        // Set this field value to the string
        event.value = s;
    You'll have to change the field name and starting/ending numbers to match your form.

  • Reg: Check boxes in ALV Display

    Hi Experts,
    I have a problem with ALV Display. I am able to display the contents in output.
    But my client requirement is, they need to insert 'check boxes' before each record.
    I hope you understood. any way let me explain some thing...
    I am displaying records in ALV, but they need check boxes before each record. Like.... you can see database tables. in database tables like MARA.. it will display
    check box    client   field1   field2   field3.......................
    Please help me in this regard.....
    Thanks in Advance
    Sai babu

    Hi This is my code,
    As of you people suggested me, i write like this.... but it is not working....
    please guide me....
    FORM SUB_DISP_REP .
    PERFORM SUB_FIELD_DEF USING :
                                  ' ' '1' 'PERNR' 'Personnel Number' ' ' ' ' ' ' ,
                                  ' ' '2' 'STAT2' 'Employee Status' '' '' '' ,
                                  ' ' '3' 'STELL' 'Job Title' '' '' '' ,
                                  ' ' '4' 'VORNA' 'First Name' '' '' '' ,
                                  ' ' '5' 'NACHN' 'Last Name' '' '' '' ,
                                  ' ' '6' 'KTART' 'Absence Quota Type' '' '' '' ,
                                  ' ' '7' 'ANZHL' 'Number of Employee Time Quota' '' '' '' ,
                                  ' ' '8' 'KVERB' 'Deduction of Employee Time Quota' '' '' '' ,
                                  ' ' '9' 'QUONR' 'Counter for time quotas' '' '' '' ,
                                  ' ' '10' 'DESTA' 'Start Date for Quota Deduction' '' '' '' ,
                                  ' ' '11' 'DEEND' 'Quota Deduction to' '' '' '' .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
        I_CALLBACK_PROGRAM                = SY-CPROG
    *   I_CALLBACK_PF_STATUS_SET          = ' '
    *   I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_TOP_OF_PAGE            = 'X'
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = 'TRVPICTURE08'
        I_GRID_TITLE                      = 'EMPLOYEE ABSENCE QUOTA'
    *   I_GRID_SETTINGS                   =
    *   IS_LAYOUT                         =
        IT_FIELDCAT                       = T_FCAT
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
        IT_SORT                           = T_SUBTOT
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    *   IT_EVENTS                         =
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   I_HTML_HEIGHT_TOP                 =
    *   I_HTML_HEIGHT_END                 =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = T_OUTPUT
    * 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.
    ENDFORM.                    " SUB_DISP_REP
    form SUB_FIELD_DEF  using P_chk TYPE char1
                              P_COL TYPE CHAR2
                              P_NAME TYPE CHAR10
                              P_TEXT TYPE CHAR40
                              P_SUM TYPE CHAR1
                              P_EDIT TYPE CHAR1
                              P_OUT TYPE CHAR1.
    W_FCAT-checkbox = 'X'.
    W_FCAT-COL_POS = P_COL .
    W_FCAT-FIELDNAME = P_NAME .
    W_FCAT-SELTEXT_M = P_TEXT .
    W_FCAT-DO_SUM = P_SUM .
    W_FCAT-EDIT = P_EDIT .
    W_FCAT-NO_OUT = P_OUT .
    APPEND W_FCAT TO T_FCAT .
    CLEAR W_FCAT .
    endform.                    " SUB_FIELD_DEF

  • How to pass arraylist of object from action class to jsp and display in jsp

    I need to do the following using struts
    I have input jsp, action class and action form associated to that. In the action class I will generate the sql based on the input from jsp page/action form, create a result set. The result set is stored as java objects in a ArrayList object.
    Now I need to pass the arraylist object to another jsp to display. Can I put the ArrayList object in the request object and pass to the success page defined for the action? If this approach is not apprpriate, please let me know correct approach.
    if this method is okay, how can I access the objects from arraylist in jsp and display their property in jsp. This java object is a java bean ( getter and setter methods on it).
    ( need jsp code)
    Can I do like this:
    <% ArrayList objList = (ArrayList)request.getattribute("lookupdata"): %> in jsp
    (***I have done request.setattribute("lookupdata", arraylistobj); in action class. ***)
    Assuming the java object has two properties, can I do the following
    <% for (iint i=0. i<objList.size;I++){ %>
    <td> what should i do here to get the first property of the object </td>
    <td> what should i do here to get the first property of the object </td>
    <% }
    %>
    if this approach is not proper, how can I pass the list of objects and parse in jsp?
    I am not sure what will be the name of the object. I can find out how many are there but i am not sure I can find out the name
    thanks a lot

    Double post:
    http://forum.java.sun.com/thread.jspa?threadID=5233144&tstart=0

  • Check  File Existence and display  alert message

    Hi,
    I have a servlet which uploads file to server. Below is my code and is working file. Now, I want to check if the file uploading by the user is already exists. If so , I have to display a message to user "The file you are trying to upload already exists. Do you want to overwrite" with YES or NO actions.
    How can I display this alert message from user.
    //item.write(tosave);
              FileItemFactory factory = new DiskFileItemFactory();
              boolean isMultipart = FileUpload.isMultipartContent(request);
              System.out.println(isMultipart);
              Map fileDetails = new HashMap();
              ServletFileUpload upload = new ServletFileUpload(factory);
              List items = upload.parseRequest(request);
              Iterator iter = items.iterator();
              while (iter.hasNext()) {
                   item = (FileItem) iter.next();
                        if (item.isFormField()) {
                                       String fieldName = item.getFieldName();     
                                       String fieldValue = item.getString();
                                       fileDetails.put("fileName",item.getString());
                        else {
                                  fileDetails.put("path",item.getName());
                                  cfile=new File(item.getName());
                                  onlyFileName = cfile.getName();
                   if (! folder.exists()) folder.mkdirs();
                   if(cfile.exists()){  //THIS CHECK THE FILE EXISTENCE.  HOW CAN I DISPLAY ALERT MESSAGE TO USER HERE.
                        System.out.println("File Already Exists Path is ");     
    Can anyone suggest me on this.

    It won't work like that because JavaScript will run either before the form is submitted or after the page has been generated. In either case, you can't really communicate between the server side code and client side code.
    What you can do is use Ajax to communicate with a servlet that checks for the duplicate file and responds accordingly. You can then perform the appropriate action on the page. This should be very simple to setup, take a look at this basic tutorial [1].
    [1] http://www.w3schools.com/ajax/default.asp
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • Dropdownlist box value and display field retrieval question

    have a case on a dropdown list where I want to not only retieve the value from the selected item, but I also want to retrieve the display field. I know that you use the the tempDropdownlist.getValue() to get the value, but how do you retrieve the display field?
    The dropdown box is bound to a table with id(int) and Name(string).

    Yes there's no easy way - but you can loop thru the select items list and find the one that matches the current getValue result... and get it that way - see the tutorial on Using Listbox Components...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    hth,
    v

  • How to send object arraylist from servlet to jsp and display using jstl

    Hi All....
    I have a simple application and problem with it.
    Once user logged in to system the user will redirect to LoginServlet.java controller.
    Then in LoginServlet I want to redirect user to another page called book_details.jsp.
    this is my login servlet.
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              PrintWriter out = response.getWriter();
              ArrayList<BankAccountDTO> account_list = new ArrayList();
              ResultSet resultSet = null;
              LowFairAirDB airDB = null;
              try{
                   airDB = new LowFairAirDB();
                   String query = "SELECT account_id, type, description, balance, credit_line, begin_balance, begin_balance_time_stamp FROM bank_account";
                   airDB.sqlSelect(query);
                   resultSet = airDB.getResultSet();
                   while(resultSet.next()){
                        account_list.add(new BankAccountDTO(resultSet.getInt(1),
                                                                     resultSet.getInt(4),
                                                                     resultSet.getInt(5),
                                                                     resultSet.getInt(6),
                                                                     resultSet.getString(2),
                                                                     resultSet.getString(3),
                                                                     resultSet.getString(7)));
              }catch(Exception ex){
              }finally{
                   try{resultSet.close();}catch(Exception ex){}
                   airDB.sqlClose();
         }I set bank account values to BankAccountDTO.java objects and add them to the arrayList.
    Next I want to send this objects arrayList to books_details.jsp and wanna display each objects values using JSTL.
    I still finding a way to go through this.
    1. Can anyone say how can I do it?
    2. Is there any other method to do the same thing without using JSTL?
    thanks in advance,
    Dil.

    Naishe wrote:
    In your servlet,
    request.setAttribute("account_list", account_list);
    requestDispatcher.findForward("/your/display/jsp");
    Good. I would only follow the Java naming conventions. E.g. accountList or accounts instead of the ugly PHP/C conventions.
    In the JSP,
    lst = (List< BankAccountDTO >)request.setAttribute("account_list");
    for(BankAccountDTO b: lst){
    populate your HTML tags or whatever
    Wrong. 1) You need getAttribute() and 2) you should not use scriptlets. Use JSTL c:forEach, e.g.<table>
        <c:forEach items="${accounts}" var="account">
            <tr>
                <td>${account.id}</td>
                <td>${account.type}</td>
                <td>${account.description}</td>
            </tr>
        </c:forEach>
    </table>To the topicstarter: for future JSP/JSTL related questions please use JSP/JSTL forum.
    Here it is: [http://forums.sun.com/forum.jspa?forumID=45].

  • How can i hide and display columns dynamically

    Hi,
    Is such a thing possible in BeX.?????
    Following is the reqiurement.
    Number of columns with the forecast values are to be from Forecast 1&2 till the month before the chosen selection. In order for us to calculate the variance, you should have 2 forecast values. 
    If March is chosen please show Forecast 1& 11, Forecast 2&10
    If April is chosen please show Forecast 1& 11, Forecast 2&10, Forecast 3&9.
    If November is chosen please show Forecast 1& 11, Forecast 2&10, Forecast 3&9, Forecast 4&8, Forecast 5&7…………..Forecast 10&2.
    Please guide how can this be achieved.
    Regards,
    Rathy

    Hi,
    well at least you can use some vba macros to achieve that. Best would be to have a static query embedded in a workbook and a sheet where the results are displayed as copies from the query via a macro.
    regards
    Siggi

  • How can I stop firefox from checking add-ons and displaying the What's new page each time I launch it

    Since upgrading to the latest version, I have viewed read and interacted with everything on the What's new page. I have done this a number of times but the page is still opened each time I launch Firefox. In addition it shows my homepage in a second tab.
    Prior to opening Firefox it checks for add-ons.

    hello Michells, this will likely be caused by the user.js file in your profile folder.
    go to the firefox ''menu ≡ > help ? > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js''' and restart the browser afterwards.
    [[How to fix preferences that won't save]]

  • div hide and display problem

    I have a button ' + ' on it's click event i show one <div > and block display of button -(minus) , This works fine when there is single + button with multiple + button .. How can i accomplish same task ,,
    Please suggest solution

    BalusC wrote:
    Why are you asking a simple JS question in a Java forum? They have nothing to do with each other.Yes it's simple js issues , i made it work with single button but i want this for multiple buttons where button will appears dynamically ,, Suppose i want 2 buttons displayed in two <tr id ="1">
    <%
    for (int i-0;i<2;i++){ %>
    <tr>
    <td id="plus" style="display:block"> <input type=button name="plus" value="+" onClick="showminus(this)"></td>
    <td id="minus" style="display:none"> <input type=button name="plus" value="-" onClick="showplus(this)"></td>
    </tr>
    <%}%>This dosent work beacuse because my <td > id value is same for all + and - buttons
    plase suggest solution on this

  • Check boxes that turn layers on and off

    hay all
    im fairly new to this part of adobe but i have a good understanding
    what i need i to be able to have check boxes that turn layers on and off when the tick is shown and when it is not
    i know this is possible through scripting but i dont have the ability as of yet to carry out the scripting
    is someone able to write a basic script for me or help me to understand what i need
    i want the script to be for when a check box is clicked (mouse up) that a layer that was oringaly turned off to be turned on (electricalplan)
    once the tick is removed i need the layer to turn off again
    i need to do this for mulitple layers (about 10)
    so i would just use the same script for each replacing the name with the correct name.
    i also need the check boxes to work together so that i can have multiple turned on at the one time (electricalplan) (sewerplan) (waterplan)

    Do you know how to access fields with JavaScript? I access the script way of the check box properties and selecting the actions tab.
    Do you know how to set the optional value for a check box? Yes    
    Can more than one layer be displayed at a time? Yes
    Do you want to toggle the OCG by name or element number in the OCG array? I would like to toggle by name

Maybe you are looking for

  • Select query in not working for Count(*)

    Hi, Our batch team running one query that is selecting one table TSFHEAD and this query is hanging. Below are diffrent shenario in which the select query is running on this table. select * from tsfhead where create_id = 'BATCH' and create_date = '26-

  • Adding field in pa30 screen urgent

    hi all, i am new to user exits. and my requirement is to add a field in screen for PA30 tcode screen. so how i can go for this . if anyone has added fields in any SAP standard screen then plz give me the doc regd that with screen shots if u have othe

  • W2K8 & Win7 - Setting system-wide Trusted file locations not working

    Win 2008 Network, Win 7 workstations. RE: Setting system-wide trusted file locations I have an application using Flash stored on a network location that accesses other files in the same location.  This causes the security warning "The following local

  • Changing Paragraph Style Names

    I asked this question about a month ago, but I did't really ask it right. I am bringing documents from InDesign to InDesign6. In the process, we are changing style names to make things future compabile by eleminating all spaces. periods, dashes, etc.

  • HT4623 My iPad doesn't have update software

    My iPad doesn't have a selection for up date now