How to alv grid rows&columns

Hey,
How to know number of rows and columns in alv grid are used.

Hi,
You can count the number of rows , by using describe statemet,
describe table itab lines v_lines.
itab is table used to display in ALV
Thanks & Regards,
Navneeth K.

Similar Messages

  • How to print the row  ,column,and particular cell in separate color

    how to print the row  ,column,and particular cell in separate color IN ALV GRID

    HI,
    Here you go good program links
    <a href="http://www.sapfans.com/forums/viewtopic.php?t=52107">How to Set Color to a Cell in AVL</a>
    <a href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm">ALV Grid Coloring</a>
    Thanks
    Mahesh

  • How to read a alv grid row data from standard program

    Hi All,
    I am working on transaction LBK1. Actually when you will open this transaction in the left hand side it will show you the data in tree. When you click on a notification node it will show the relevant data in right side. In which there is a operation tab . In this tab the data comes in alv grid. If user selects a row then I have to get that selected row value. There is also a toolbar above on the tree side. There are some buttons which execute our implementation class where I can put the code.  
    Can anyone please help me out? How I can read that selected row in our class/method?
    Thanks in advance.
    Best Regards
    Ritu

    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similiar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows fronm the table. In the examples below the grid table is named gi_sflight.
    Data declaratrion:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.

  • ALV GRID Display Column Width problem when filtering

    Hello All,
       When i displaying ALV Grid Display ,i selected one column and set filter for that.
    the problem is column width at display is 12 charecters but in filter it is allowing only 10 charecters to enter which is wrong. i am unable to set filter.please give solution.
    Thanks
    Sandeep.G

    hello i am calling perform, ineed to set OUTPUTLEN according to field length how can i do that.
    FORM fill_fieldcat  USING  p_field TYPE slis_fieldcat_alv-fieldname
                               p_text  TYPE slis_fieldcat_alv-seltext_l
                               p_flag TYPE c.
      wa_fieldcat-fieldname    = p_field.
      wa_fieldcat-seltext_l    = p_text.
      wa_fieldcat-no_out  = p_flag.
       wa_fieldcat-outputlen = 20.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.

  • ALV grid row selection event

    Hi,
    I have alv grid using cl_gui_alv_grid. I want to capture the row selection event and display the detail below the table.
    how do I capture the row selection.? I want to display the details below as and when the row selection changed.
    Regards
    Panneer

    More detail example, also works with multiple selections:
    data go_alv type ref to cl_gui_alv_grid.
    data go_handler type ref to lcl_event_receiver.
    *       CLASS lcl_event_receiver DEFINITION
    class lcl_event_receiver definition.
      public section.
        methods delayed_change_select
                for event delayed_changed_sel_callback of cl_gui_alv_grid.
    endclass.                    "lcl_event_receiver DEFINITION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    class lcl_event_receiver implementation.
      method delayed_change_select.
        message 'Selection changed' type 'S'.
      endmethod.                    "delayed_change_selection
    endclass.                    "lcl_event_receiver IMPLEMENTATION
    *&      Module  STATUS_0100  OUTPUT
    module status_0100 output.
      data lt_fcat_lvc type lvc_t_fcat.
      data lt_fcat_alv type slis_t_fieldcat_alv.
      data ls_layo type lvc_s_layo.
      set pf-status 'MAIN'.
      if go_alv is initial.
        ls_layo-sel_mode = 'A'.
    *   ls_layo-sel_mode = 'B'.    "Also works
    *   ls_layo-sel_mode = 'C'.    "Also works
    *   ls_layo-sel_mode = 'D'.    "Also works
        call method go_alv->set_table_for_first_display
          exporting
            is_layout       = ls_layo
          changing
            it_fieldcatalog = lt_fcat_lvc
            it_outtab       = gt_data[].
        create object go_handler.
        set handler go_handler->delayed_change_select for go_alv.
        call method go_alv->register_delayed_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_delayed_change_select.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT

  • ALV Grid row selection possible options

    Hello Experts,
    I have an ALV Grid output with rows color codes based on certain status for each rows.Now when the user selects one or more lines to do the next process, what happens now as sap standard is the selected lines becomes highlighted ( kind of yellowish) and the selection button gets pressed.
    But what the user is requesting is ,lets say he selects one blue and another red line, then both becomes yellow (because of the SAP standard highlighting) ...he would like those line colors to be still red and blue and only the selection button pressed.
    Is there a way to do that is ALV grid? I'm trying to convince him to look at the status colum if he gets confused with what colors he selected or I will have to use a checkbox field as the first column and and hide the ALV selection option.
    But was curious to find if this is possible in ALV?Or any other suggestions to handle this requirement is welcome.
    Mat

    Hi Mat,
    I am curious if your user is so arogant when he buys a car too. Does he say to dealer "Sorry I don't want this gear lever to be placed here and here, I want it a litte bit higher. Can you please fix that?". This sounds like you are struggling with dumb user. I have never heard of someone complaining that the standard highlight is in wrong color. You already provided to him row colors, right? I think most of the users would be hugging you for such facilities.
    I think in your case as the user is inalterable you should go for the checkboxes as you say. This way maybe you will somehow satisfy his needs (as the row colors will be kept even during selection). Personally I wouldn't bother such requirements. As long as the program reports correct data, he should not complain at all.
    Good luck then
    Marcin

  • ALV grid row mark

    How can I create an alv without creating it with edit mode? I only want to have the columns to mark the rows but without editing function.
    I don't find it in structure LVC_S_LAYO. At the moment I take
      gs_layout-edit = 'X'.
    but then I can edit all data, I only want to select with the row column, is that possible?

    Use:
    LVC_S_LAYO-SEL_MODE = 'A',
    You have to switch editing off, otherwise it may overwrite this setting.
    Then, to get what is selected use one of the methods:
    GET_SELECTED_CELLS
    GET_SELECTED_CELLS_ID
    GET_SELECTED_ROWS
    GET_SELECTED_COLUMNS
    Regards
    Marcin

  • Eable indivadule cells editable by selected ALV Grid rows.

    Now i encounter the case that in an ALV Grid list, the value column A can be entered by user if cell is blank in some rows.
    .user will click on an EDIT button to make these cells editble for input value. is it possible to implenment the case?
    BTW, I used the FM 'REUSE_ALV_GRID_DISPLAY'  to generated the ALV list.

    Hi,
    First set the field catalog's EDIT field to 'X'.
    Please try this links:
    <<Linkfarm deleted>>
    Thank you.
    Thanks,
    AMS
    Edited by: kishan P on Aug 26, 2010 5:21 PM

  • Hiding zero in ALV(Particular Row/Column alone)

    I use ALV Grid  for displaying the output in the tabular form. It has one key field and 4 numeric fields. Always it will have only 7 rows. Now I should not display 0 if the row 4 does not have any values(Since it is a numeric field, by default zero will come). Rest of the rows should contain zero value if there is no value.
    If I should not display zero for all the rows, then I can simply pass no_zero = u2018Xu2019 in the field catalog. But this should happen only for the particular row (4th row alone). Please advise me.

    Hi Selva,
    I am posting a example code, in this some paticular cells of ALV Grid are in editable mode. just analyse this example this may help you..
    FORM build_fieldcatalog.
      wa_fieldcat-fieldname   = 'EBELN'.
      wa_fieldcat-scrtext_m   = 'Purchase Order'.
      wa_fieldcat-col_pos     = 0.
      wa_fieldcat-outputlen   = 10.
      wa_fieldcat-emphasize   = 'X'.
      wa_fieldcat-key         = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'EBELP'.
      wa_fieldcat-scrtext_m   = 'PO Item'.
      wa_fieldcat-col_pos     = 1.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MEINS'.
      wa_fieldcat-scrtext_m   = 'Order Unit'.
      wa_fieldcat-col_pos     = 6.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'NETPR'.
      wa_fieldcat-scrtext_m   = 'Net Price'.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      wa_fieldcat-col_pos     = 7.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-datatype     = 'CURR'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'PEINH'.
      wa_fieldcat-scrtext_m   = 'Price Unit'.
      wa_fieldcat-col_pos     = 8.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    FORM build_layout.
    * Set layout field for field attributes(i.e. input/output)
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    FORM display_alv_report.
      gd_repid = sy-repid.
    *  call function 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_user_command =  USER_COMMAND
                is_layout_lvc               = gd_layout
                it_fieldcat_lvc             = it_fieldcat
                i_save                  = 'X'
           TABLES
                t_outtab                = it_ekko
           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.                    " DISPLAY_ALV_REPORT
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO  CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    form set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    " Populate style variable (FIELD_STYLE) with style properties
    " The NETPR field/column has been set to editable in the fieldcatalog...
    " The following code sets it to be disabled(display only) if 'NETPR'
    " is gt than 10.
      LOOP AT it_ekko INTO wa_ekko.
        IF wa_ekko-netpr GT 10.
          ls_stylerow-fieldname = 'NETPR' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                                 "set field to disabled
          APPEND ls_stylerow  TO wa_ekko-field_style.
          MODIFY it_ekko FROM wa_ekko.
        ENDIF.
      ENDLOOP.
    endform.                    " set_specific_field_attributes
    FORM USER_COMMAND.
    CASE SY-UCOMM.
       WHEN 'ENTER'.
       ENDCASE.
      ENDFORM.
    Regards,
    Murthy

  • Multiple Hotspots in a ALV Grid single column

    Hi Experts,
    My ALV Grid report output looks like below....
    If you observe below output, column 3 has multiple documents each one separated by ' ; '. Now, I would like to assign hotspot on each documents like DOC1, DOC2, DOC3, etc.
    Heading#:          COL1 | COL2 | COL3 |
    Records1:              1      |  xxxxx  | _DOC1_ ; DOC2 ; *DOC3*
    Records2:              2      |  xxxxx  | _DOC1_ ; DOC5 ;
    I know, we can assign hotspot for entire column. but my requirement is multiple hot spots in a single column.
    Please help me on this?
    Thanks in Advance
    Raghu

    As I mentioned earlier,
    My ALV Grid report output looks like below....
    Heading#: FIELD1 | FIELD2 | FIELD3 |
    Records1: 1 | xxxxx | DOC1 ; DOC2 ; DOC3
    Records2: 2 | xxxxx | DOC1 ; DOC5 ;
    If you observe above output, field 3 has multiple documents each one separated by ' ; '.
    When I click on DOC1, it supposed to display related picture on the POP-Up Screen. Similarly when I click on DOC2, it supposed to display that document picture on POP-up screen.
    Before going to do this, first I need to assign hotspots on each documents like DOC1, DOC2, DOC3, etc.
    Please help me.

  • Alv grid background column headings

    HI EVERYONE,
    I was able to execute the ALV grid report in background .But columns heading is reeating for
    each page.
    Can't we just just have the Column Headings once for all pages.?

    For the IS_LAYOUT parameter it is possible to set NO_COLHEAD = 'X'. Then the header is gone. Then you have to create first line in table with texts. But then all fields must be character fields.
    Regards
    Roy

  • Hierarchical ALV - enabling row/column input

    Hello,
    I'm going to incoporate the hierarchical ALV in a report.  Let's say I have 5 item rows for a header row, is it possible to make individiual rows input enabled?  Meaning, of the 5 item rows, I wish to make two of them editable, but not the other three. 
    I've done the standard ALV and made columns input enabled when building the fieldcat, but this applied to all rows, which I don't want in my scenario.
    Any help would be appreciated.
    Thanks

    Hello,
    Input enable is a parameter of fieldcat but you have to specify the internal table that you used in header row or item row.
    You create a data ZHEAD and ZITEM that you transfer in fieldcat data "table"
    Don't forget the clear when youo fill this internal table
    Regards
    sebastien

  • Can i raise any event on the ALV  GRID row selection.

    Hi All ,
            Is there any way to trigger any event upon the selction of the ALV <b>GRID</b> rows?
    Suppose i have 2 grid controls  1 for Header and the other for corresponding line items . I would have already the header data (differnt document headers)  populated , upon selecting (i don't want any user click or button click) one of the header i want to do some changes to the corresponding line times for the header data selected...
    Please give me some tips on how to  go about on this .
    Thanks,
    ALFH

    <b>upon selecting ?</b>
    how the user will select , since you dont want user click or button click?
    one option is to have hotspot, but again user has to click .
    Regards
    Raja

  • ALV grid Row Height

    Is it possible to adjust row height of alv output?  I have a grid being displayed on a touch screen and it's difficult to choose a row.  I want to make them about double the height on display.

    Hello Michelle
    There is no possibility to change the row height. The only possible way I see would be to reduce the <b>resolution </b>of the touch screen.
    Regards
      Uwe

  • How to set different row - column visibility attribute

    Hi all:
       I have one table in webdynpro for java. For example it have 4 rows, I need to set one column as different visible for row 1st and row 2nd .
               column1   column2
    row1      x               -
    row2      -               x
    Can I set it ?
    Thanks a lot.

    ya sure, u can
    make a visibility element and assign it to the tablecelleditor of each column of ur table. Now in the code, u must have bound the table to a node,  make the visibility element in the same node. Whichever row u want to make invisible, write the following code:
    wdcontext.node<nodename>.get<node name>elementat(<the row which u wish to make invisible>).set<visibility context>(wdvisibility.NONE);
    it will work.
    Let me know if u need further help....
    All The Best!!!
    Regards
    Gita

Maybe you are looking for

  • Windows 7 - no generic PS driver

    Just installed Windows 7 64 and when I try to run Bonjour to add the Canon MP830 printer on the iMac, it doesn't present me with the generic PS driver. It shows some other generic drivers but not the PS. I tried to install the Canon driver on the Win

  • Losing system date in windows XP Pro

    I have two "number crunchers" based on K7N2GM-V motherboards that run 24/7 with the CPU pegged at 100%.  Both have AMD Athlon barton core CPUs.  One has a XP 2600 (OPN AXDA2600DKV4D) and the other has a 2500 (OPN AXDA2500DKV4D).  The 2600 was clocked

  • Error in Workflow for Service Confirmation

    Hello, We are using SAP SRM 7.0 for our project with Extended classical scenario. We need to build a workflow for Service confirmation approval. We are supposed to use the Process controlled workflows. I am using the standard workflow template WS4000

  • CC assessment to PA based on Stat key fig on internal orders?

    Hi Experts Please assist me.  Is it possible to capture key statistical figures on numerous Internal orders representing vehicle numbers.  Then by using the assessment of cost centre cost to PA, use these statistical key figures as a tracing factor t

  • OA PPR vs AJAX

    Hi all, I was trying to think of the difference between OA PPR and AJAX. PPR also submits a request using javascript like AJAX. But I think it is not the same as AJAX somehow. Would be interested to discuss this in the thread here :). Best Regards, S