Editable Blocked ALV

HI,
    I have created a Blocked ALV with 2 blocks..
first block is editable by the user , I want to store the editted date into my Internal table for further processing..
Kindly guide me how to do..
Plz dont give any links... all sites are blocked here except SDN
With Rgds,
S.barani

Hi,
  keep the button in the alv toolbar such save then modify
CLASS L_CL_EVENTS DEFINITION                                        *
Class for inserting buttons on the toolbar                          *
CLASS l_cl_events DEFINITION.
  PUBLIC SECTION.
    METHODS:
      toolbar FOR EVENT toolbar
              OF cl_gui_alv_grid
              IMPORTING e_object
                        e_interactive,
      user_command FOR EVENT user_command
                   OF cl_gui_alv_grid
                   IMPORTING e_ucomm .
ENDCLASS.                              " L_CL_EVENTS DEFINITION
CLASS L_CL_EVENTS IMPLEMENTATION                                    *
Implementation of class L_CL_EVENTS                                 *
CLASS l_cl_events IMPLEMENTATION.
  METHOD toolbar.
    PERFORM event_toolbar USING e_object.
  ENDMETHOD.                           " TOOLBAR
  METHOD user_command.
    PERFORM event_ucomm USING e_ucomm.
  ENDMETHOD.                           " USER_COMMAND
ENDCLASS.                              " L_CL_EVENTS IMPLEMENTATION
FORM EVENT_TOOLBAR                                                  *
Setting toolbar in the alv grid                                     *
-->E_OBJECT TYPE REF TO CL_ALV_EVENT_TOOLBAR_SET                    *
FORM event_toolbar USING e_object
                         TYPE REF TO cl_alv_event_toolbar_set.
Local declaration for the button.
  DATA: ls_toolbar TYPE stb_button.
To add Approve button
  ls_toolbar-function  = 'approve'.
  ls_toolbar-butn_type = 0.
  ls_toolbar-text      = 'APPROVE'.
  APPEND ls_toolbar TO e_object->mt_toolbar.
ENDFORM.                               " EVENT_TOOLBAR
FORM EVENT_UCOMM                                                    *
After Input in the ALV grid,if user select record and press         *
approve or reject then the record will get updated                  *
--> PR_ucomm type sy-ucomm                                          *
FORM event_ucomm USING pr_ucomm LIKE sy-ucomm.
  CASE pr_ucomm.
If e_ucomm contains 'APP' i.e.function code for Approve button
    WHEN 'APPROVE'.              " To approve selected record
      PERFORM app_timesheet USING c_approve_status.
  ENDCASE.                             " CASE E_UCOMM
ENDFORM.                               " EVENT_UCOMM
In pai of the screen call this method.
To change the data.
  CALL METHOD g_alv->check_changed_data.
then ur data will get modified and the data will be modified in ur output table then from ur out put table u can get the changed dates .
If u have any queries post me again.

Similar Messages

  • How to 'EDIT field in a block AlV"

    <b>Hi Experts.
    i am having  a small query . i want to display some output in the block alv.
    After that i want one field in that Block Alv to be filled by the user  and then i
    want to do further calculation depending upom that field..
    please provide me support in this regard with coding part..
    An early reply will be highly appreciated...
    Regards.
    Neeraj</b>

    Hi,
    This is the sample program for displaying the two blocks in alv report.
    REPORT  YMS_ALVBLOCK.
    Declarations for BLOCK ALV DISPLAY
    *--type pools
    TYPE-POOLS:SLIS.
    DATA:X_LAYOUT TYPE SLIS_LAYOUT_ALV,
    T_FIELD TYPE SLIS_T_FIELDCAT_ALV,
    *--field catalog
    X_FLDCAT LIKE LINE OF T_FIELD,
    *--to hold all the events
    T_EVENTS TYPE SLIS_T_EVENT,
    X_EVENTS TYPE SLIS_ALV_EVENT,
    T_SORT TYPE SLIS_T_SORTINFO_ALV,
    X_SORT LIKE LINE OF T_SORT ,
    *--Print Layout
    X_PRINT_LAYOUT TYPE SLIS_PRINT_ALV.
    *----Macro to add field catalog.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    DEFINE ADD_CATALOG.
      CLEAR X_FLDCAT.
      X_FLDCAT-FIELDNAME = &1.
      X_FLDCAT-SELTEXT_M = &2.
      X_FLDCAT-OUTPUTLEN = &3.
      X_FLDCAT-TECH = &4.
      X_FLDCAT-COL_POS = &5.
      X_FLDCAT-NO_ZERO = 'X'.
      X_FLDCAT-DDICTXT = 'M'.
      X_FLDCAT-DATATYPE = &6.
      X_FLDCAT-DDIC_OUTPUTLEN = &7.
      IF &6 = 'N'.
        X_FLDCAT-LZERO = 'X'.
      ENDIF.
    *--build field catalog
      APPEND X_FLDCAT TO T_FIELD.
    END-OF-DEFINITION.
    *----- data declerations.
    DATA: V_REPID LIKE SY-REPID.
    DATA: BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ERNAM LIKE MARA-ERNAM,
    MEINS LIKE MARA-MEINS,
    END OF ITAB.
    DATA: BEGIN OF JTAB OCCURS 0,
    MATNR LIKE MAKT-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    END OF JTAB.
    SELECT MATNR ERNAM MEINS
    UP TO 20 ROWS
    FROM MARA
    INTO TABLE ITAB.
    SELECT MATNR MAKTX
    UP TO 20 ROWS
    FROM MAKT
    INTO TABLE JTAB.
    V_REPID = SY-REPID.
    *DISPLAY alv
    Initialize Block
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM = V_REPID.
    *Block 1:
    *INITIALIZE
    REFRESH T_FIELD. CLEAR T_FIELD.
    REFRESH T_EVENTS.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    ADD_CATALOG:
    'MATNR' 'Material' '18' '' '1' 'C' '18',
    'ERNAM' 'Created By' '12' '' '2' 'C' '12',
    'MEINS' 'Unit' '5' '' '3' 'C' '3'.
    *--build table for events.
    X_EVENTS-FORM = 'TOP_OF_LIST1'.
    X_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
    APPEND X_EVENTS TO T_EVENTS.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                  = X_LAYOUT
        IT_FIELDCAT                = T_FIELD
        I_TABNAME                  = 'ITAB'
        IT_EVENTS                  = T_EVENTS
        IT_SORT                    = T_SORT
      TABLES
        T_OUTTAB                   = ITAB
      EXCEPTIONS
        PROGRAM_ERROR              = 1
        MAXIMUM_OF_APPENDS_REACHED = 2
        OTHERS                     = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *--BLOCK 2(SUMMARY REPORT)
    *INITIALIZE
    REFRESH T_FIELD. CLEAR T_FIELD.
    REFRESH T_EVENTS.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    ADD_CATALOG:
    'MATNR' 'Material' '20' '' '1' 'C' '18',
    'MAKTX' 'Description' '40' '' '2' 'C' '40'.
    *--build table for events.
    X_EVENTS-FORM = 'TOP_OF_LIST2'.
    X_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
    APPEND X_EVENTS TO T_EVENTS.
    Append table block.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                  = X_LAYOUT
        IT_FIELDCAT                = T_FIELD
        I_TABNAME                  = 'JTAB'
        IT_EVENTS                  = T_EVENTS
      TABLES
        T_OUTTAB                   = JTAB
      EXCEPTIONS
        PROGRAM_ERROR              = 1
        MAXIMUM_OF_APPENDS_REACHED = 2
        OTHERS                     = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *--CALL FM TO DISPLAY THE BLOCK REPORT.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    exporting
    is_print = x_print_layout
    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.
    *&      Form  top_of_list1
          text
    FORM TOP_OF_LIST1.
      SKIP 1.
      WRITE: 10 'List 1',
      /5 '----
      SKIP 1.
      FORMAT RESET.
    ENDFORM.                    "top_of_list1
    *&      Form  top_of_list2
          text
    FORM TOP_OF_LIST2.
      SKIP 1.
      WRITE: 10 'List 2',
      /5 '----
      SKIP 1.
      FORMAT RESET.
    ENDFORM.                    "top_of_list2
    Thanks,
    Shankar

  • Subtotal in Blocked ALV

    Hi All,
    I am facing the problem in displaying the subtotal in Blocked ALV.
    My requirement is, I need to display the subtotals in 3 lines like below.
    for ex:
    subtotal:          7 <above total>
                          (5)<coming from someother field>
                           2
    from the above: 7 is total of that column.
                              5 is coming from some other field.
                              2 is substraction of above 2.
    Could anyone please help me in the above.
    Many thanks in advance.
    Regards,
    venkat.

    Hi Vaibhav,
    Thanks for your response.
    and one thing here in my above example is,  the value  5 is neither total nor subtotal. its just a different value coming from some other field.
    only the 7 is total of that column.
    and if I write that logic manually, It may not able display as the position of that column is around 500. because write statment may display upto 252nd position in the output, I guess.
    thank you very much.
    Regards,
    Venkat.
    Edited by: venkat reddy on Jan 18, 2010 8:45 PM

  • Header and Logo in Blocked ALV

    Is It possible to put header and logo in Blocked ALV Report.
    Is yes shall I go with the same way we put the Header and Logo in ALV Grid report.
    Thanks in Advance.

    Hi,
    You can put the haeder and logo  same like we have used to do in classical ALV's....
    sample code snippet..
    REPORT  ZALV_BLOCKEDALV .
    *provide tables
    TABLES: MARA, MAKT, MARD.
    *provide type-pools
    TYPE-POOLS: SLIS.
    *provide select-options
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    *provide data objects
    DATA: V_REPID TYPE SY-REPID,
          WA_MARA_FIELD TYPE SLIS_FIELDCAT_ALV,       "it is for field catalog
          WA_MAKT_FIELD TYPE SLIS_FIELDCAT_ALV,
          WA_MARD_FIELD TYPE SLIS_FIELDCAT_ALV,
          WA_MARA TYPE MARA,
          WA_MAKT TYPE MAKT,
          WA_MARD TYPE MARD,      IT_MARA_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          IT_MAKT_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          IT_MARD_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          IT_MARA TYPE TABLE OF MARA,
          IT_MAKT TYPE TABLE OF MAKT,
          IT_MARD TYPE TABLE OF MARD,      V_LAYOUT TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS TYPE SLIS_T_EVENT,            "it is for events
          WA_EVENTS TYPE SLIS_ALV_EVENT.V_REPID = SY-REPID.
    *provide field catalog perform
    PERFORM FIELD_CAT.
    *call the initial function module
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = V_REPID
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   IT_EXCLUDING                   =
    *provide perform for select the data
    PERFORM SELECT_DATA.
    *call mara append list
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = V_LAYOUT
        IT_FIELDCAT                      = IT_MARA_FIELD[]
        I_TABNAME                        = 'MARA'
        IT_EVENTS                        = IT_EVENTS[]
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARA
    EXCEPTIONS
       PROGRAM_ERROR                    = 1
       MAXIMUM_OF_APPENDS_REACHED       = 2
       OTHERS                           = 3.
    *call makt append list
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = V_LAYOUT
        IT_FIELDCAT                      = IT_MAKT_FIELD
        I_TABNAME                        = 'MAKT'
        IT_EVENTS                        = IT_EVENTS
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MAKT
    EXCEPTIONS
       PROGRAM_ERROR                    = 1
       MAXIMUM_OF_APPENDS_REACHED       = 2
       OTHERS                           = 3.
    *call mard append list
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = V_LAYOUT
        IT_FIELDCAT                      = IT_MARD_FIELD
        I_TABNAME                        = 'MARD'
        IT_EVENTS                        = IT_EVENTS
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARD
    EXCEPTIONS
       PROGRAM_ERROR                    = 1
       MAXIMUM_OF_APPENDS_REACHED       = 2
       OTHERS                           = 3.
    *display the data
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    * EXPORTING
    *   I_INTERFACE_CHECK             = ' '
    *   IS_PRINT                      =
    *   I_SCREEN_START_COLUMN         = 0
    *   I_SCREEN_START_LINE           = 0
    *   I_SCREEN_END_COLUMN           = 0
    *   I_SCREEN_END_LINE             = 0
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER       =
    *   ES_EXIT_CAUSED_BY_USER        =
    * EXCEPTIONS
    *   PROGRAM_ERROR                 = 1
    *   OTHERS                        = 2.
    *&      Form  TOP_PAGE
    *       text
    FORM TOP_PAGE.  WRITE:/ 'THIS IS BLOCKED ALV REPORT PROGRAM BASED ON 3 BLOCKS' COLOR
    5.ENDFORM.                    "TOP_PAGE
    *&      Form  FIELD_CAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FIELD_CAT .WA_MARA_FIELD-COL_POS = 1.
    WA_MARA_FIELD-FIELDNAME = 'MATNR'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 2.
    WA_MARA_FIELD-FIELDNAME = 'ERSDA'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 3.
    WA_MARA_FIELD-FIELDNAME = 'ERNAM'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 4.
    WA_MARA_FIELD-FIELDNAME = 'LAEDA'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MAKT_FIELD-COL_POS = '1'.
    WA_MAKT_FIELD-FIELDNAME = 'MATNR'.
    WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
    APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
    CLEAR WA_MAKT_FIELD.WA_MAKT_FIELD-COL_POS = 2.
    WA_MAKT_FIELD-FIELDNAME = 'MAKTX'.
    WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
    APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
    CLEAR WA_MAKT_FIELD.WA_MAKT_FIELD-COL_POS = 3.
    WA_MAKT_FIELD-FIELDNAME = 'MAKTG'.
    WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
    APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
    CLEAR WA_MAKT_FIELD.WA_MARD_FIELD-COL_POS = 1.
    WA_MARD_FIELD-FIELDNAME = 'MATNR'.
    WA_MARD_FIELD-REF_TABNAME = 'MARD'.
    APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
    CLEAR WA_MARD_FIELD.WA_MARD_FIELD-COL_POS = 2.
    WA_MARD_FIELD-FIELDNAME = 'WERKS'.
    WA_MARD_FIELD-REF_TABNAME = 'MARD'.
    APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
    CLEAR WA_MARD_FIELD.WA_MARD_FIELD-COL_POS = 3.
    WA_MARD_FIELD-FIELDNAME = 'LGORT'.
    WA_MARD_FIELD-REF_TABNAME = 'MARD'.
    APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
    CLEAR WA_MARD_FIELD.WA_EVENTS-FORM = 'TOP_PAGE'.
    WA_EVENTS-NAME = 'TOP_OF_PAGE'.
    APPEND WA_EVENTS TO IT_EVENTS.ENDFORM.                    " FIELD_CAT
    *&      Form  SELECT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SELECT_DATA .SELECT *
    FROM MARA
    INTO TABLE IT_MARA
    WHERE MATNR IN S_MATNR.SELECT *
    FROM MAKT
    INTO TABLE IT_MAKT
    WHERE MATNR IN S_MATNR.SELECT *
    FROM MARD
    INTO TABLE IT_MARD
    WHERE MATNR IN S_MATNR.ENDFORM.                    " SELECT_DATA
    hope  this will help you
    regards,
    kiran
    Edited by: kiran  kumar on Aug 23, 2010 1:43 PM

  • Blocked ALV sub total Display

    hi,
    I'm working with Blocked ALV. In my program, passed the  Fieldcatlog-do_sum = 'X' . But then also i'm not getting totals. For that what i want to do in Blocked ALV.
    Regards,
    Bab

    Hi,
    For ALV Totals you can try doing,
    DATA : it_field TYPE slis_t_fieldcat_alv,
                 wa_field TYPE slis_fieldcat_alv.
    DATA:  itab_sort TYPE slis_t_sortinfo_alv,
                 wa_sort TYPE slis_sortinfo_alv.
      wa_field-fieldname = 'MENGE'.
      wa_field-tabname = 'IT_TAB'.
      wa_field-outputlen = 20.
      wa_field-seltext_l ='Quantity'.
      wa_field-input = ' '.
      wa_field-edit = ' '.
      wa_field-col_pos = '4'.
      wa_field-hotspot = 'X'.
      wa_field-do_sum = 'X'.              "For totalling
      APPEND wa_field TO it_field.
      CLEAR wa_field.
    *Manintainig internal table for sorting
    wa_sort-spos = 1.
      wa_sort-fieldname = 'EBELP'.
      wa_sort-tabname = 'IT_tab'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.              "For totalling
      APPEND wa_sort TO itab_sort.
      CLEAR wa_sort.
    Then you can pass these two internal tables in Reuse ALV grid Function Module.
    Hope it helps
    Regards
    Mansi

  • How to make an interactive block ALV

    Hi,
       I am new to the field of ABAP and have recently started working on ALV's. My problem is that i do not know how to make an interactive block ALV. I have implemented this functionality with the simple ALV but I am not getting the same for block ALV. Anyone who has worked on the same or has any idea please help me.
    Regards.
    Alok Bhardwaj

    Hi jester526,
    You'll need Acrobat to create links in a PDF file. Please see https://acrobatusers.com/tutorials/creating-and-editing-links for instructions.
    Best,
    Sara

  • What is blocked alv

    can any one explain me what is a blocked alv
    Message was edited by:
            ameen shaik

    hi
    This report is used if you have to display more than one report on the output. Technically speaking if you have multiple internal table with data to be displayed as separate blocks then we go for block report of ALV
    This looks like a simple report but this report has the features of sorting
    and filtering only. 
    The important functions used for creating this report are:
         A. REUSE_ALV_BLOCK_LIST_INIT
         B. REUSE_ALV_BLOCK_LIST_APPEND
         C. REUSE_ALV_BLOCK_LIST_DISPLAY
    check with this report
    Declarations for BLOCK ALV DISPLAY
    *--type pools
    TYPE-POOLS:slis.
    DATA:x_layout TYPE slis_layout_alv,
    t_field TYPE slis_t_fieldcat_alv,
    *--field catalog
    x_fldcat LIKE LINE OF t_field,
    *--to hold all the events
    t_events TYPE slis_t_event,
    x_events TYPE slis_alv_event,
    t_sort TYPE slis_t_sortinfo_alv,
    x_sort LIKE LINE OF t_sort ,
    *--Print Layout
    x_print_layout TYPE slis_print_alv.
    *----Macro to add field catalog.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    DEFINE add_catalog.
    clear x_fldcat.
    x_fldcat-fieldname = &1.
    x_fldcat-seltext_m = &2.
    x_fldcat-outputlen = &3.
    x_fldcat-tech = &4.
    x_fldcat-col_pos = &5.
    x_fldcat-no_zero = 'X'.
    x_fldcat-ddictxt = 'M'.
    x_fldcat-datatype = &6.
    x_fldcat-ddic_outputlen = &7.
    if &6 = 'N'.
    x_fldcat-lzero = 'X'.
    endif.
    *--build field catalog
    append x_fldcat to t_field.
    END-OF-DEFINITION.
    *----- data declerations.
    data: v_repid like sy-repid.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    ernam like mara-ernam,
    meins like mara-meins,
    end of itab.
    data: begin of jtab occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of jtab.
    select matnr ernam meins
    up to 20 rows
    from mara
    into table itab.
    select matnr maktx
    up to 20 rows
    from makt
    into table jtab.
    v_repid = sy-repid.
    *DISPLAY alv
    Initialize Block
    call function 'REUSE_ALV_BLOCK_LIST_INIT'
    exporting
    i_callback_program = v_repid.
    *Block 1:
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '18' '' '1' 'C' '18',
    'ERNAM' 'Created By' '12' '' '2' 'C' '12',
    'MEINS' 'Unit' '5' '' '3' 'C' '3'.
    *--build table for events.
    x_events-form = 'TOP_OF_LIST1'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
    exporting
    is_layout = x_layout
    it_fieldcat = t_field
    i_tabname = 'ITAB'
    it_events = t_events
    it_sort = t_sort
    tables
    t_outtab = itab
    exceptions
    program_error = 1
    maximum_of_appends_reached = 2
    others = 3.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *--BLOCK 2(SUMMARY REPORT)
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '20' '' '1' 'C' '18',
    'MAKTX' 'Description' '40' '' '2' 'C' '40'.
    *--build table for events.
    x_events-form = 'TOP_OF_LIST2'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    Append table block.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
    exporting
    is_layout = x_layout
    it_fieldcat = t_field
    i_tabname = 'JTAB'
    it_events = t_events
    tables
    t_outtab = jtab
    exceptions
    program_error = 1
    maximum_of_appends_reached = 2
    others = 3.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *--CALL FM TO DISPLAY THE BLOCK REPORT.
    call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    exporting
    is_print = x_print_layout
    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.
    form top_of_list1.
    skip 1.
    write: 10 'List 1',
    /5 '----
    skip 1.
    format reset.
    endform.
    form top_of_list2.
    skip 1.
    write: 10 'List 2',
    /5 '----
    skip 1.
    format reset.
    endform.
    and this link
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-ProgramforALVBlocklist&
    Hope this helps to solve ur problem....
    do reward if useful....
    regards
    dinesh

  • Blocked ALV - Side By Side

    Dear Friends,
    Thanks in Advance.
    Is there any possibility to get the Blocked ALV's side by side...
    For Example:
    First ALV Block -- GAP -- Second ALV Block -- GAP -- Third One.
    Thanks & Regards:
    Sridhar.J
    Edited by: Sridhar Jampani on Nov 6, 2008 8:11 PM

    Dear Arun
    Thanks for your answer..
    i had checked the program BCALV_TEST_BLOCK_LIST  but it is also print one by one.. i mean one ALV after Another ALV.
    I want to print Side by Side
    Other wise is there any possibility using Hirarcheal Blocked ALV's If you know please tell the Sample Program.
    I dont want using Object Oriented....
    Thanks & Regards:
    Sridhar.J

  • To find total in blocked alv

    hi experts,
    i have created blocked ALV program.
    in the o/p , it displays list of recors for open items,then list of records for cleared items.
    now i want it  to display sum of both open and cleared items of particular column.
    in grid display it is displaying total for open and cleared items.
    but in blocked alv it is not displaying total for open and closed items separately.
    and also i need grand total of both.
    if any body knows please tell me..

    Hi Sridevi
    Refer this code as an example.
    This code calculates the occupied column from sflight table.
    TYPE-POOLS: slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         is_layout TYPE slis_layout_alv,
         it_events TYPE  slis_t_event ,
        it_sort TYPE  slis_t_sortinfo_alv .
    DATA: wa_fcat LIKE LINE OF it_fieldcat,
          wa_sort LIKE LINE OF it_sort.
    DATA: i_flight TYPE sflight_tab1.
    SELECT * FROM sflight
    INTO TABLE i_flight
    UP TO 10 ROWS.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_structure_name       = 'SFLIGHT'
      CHANGING
        ct_fieldcat            = it_fieldcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2.
    wa_fcat-do_sum = 'X'.
    MODIFY it_fieldcat FROM wa_fcat
         TRANSPORTING do_sum WHERE fieldname = 'SEATSOCC'.
    wa_sort-up = 'X'.
    wa_sort-fieldname = 'CARRID'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO it_sort.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program = sy-repid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = is_layout
        it_fieldcat                      = it_fieldcat
        i_tabname                        = 'I_FLIGHT'
        it_events                        = it_events
        it_sort                          = it_sort
    *   I_TEXT                           = ' '
      TABLES
        t_outtab                         = i_flight
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = is_layout
        it_fieldcat                      = it_fieldcat
        i_tabname                        = 'I_FLGIHT'
        it_events                        = it_events
       it_sort                          = it_sort
    *   I_TEXT                           = ' '
      TABLES
        t_outtab                         = i_flight
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    Thanks and Regards

  • Sorting in Blocked ALV Report

    Hi Experts,
    Can i achieve sorting in Blocked ALV report as we can do in ALV Grid Display.???
    If so, how can this be achieved????
    For example, if there are 3 records with the same value for a field.....say thfreee rows with name 'Gaurav'.
    I want to show 'Gaurav' only in the first row and the other two rows must be empty.
    Gaurav 1 2 3
    Gaurav 4 5 6
    Gaurav 7 8 9
    Should be seen as
    Gaurav 1 2 3
               4 5 6
               7 8 9
    Thanks and regards
    Gaurav raghav

    Here is the code.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_structure_name       = 'ZCRM_ACTIVITY_REPORT'
        CHANGING
          ct_fieldcat            = gt_fieldcatalog[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc EQ 0.
          CLEAR gs_sort.
          gs_sort-fieldname = 'ORG'.
          gs_sort-tabname = 'GT_ITAB'.
          gs_sort-spos = '1'.
          gs_sort-up = 'X'.
          APPEND gs_sort TO gt_sort.
        CLEAR gs_sort.
        gs_sort-fieldname = 'EMPLOYEE'.
        gs_sort-tabname = 'GT_ITAB'.
        gs_sort-spos = '2'.
        gs_sort-up = 'X'.
        APPEND gs_sort TO gt_sort.
      ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            is_layout                  = gt_layout
            it_fieldcat                = gt_fieldcatalog
            i_tabname                  = 'GT_ITAB'
            it_events                  = gt_events
            it_sort                    = gt_sort
            i_text                     = 'Report 1 '
          TABLES
            t_outtab                   = gt_itab
          EXCEPTIONS
            program_error              = 1
            maximum_of_appends_reached = 2
            OTHERS                     = 3.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

  • Interactive in blocked ALV

    Hi to all,
    Iam displaying out put in BLOCKEd ALV using 2 internal tables.
    Each table has 10 fields.
    When I double click on particular column entry, it should call Transaction iw33.
    Other 9 columns should not call transacton if i select entry from the column.
    But iam able to call transaction for all the other column entries.
    Iam tried using this with slis_selfield structure.
    In the run time this structure is not capturing the fieldname.
    How can i capture field name.
    kindly send yr valuable replys.

    Hi naveen,
    1. I also tried the same thing, but its not returning the column name
       on which we click.
    2. One workaround can be
    a) we get the VALUE in slis_selfield structure.
    b) loop at the internal table where COLUMN1 = VALUE
    c) if found, then we can somehow deduce that column1 has been clicked.
    (It can happen that other columns can contain the same value,
    then it can be confusing)
    regards,
    amit m.

  • Page Number - Total Page number in Blocked ALV

    Hi Gurus,
      I need to print the page numbers like 1 of 5 in the ALV footer. Am able to print the current page number but am unable to print the total page number in the footer of the Blocked ALV. Can any one guide me how to display the total number of pages.
    Points will be awarded
    Thanks
    Ravi

    Hi,
    Please refer to the link below :
    http://www.sapdev.co.uk/reporting/alv/alvgrid_events.htm
    Thanks,
    Sri.

  • Seperate ALV  Properties in Blocked ALV

    Hi All,
    I have created a blocked ALV. The standard ALV functionalities like Sort ,Filter etc is working only for the first list.
    Is there any techniques to give seperate functionalities for each list?
    Iam using reuse_alv_grid_display .
    and  LAYOUT-LIST_APPEND to show the blocked ALV.
    thanks and regards,
    Subeesh Kannottil

    Hi Yawa Ding,
    I have 3 lists .The standard ALV unctionality works only for the first list.
    I want all these properties to be applied to all lists
    Thanks and Regards,
    Subeesh Kannottil

  • How to handle Events in Blocked ALV report

    Hi All,
    I have a Blocked ALV report, I have a requirement where if I double click a row in blocked ALV report, it should branch off to MM01 transaction code and the material number and change number should get populated with the material number and change number  in my program.
    Is there any idea how to do this.
    Thanks,
    Vishal.

    hi anil,
    I have used user_command1 as the function module however the field details are not getting captured.
    How can we use set get parameters in this aspect.
    Please elaborate your answer.
    Thanks,
    Vishal.

  • How to calculate totals in Blocked ALV Report

    Hi All,
    Can any body tell how to calculate totals & sub totals in
    Blocked ALV Report[Blocked List].
    Thanks in advance
    Thanks & Regards,
    Rayeezuddin.

    read this it might help
    Sums                                                       
    15. No_sumchoice(1) TYPE c : This parameter allows the choice for summing up
    Only by fieldcatalog.
    Value set: SPACE, 'X'
    'X' = fields which are to be summed, passed by the calling program (FIELDCAT-DO_SUM = 'X'). The user should not be able to change this value interactively.
    16. No_totalline(1) TYPE c : Removes the option of having totals after sub-totals.
    Value set: SPACE, 'X'
    'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list.
    17. No_subchoice(1) TYPE c : Does not allow the user to interactively change the field chosen for subtotals.
    Value set: SPACE, 'X'
    'X' = value whose change triggers subtotals, provided by the calling program. The user should not be able to change this value interactively.
    18. No_subtotals(1) TYPE c : No subtotals possible          
    Value set: SPACE, 'X'
    'X' = no subtotals.
    19. Numc_sum(1)  TYPE c : Totals only possible for NUMC-Fields.
    20. No_unit_splitting TYPE c: No separate total lines by inh.units   
    21.totals_before_items TYPE c: Display totals before the items   
    22. Totals_only(1) TYPE c :  Show only totals      
    Value set: SPACE, 'X'
    'X' = only total records are output.
    23. Totals_text(60) TYPE c : Text for 1st col. in totals   
    Value set: SPACE, string (max.60)
    ' ' = The first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks.
    'String’ = The string passed is output after the total indicated by '*', if the column is wide enough.
    24. Subtotals_text(60) TYPE c : Texts for subtotals
    Value set: SPACE, string (max.60)
    ' ' = In the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough.
    'String’ = the string passed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough.
    ELSE TELL ME I WILL PASTE COMPLETE HELP
    regards

Maybe you are looking for