Handling Multiple checkboxes iin ALV list??

Hi,
I have a requirement of generating a list with multiple checkboxes corresponding to each line/row of the list..Based on the selection of some/all the rows of the list I have to invoke some functionality on the click of some button..
I am able to get the chk-boxes on the list also i have got the button on the std PF-status of ALV list, but I am not able to handle multiple selection of the chk-boxes??
plz help..

On the field catalog definition for the amount field pass CFIELDNAME as the <currency> fieldname. if this is maintained, i would assume it will solve your issue.
Say for example, the amount field is AMOUNT and the corresponding currency fieldname is 'CURRENCY', the field catalog for this field should be filled in something like this.
t_fieldcat-fieldname = 'AMOUNT'.         "amount field name
t_fieldcat-tabname = 'IT_FINAL'.           "internal table name
t_fieldcat-cfieldname = 'CURRENCY'.   "currency field name which will be referred
append t_fieldcat.
Hope this helps.
Thanks,
Balaji

Similar Messages

  • Select multiple lines in ALV list

    Hi Everyone,
    I have an ALV list which has checkboxes. Now when we select the check boxes and press enter it should  take me back into the program with only those lines in an internal table for which the checkboxes have been clicked. Is this possible.
    Any input is greatly appreciated.
    Thanks
    Kumar.

    yes... perhaps it is in how you are processing it. i am NOT using hotspots. i created a GUI status with a icon, and assigned it to a specific OK_CODE. then, when you display the ALV,
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_grid_title             = w_alv_title
          is_layout                = t_alvlayout
          it_fieldcat              = t_alvfieldcat
          it_events                = t_alveventcat
          it_sort                  = t_alvsortcat
          i_save                   = i_save
          is_variant               = default_layout
          i_default                = 'X'  " Allow Display Variants
          i_callback_program       = w_alv_callback_prog
          i_callback_user_command  = w_alv_command_handler
          i_callback_pf_status_set = w_alv_gui_status_setter
          i_callback_top_of_page   = 'STANDARD_LIST_HEADING'
        tables
          t_outtab                 = t_alvdata
        exceptions
          program_error            = 1
          others                   = 2.
    you specify a command handler callback, with the callback program and form
      w_alv_command_handler = 'ALV_COMMAND_HANDLER'.
      w_alv_callback_prog = sy-repid.
    then the handler would do something like this
    form alv_command_handler using r_ucomm like sy-ucomm
                               rs_selfield type slis_selfield.
      read table alvdata into alvline index rs_selfield-tabindex.
      case r_ucomm.
        when 'DELETE'.
    * make sure at least one line was selected
          read table alvdata into alvline with key select = true.
          if sy-subrc <> 0.
            message i014.
          else.
            call function 'POPUP_TO_CONFIRM'
              exporting
                titlebar              = 'Delete Confirmation'
                text_question         = 'Are you sure?'
                text_button_1         = 'Yes'
                text_button_2         = 'No'
                default_button        = '2'
                display_cancel_button = ' '
              importing
                answer                = answer
              exceptions
                text_not_found        = 1
                others                = 2.
            if sy-subrc = 0 and answer = '1'.
              loop at alvdata into alvline where select = true.
                perform delete_a_message.
              endloop.
    * refresh the list data
              perform load_alvdata.
              rs_selfield-refresh = true.
            endif.
          endif.
        endif.
    * process hotspots
        when '&IC1'.
          case rs_selfield-fieldname.
            when 'FILENAME'.
              submit ylo_newbreed_message_edit
                with p_file = alvline-filename
                with p_change = ' '
                 and return.
            when 'LASTSTS'.
              perform display_messages.
          endcase.
      endcase.
    endform.                    "alv_command_handler
    i cut a lot fo code out of this, so it may be missing some endif or whatever, but as you can see, you check the ok code, and if it matches your GUIstatus button, you loop over the internal table and process the data
    sorry for the long reply. i hope it helps

  • Multiple checkboxes in alv

    Hi all,
           i want to know is there any way to get multiple checkboxes when i am using FM Reuse_alv_fieldcatalog_merge.. to create ALV...
    I know that by giving the style we can get one checkbox.. but i need to display 5 checkboxes...
    Help me out frens.
    Regards,
    Syed

    You mean this... This shows a column with a check box for each row.
    REPORT ztest_alv_check MESSAGE-ID zz .
    TYPE-POOLS: slis.
    DATA: x_fieldcat TYPE slis_fieldcat_alv,
    it_fieldcat TYPE slis_t_fieldcat_alv,
    l_layout TYPE slis_layout_alv,
    x_events TYPE slis_alv_event,
    it_events TYPE slis_t_event.
    DATA: BEGIN OF itab OCCURS 0,
    vbeln LIKE vbak-vbeln,
    posnr LIKE vbap-posnr,
    chk(1),
    END OF itab.
    SELECT vbeln
    posnr
    FROM vbap
    UP TO 20 ROWS
    INTO TABLE itab.
    x_fieldcat-fieldname = 'CHK'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 1.
    x_fieldcat-input = 'X'.
    x_fieldcat-edit = 'X'.
    x_fieldcat-checkbox = 'X'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    x_fieldcat-hotspot = 'X'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 2.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 3.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        is_layout               = l_layout
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      DATA: gd_repid LIKE sy-repid, "Exists
      ref_grid TYPE REF TO cl_gui_alv_grid.
      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.
      LOOP AT itab WHERE chk = 'X'.
        itab-chk = 'X'.
        MODIFY itab  TRANSPORTING chk WHERE vbeln = itab-vbeln .
      ENDLOOP.
      rs_selfield-refresh = 'X'.
      BREAK-POINT.
    ENDFORM. "USER_COMMAND

  • Multiple header in ALV list

    hi abapers,
    i got a requirement to disply material no.'s in descending order in lav grid/list both..
    now, when i did sorting of the column, grid is displaying the output fine but in list HEADER IS GETTING PRINTED MULTIPLE TIMES, one for each new matnr [although it gets descendigly sorted],
    below is my code of sorting, could you please expalin why is this happening,. ?? is this compatibiltiy issue ??
    *&      Form  ZF_SORTING
          text
         -->P_I_SORTINFO  text
    FORM zf_sorting USING p_i_sortinfo TYPE slis_t_sortinfo_alv.
      DATA l_sortinfo TYPE slis_sortinfo_alv.
      REFRESH p_i_sortinfo.
      CLEAR l_sortinfo.
    *&-- passing attributes to sort the column
    L_SORTINFO-SPOS = '1'.           " 1 sorting position
      l_sortinfo-fieldname = 'MATNR'.      "fieldname
      l_sortinfo-tabname = 'I_FINAL'.      "final table
      l_sortinfo-down = 'X'.          "enable
      l_sortinfo-group = ' * '.      "DONT REPEAT COMMON ITEM
      APPEND l_sortinfo TO p_i_sortinfo.
    ENDFORM.                    " ZF_SORTING
    *&      Form  zf_display_alv_list
          text
    -->  p1        text
    <--  p2        text
    FORM zf_display_alv_list .
    *&--calling FM to display LIST LAYOUT
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = v_progname
          I_CALLBACK_PF_STATUS_SET = 'ZF_PF_STATUS_SET'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          I_DEFAULT                = 'X'
          it_events                = i_eventcat
          it_sort                  = i_sortinfo
          I_SAVE                   = C_SAVE        "all user/default
          IS_VARIANT               = IT_VARIANT1
        TABLES
          t_outtab                 = i_final
        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.                    " zf_display_alv_list
    Please help,

    Hi,
    Did you find a solution for this?, I am also having a similar requirement.
    If you have any work around please share.
    Thanks.

  • Handling multiple currencies in ALV in same colums

    hi,
      I have a scenario, where I need to display amount values in a single column of ALV with different currencies.
    I am using RESUES_ALV_LIST_DISPLAY to display ALV and handling the currencies by using the below code.
      FIELDCAT-currency = currency_unit.
      FIELDCAT-cfieldname = 'TSL16'.
      FIELDCAT-ctabname = 'GLT0'.
    the output format should be :
       1. USD  200.00 ( With decimals )
       2. KRW 25000 ( without decimals )
    how can I achieve this funcionality i.e dynamically changing the currency unit for different rows?
    Please help.
    Regards
    Krishnan

    On the field catalog definition for the amount field pass CFIELDNAME as the <currency> fieldname. if this is maintained, i would assume it will solve your issue.
    Say for example, the amount field is AMOUNT and the corresponding currency fieldname is 'CURRENCY', the field catalog for this field should be filled in something like this.
    t_fieldcat-fieldname = 'AMOUNT'.         "amount field name
    t_fieldcat-tabname = 'IT_FINAL'.           "internal table name
    t_fieldcat-cfieldname = 'CURRENCY'.   "currency field name which will be referred
    append t_fieldcat.
    Hope this helps.
    Thanks,
    Balaji

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • Multiple Checkbox Insert Handling

    Every so often, I need to refresh my knowledge regarding how to handle multiple check box selections, and how they get handled on an action page to insert correctly in a DB.
    In a helpdesk application, the admin assigns projects to technicians. He may assign one project to several technicians.
    The first action page inserts the data from the form into the DB with time and date stamps, due dates, etc.
    Here is where the selected checkboxes do not get passed.
    The second action page depends on the fist, populating a junction table using:
    <cfquery name="get_project_ID" datasource="#Request.BaseDSN#">
       SELECT MAX (project_ID) as lastID
       FROM main_projects
    </cfquery>
        <cfloop index="i" list="#tech_ID#">
            <cfquery name="TheQuery" datasource="#Request.BaseDSN#">
                INSERT
                INTO     junction_project_tech
                        (junc_tech_ID, junc_project_ID)
                VALUES     (
                            <cfqueryparam cfsqltype="cf_sql_integer" value="#i#">,
                            #get_project_ID.lastID#
            </cfquery>
        </cfloop>
    Any help would be greatly appriciated-
    newportweb

    Thanks for your quick reponse. I hope you don't cringe easily...
    1 form:
    <cfquery name="get_tech" datasource="#Request.BaseDSN#">
    SELECT *
    FROM lookup_tech
    </cfquery>   
    <form action="project_action.cfm" method="post">
    <p><strong>Description:</strong></p>
    <p><textarea cols="120" rows="10" name="project_desc" wrap="hard" class="inputtext"></textarea></p>
    <p><strong>Assigned Technicians</strong></p>
    <cfoutput query="get_tech">
        <tr>
    <td width="75%" class="tddynamic">#tech_lname# <div class="sbfield"><strong>Due Date:</strong> <input type="text" name="due_date" size="8" class="sbfield"> </td>
    <td width="25%" class="tddynamic"><INPUT Type="Checkbox" Name="tech_ID" Value="#tech_ID#"</td>
    </tr>
    </cfoutput>
    <cfoutput>
    <input type="hidden" name="assign_date" value="#DateFormat(CreateODBCDate(Now()), "mm/dd/yyyy")#">
    <input type="hidden" name="assign_time" value="#TimeFormat(CreateODBCTime(Now()), "hh:mm tt")#"></cfoutput>
    <input type="submit" name="" value="Submit Project" class="formbutton">
    </td>
    </tr></form>
    Action1
    <CFPARAM Name="tech_ID" Default=0>
    <cfquery name="create_project" datasource="#Request.BaseDSN#">
    INSERT INTO main_projects (
    project_desc,
    assigned,
    assign_date,
    assign_time,
    due_date,
    assigned_tech1,
    assigned_tech2,
    assigned_tech3,
    assigned_tech4,
    tech_1_hours,
    tech_2_hours,
    tech_3_hours,
    tech_4_hours
    VALUES  (
    '#project_desc#',
    1,
    '#Form.assign_date#',
    '#Form.assign_time#',
    '#FORM.due_date#',
    (insert checkbox values from form here),
    0,
    0,
    0,
    0
    )</cfquery>
    <cflocation url="project_action2.cfm?tech_ID=#Form.tech_ID#" addtoken="No">
    Action2: You have seen.
    DB: MS Access- I know, I know. I'm getting to SQL Server soon.
    Thanks again....

  • Multiple checkbox selection in ALV and updating internal table

    Dear Expert,
    Can anyone tell me how to handle the multiple checkbox selection in ALV Grid report and then updating the internal table.
    I tried the option but it works only when i select only 1 row in ALV.
                    DO L_LINES TIMES.
                      read table icoas index rs_selfield-tabindex.
                      if sy-subrc = 0.
                        ICOAS-NOCHK = 'X'.
                        modify ICOAS INDEX rs_selfield-tabindex TRANSPORTING NOCHK.
                      ENDIF.
                    ENDDO.
    Requires help....
    Regards & Thanx,
    Bhupathi.

    Hi,
    Use this method to capture the check box event. Write this once you create your grid using CREATE OBJECT grid1.
    DATA:      GRID1 TYPE REF TO CL_GUI_ALV_GRID,
    CALL METHOD grid1->register_edit_event
      EXPORTING
        i_event_id = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
      EXCEPTIONS
        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.
      LOOP AT T_GRIDDETAILS INTO WA_GRIDDETAILS.
        IF WA_GRIDDETAILS-CHECKBOX = 'X'.
                  "Do your operation
        ENDIF.
        CLEAR WA_GRIDDETAILS.
      ENDLOOP.

  • Writing text above multiple ALV list

    Hi,
    I have multiple ALV lists and want to add a different text above each one. How can this be achieved? I am using sort to separate the lists. thanks
    sort-fieldname = 'MATNR'.
    sort-up = 'X'.
    sort-group = '*'.
    APPEND sort TO it_sort.
    CLEAR sort.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        it_fieldcat        = it_fieldcat
        it_sort            = it_sort
      TABLES
        t_outtab           = it_data
      EXCEPTIONS
        program_error      = 1.
    Edited by: Hin Lai on Jan 7, 2011 9:40 PM

    Well, why not debug FBL5N and see how that transaction does this?
    Hmmm....
    Debugging may not help. The separate lists are handled by the display variant. You should be able to do the same thing if all of your lists use the same field catalog and are in the same or can be put in the same table.
    Rob
    Edited by: Rob Burbank on Jan 7, 2011 5:36 PM

  • Multiple Lines Header and Records in ALV List

    Dear All,
    I am faced with a wierd user requirement to print multiple line header in ALV. Currently we have a classical report where we are displaying a huge text for example 400 characters in a single cell of a column of the report.
    Now we will have to convert this to ALV report where I need to show that data in a single cell. I am wondering how is it possible in ALV list/grid. Please let me know if you guys have any clue.
    Regards,
    Bikramjit

    Hi,
    Did you find a solution for this?, I am also having a similar requirement.
    If you have any work around please share.
    Thanks.

  • ALV List with checkboxes

    Hello experts,
    I'm working on an object where in I need to display an ALV List (using Funct Modules) with checkboxes.
    When I select the checkboxes,and click on a button (Eg.Refresh Button) , I need to get all the details of the selected rows (checked rows) in a seperate ALV List (in a Dailog).
    Could any one of u please suggest me about selecting the row which has been checked(Checkboxes in ALV ).
    Thanks in advance.
    Sanghamitra

    Hi sangha,
    1. To get a taste of it,
       just copy paste this program.
    2. It will display alv (t001)
       It will show CHECKBOXES (besides every row)
       TICK some rows,
      and DOUBLE-CLICK ON any row.
    3.  It will display all the row numbers which have been checked/ticked.
    4.
    report abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : flag tyPE c,
           END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvly TYPE slis_layout_alv.
    Select Data
    SELECT * FROM t001 INTO TABLE itab.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    Display
    alvly-box_fieldname = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
        i_callback_program      = sy-repid "<-------Important
        i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
        is_layout               = alvly
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    CALL BACK FORM
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
      data : msg(100) type c.
      LOOP AT itab.
        if itab-flag = 'X'.
          msg = sy-tabix.
          condense msg.
          concatenate 'Row Number ' msg ' ' into msg
          separated by space.
          message msg type 'I'.
        endif.
      ENDLOOP.
    ENDFORM. "ITAB_user_command
    regards,
    amit m.

  • Multiple selection of Checkboxes in ALV

    Hi All
    I have created an ALV Report in which Final Internal Table(Fields to be displayed) is having a Field as CheckBox.
    Problem is when I'm clicking multiple checkboxes only single field of table is getting updated but I want multiple rows to be updated. I have tried by using loop also but no use.
    Please check the code.
      case r_ucomm.
        when '&DATA_SAVE'.
          loop at it_data into wa_data.
              read table it_fpla into wa_fpla with key vbeln = wa_data-vbeln.
              if sy-subrc = 0.
            if wa_data-check = 'X'.
               read table it_fplt into wa_fplt index rs_selfield-tabindex.
                if sy-subrc = 0.
                  update fplt
                         set faksp = ' '
                     where fplnr = wa_fplt-fplnr and fkdat = wa_fplt-fkdat.
                endif.
              endif.
            endif.
          endloop.
    Regards.

    Hi Nikhil,
    u need to use this fm to capture the changes done in the checbox 'GET_GLOBALS_FROM_SLVC_FULLSCR' and this method check_data_changed....
    check this sample code
    FORM user_command USING r_ucomm TYPE sy-ucomm
                        rs_selfield TYPE slis_selfield  .
      DATA:p_valid,
            l_repid TYPE sy-repid.
      MOVE: sy-repid TO l_repid.
      CASE r_ucomm .
        WHEN 'EXEC' .
          REFRESH: it_smart.
          CLEAR p_ref1.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_repid = l_repid
              e_grid  = p_ref1.
          CALL METHOD p_ref1->check_changed_data
            IMPORTING
              e_valid = p_valid.
          LOOP AT it_output INTO wa_output WHERE cbox EQ 'X'.
            READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_output-matnr werks = wa_output-werks lgort = wa_output-lgort.
            IF sy-subrc EQ 0.
              wa_smart-lgpbe = wa_mard-lgpbe.
            ENDIF.
            wa_smart-matnr =  wa_output-matnr.
            wa_smart-maktx =  wa_output-maktx.
            READ TABLE it_meins INTO wa_meins WITH  KEY matnr = wa_output-matnr.
            IF sy-subrc EQ 0.
              wa_smart-meins = wa_meins-meins.
            ENDIF.
    *        wa_smart-meins =  wa_output-meins.
            wa_smart-bldat =  wa_output-bldat.
            wa_smart-no_cop = wa_output-menge.
            APPEND wa_smart TO it_smart.
            CLEAR: wa_smart,wa_output.
          ENDLOOP.

  • ALV LIST with few checkboxes fields

    Hi everyone,
    I want to create an ALV with 2 fields that are checkboxes.
    I am succeeding to create an ALV with one checkbox field.
    How do we do in order to create an ALV with 2 checkboxes fields using ALV LIST ?
    I know that we have to specify in the layout of the ALV the name of the field we want it to be checkbox.
    For example :
      gs_layout-box_fieldname   = 'FLAG'.            
    But, how do we specify a second checkbox field ?
    Thanks.
    Regards.

    Slight modification to my earlier post. this is with 2 checkboxes.
    REPORT  ztest_alv_checkbox.
    TYPE-POOLS: slis.
    DATA: it_fcat TYPE  slis_t_fieldcat_alv,
          wa_cat LIKE LINE OF it_fcat.
    DATA: BEGIN OF it_alv OCCURS 0,
           check1(1),
           check2(1),
           carrid LIKE sflight-carrid,
           connid LIKE sflight-connid,
          END OF it_alv.
    DATA:it_events TYPE slis_t_event,
         wa_events LIKE LINE OF it_events.
    SELECT carrid
           connid
      FROM sflight
      INTO CORRESPONDING FIELDS OF TABLE it_alv
      UP TO 20 ROWS.
    wa_cat-fieldname = 'CHECK1'.
    wa_cat-input = 'X'.
    wa_cat-edit = 'X'.
    wa_cat-checkbox = 'X'.
    wa_cat-seltext_l = 'Check'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'CHECK2'.
    wa_cat-input = 'X'.
    wa_cat-edit = 'X'.
    wa_cat-checkbox = 'X'.
    wa_cat-seltext_l = 'Check'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'CARRID'.
    wa_cat-seltext_l = 'Carrid'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    CLEAR wa_cat.
    wa_cat-fieldname = 'CONNID'.
    wa_cat-seltext_l = 'Connid'.
    wa_cat-tabname = 'IT_ALV'.
    APPEND wa_cat TO it_fcat.
    wa_events-name = slis_ev_end_of_list.
    wa_events-form = 'MODIFY_LIST'.
    APPEND wa_events TO it_events.
    CLEAR wa_events.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        it_fieldcat        = it_fcat
        it_events          = it_events
      TABLES
        t_outtab           = it_alv
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc NE 0.
    ENDIF.
    "After The list display i am modifying the report output
    "using the END_OF_LIST event of ALV
    "here conditionally i can make the cell input off
    *&      Form  MODIFY_LIST
    *       text
    FORM modify_list.
      DATA: l_lines TYPE i,
            l_index TYPE i.
      l_lines  = l_lines + 3.
      "because we have 3 lines extra occupied by lables.
      "if we have header,i mean top of page add the no.of lines
      "how many ever top of page have + 3 for labels.
      DESCRIBE TABLE it_alv LINES l_lines.
      l_lines  = l_lines + 3.
      "understnad this part alone.
      DO l_lines TIMES.
        IF sy-index GT 3.
          l_index = sy-index - 3.
          READ TABLE it_alv INDEX l_index.
          "this is my condition..
          IF sy-subrc = 0 .
            IF it_alv-carrid <> 'AA'.  "place your condition here.
              "accordingly you can disable the checkbox
              "use the below logic
              READ LINE sy-index INDEX sy-lsind.
              IF sy-subrc = 0.
                MODIFY LINE sy-index INDEX sy-lsind
                           FIELD FORMAT  it_alv-check1 INPUT OFF
                                         it_alv-check2 INPUT OFF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDDO.
    ENDFORM.                    "MODIFY_LIST

  • How to create Multiple ALV Lists, Each list on one new page

    Hi All,
    I have a requirement of displayiong data on multiple ALV Lists.
    Ex:
    I have data in internal table MATNR QTY   VALUE
    M1   2    3USD
    M1   2    3USD
    M2   2    3USD
    M2   2    3USD
    M3   2    3USD
    M3  2    3USD
    M4  2    3USD
    M4   2    3USD
    In The above internal table data , i have to displat M1 on one page and M2 on second,M3 on third and M4 on 4th page.....This may go to MN.
    I have tried to do this with REUSE_ALV_BLOCK_LIST_APPEND, But if Lists are fixed like 3 or 4 , I can use this method.
    Can any one help me on this?
    Thanks,
    Suresh.

    Hi Peter,
    Yes I think that this is the way we will be probably go but not sure what the correct terms are for what I am looking for. Not sure if you are allowed to post examples of specific commercial plug ins here but if not, what should I search for. I know if sounds daft but it's a real case of not knowing what it is I am looking for. I am a complete InDesign newcomer who uses it at the moment for simple flyers etc so more than happy to find someone who can do the more complex stuff for me. The price lists will need to be done inhouse and on a regular basis.
    thanks
    Jen

  • ALV list: Multiple headerlines?!

    Hi
    I need multiple headerlines in my ALV list, as shown here:
    Books--MagasinDVD--
    Paper-electronPaper-Electron--XXXyyy---
    ====================================================
    232    444       21     998         6655   12
    Books, Magasin, and DVD is written as headerline1,
    paper, electron, paper, electron, xxx, yyy is written as headerline 2.
    Then items line is written.
    Can/will anybody help me, please?
    Best regards.
    L

    You can do this in the top-of-page event of ALV.sample code is as below :
    data :
    IT_EVENTS      TYPE SLIS_T_EVENT,
    IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
    G_TOP_OF_PAGE  TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    *Build the event table
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = IT_EVENTS.
      READ TABLE IT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE G_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO IT_EVENTS.
      ENDIF.
      REFRESH LT_MATNR[].
      LOOP AT SO_MATNR.
        LT_MATNR-MATNR = SO_MATNR-LOW.
        APPEND LT_MATNR.
      ENDLOOP.
      CLEAR LV_TEXT.
      DATA : LV_INDEX TYPE I,LV_MATNR1 LIKE LIPS-MATNR,LV_MATNR2 LIKE LIPS-MATNR.
      LV_TEXT = 'Products:'.
      DESCRIBE TABLE LT_MATNR LINES LV_INDEX.
      IF NOT LV_INDEX IS INITIAL.
        READ TABLE LT_MATNR INTO LV_MATNR1  INDEX 1.
        READ TABLE LT_MATNR INTO LV_MATNR2 INDEX LV_INDEX.
        IF LV_MATNR2 IS INITIAL.LV_MATNR2 = LV_MATNR1.ENDIF.
        CONCATENATE LV_TEXT LV_MATNR1 'To' LV_MATNR2 INTO LV_TEXT
        SEPARATED BY SPACE.
        LS_LINE-TYP  = 'H'.
        LS_LINE-INFO = LV_TEXT.
        APPEND LS_LINE TO IT_LIST_TOP_OF_PAGE.
        CLEAR LS_LINE.
      ENDIF.
      REFRESH LT_SHTYP[].
      IF NOT SO_SHTYP[] IS INITIAL.
        LOOP AT SO_SHTYP.
          LT_SHTYP-SHTYP = SO_SHTYP-LOW.
          APPEND SO_SHTYP.
        ENDLOOP.
        CLEAR :LV_TEXT,LV_INDEX..
          FORM TOP_OF_PAGE                                              *
    FORM TOP_OF_PAGE.
      ULINE.
      WRITE : SY-TITLE(65) CENTERED, 'Page :' , SY-PAGNO .
      ULINE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
               I_LOGO             = 'ENJOYSAP_LOGO'
                IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
      ULINE.
    ENDFORM.                    "TOP_OF_PAGE
        DATA : LV_SHTYP1 LIKE VTTK-SHTYP ,LV_SHTYP2 LIKE VTTK-SHTYP.
        DESCRIBE TABLE LT_SHTYP LINES LV_INDEX.
        IF NOT LV_INDEX IS INITIAL.
          READ TABLE  LT_SHTYP INTO LV_SHTYP1  INDEX 1.
          READ TABLE LT_SHTYP INTO LV_SHTYP2 INDEX LV_INDEX.
          IF LV_SHTYP2 IS INITIAL.LV_SHTYP2 = LV_SHTYP1.ENDIF.
          CONCATENATE LV_TEXT LV_SHTYP1 'To' LV_SHTYP2 INTO LV_TEXT
          SEPARATED BY SPACE.
          LS_LINE-TYP  = 'H'.
          LS_LINE-INFO = LV_TEXT.
          APPEND LS_LINE TO IT_LIST_TOP_OF_PAGE.
          CLEAR LS_LINE.
        ENDIF.
      ENDIF.
      CLEAR LV_TEXT.
      CONCATENATE SO_DATE-LOW6(2) SO_DATE-LOW4(2) SO_DATE-LOW+0(4)
      INTO LV_LOW SEPARATED BY '.'.
      CONCATENATE SO_DATE-HIGH6(2) SO_DATE-HIGH4(2) SO_DATE-HIGH+0(4)
      INTO LV_HIGH SEPARATED BY '.'.
      IF LV_HIGH = '00.00.0000'. LV_HIGH = LV_LOW.ENDIF.
      CONCATENATE 'Posting Date:' LV_LOW 'to' LV_HIGH
      INTO LV_TEXT SEPARATED BY SPACE.
      LS_LINE-TYP  = 'H'.
      LS_LINE-INFO = LV_TEXT.
      APPEND LS_LINE TO IT_LIST_TOP_OF_PAGE.
      CLEAR LS_LINE.

Maybe you are looking for

  • What is wrong with my 30" Cinema Display?  The USB and FireWire ports still work, but the screen is pitch black. When you plug it into the computer, it detects that it's a Cinema Display.

    When you plug it into the computer, it detects that it's a Cinema HD but the screen is pitch black. For some reason, the USB and FireWire ports still work.

  • Flash & IE crash

    Hey guys, Can you tell me all of the reasons why flash content will crash IE with the error "This application has requested the Runtime to terminate it in an unusual way"? I'm trying to remote debug another teams game, where it continually crashes in

  • Good old EJBException question...

    I've trawled through this forum for a good explanation of EJBException versus RemoteException. I've not found anything I consider particularly intuitive. In fact, I've been amazed by some of the confusion that seems to exist about this, with some peo

  • Ale and IDOC

    hi all,       can i know where and when change pointers, message control and executable will be used, can any one provide me example for each concept. thank you

  • Intermedia Search...

    I have a problem searching for subclasses. I created an object with a subobject. In this subobject I store a document. As I can see from intermedia4s log files, the files has been indexed. But I can4t find it with der search-APIs or with the WebUI. W