ALV list which is editable ?     :-)   :-)

Hi Team,
         Can you please guide me on how to Create an editable ALV list output (step by step,, Please).
I am only familiar with normal ALV list.
Thanks...Aby Jacob

Hi Sükrü
        Thanks,that was a really fast answer.   
Your suggestion ( BCALV_EDIT_**)
was really helpful in solving my problem.
warm regards......Aby

Similar Messages

  • Wan to add a sr.no in alv list which shld not change after sortin any field

    Hi Expert
    i want to hav a o/p
    like
    field1 field2 field3 field4
    1 A1 B C
    2 c a b
    3 b c a
    here ma first field shld remain as it is
    even dou i sort the fiel2 and field3 and field4 but ma field 1 shld npt change
    in runtime for example if i sort field3 ma o/p shld be
    field1 field2 field3 field4
    1 c a b
    2 A1 B C
    3 b c a
    plz help me out
    points wll b rewarded

    For that you need to refresh the your internal table with the new serial number after the SORT.
    For gaining the control back from ALV to program you need to implement the FM's parameter EVENTS_EXIT.
    You need to give the FORM in this Perform which will be called after the SORT event.
    IN that perform you can do like this:
    SORT ITAB.
    LOOP AT ITAB.
      ITAB-SRL = SY-TABIX.
      MODIFY ITAB.
    ENDLOOP.
    Regards,
    Naimesh Patel

  • ALV List, which one is better?

    Hi All,
    I need a suggestion which type of ALV(Block, hierarchy, etc...) is Best for given situation below.
    I am showing data in ALV with respect to multiple Vendors. There are multiple line items to single Vendor and then Summary of printed line items. In Summary i am showing % values. This is repeated for all Vendors.
    Please suggest.
    Thanks

    Hi,
    Grid layout is best
    Regards,
    Bhaskar

  • Alv list edit sample

    hi experts
    can someone give some samples of  alv list about field editable and about event capture such as capture the enter event, capture the data changed event.

    Hi,
    WA_FIELDCAT-COL_POS = 4.
    WA_FIELDCAT-TABNAME = 'GT_OUT'.
    WA_FIELDCAT-FIELDNAME = 'DATAINS2'.
    WA_FIELDCAT-SELTEXT_M = 'POD'.
    WA_FIELDCAT-EDIT = 'X'. ( This statement Will edit )
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-EDIT = 'X'.
    Thanks
    Vikranth
    Edited by: Khimavath Vikranth on Jun 16, 2008 10:32 AM

  • ALV list like FBL1N output

    Dear all,
         I am developing a report for vendor line items details like FBL1N report.
        It means the vendor name as header and respective account
    details as item in alv and again next vendor name as header
    and respective account details in alv in the same page.
       How can i get the output like
    1.vendor name :XXXXXXXXX
       country        :XXXXXXXXX
    respective alv list which contains the account detailsof the vendor....
    2.vendor name :YYYYYYY
      country        :YYYYYYY
    respective alv list....
    how should i declare my alv and get it done.
    points will be rewarded..
    regards.
    siva
    Edited by: siva on Jul 22, 2008 3:38 PM

    Hi ,
         I have to use variant or layout option i think.
      huv to use these options to get my alv report like FBL1N output.
        In  FBL1N  the function FI_ITEMS_DISPLAY is used.
         But I can't use that function my program.
        Because my output structure is different.
        huv to make it out.
         Regards
       siva
    Edited by: siva on Jul 23, 2008 6:47 AM

  • Change and Save records on ALV List

    Hi,
    i made alv list with fieldcatalog-edit to change records on alv list. But i want to save it to my dictionary table after changed. I think i should use dialog program to do that. The problem is how i can use dialog program.(i dont have an idea which user-command perform fields on alv list) I have used dialog programs before but i am new on this so i am not sure how i can do that. I will be pleased if you can help me.
    Regards.

    Hello Masuke,
    You have to code that in the AT- USER COMMAND event.
    Follow the below sample code.
    If the record is changed then track its index no.
            and populate it in an internal table for future
            action
              IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
                <dyn_wa> = <l_wa>.
                i_index = rs_selfield-tabindex.
                APPEND i_index.
              ENDIF.
            ENDIF.      ENDIF.*   When save button is pressed
        WHEN 'SAVE'.*     Sort the index table
          SORT i_index.*     Delete all duplicate records
          DELETE ADJACENT DUPLICATES FROM i_index.      LOOP AT i_index.*       Find out the changes in the internal table
          and populate these changes in another internal table
            READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
            IF sy-subrc = 0.
              APPEND <dyn_wa> TO <dyn_tab_temp>.
            ENDIF.      ENDLOOP.*     Lock the table
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              mode_rstable   = 'E'
              tabname        = p_table
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.      IF sy-subrc = 0.*       Modify the database table with these changes
            MODIFY (p_table) FROM TABLE <dyn_tab_temp>.        REFRESH <dyn_tab_temp>.*       Unlock the table
            CALL FUNCTION 'DEQUEUE_E_TABLE'
              EXPORTING
                mode_rstable = 'E'
                tabname      = p_table.      ENDIF.
      ENDCASE.  rs_selfield-refresh = 'X'.
    Hope it helps you.
    Best Regards
    Santosh

  • Background processing of interactive alv lists

    Hi,
    I have an interactive alv list which works fine with online processing. When run in background it only create spool for the first list. What can be a solution other than merging all the secondary alv list to the primary list level. Can we create alv list (for background proesiing mode) for more than one internal table. (I think normally we can have only one internal table displayed in a list using reuse_alv). Please inform me if further details has to be published.
    Thanks and regards,
    Rajeeve Patric

    online after first display user can interact with the report and so the secondary report can be displayed....now in background mode if u run it spools out first report...Now, someone has to interact with this report so that second report can be shown...But user can't interact with the first report in background process.....so, it might be that if report is running in background then the 2 reports needs to be merged and shown in one report...

  • How to add a button on the ALV LIST pop up

    Hi ,
    Can any one help me to add a button on the ALV list which is a pop up using ABAP Objects.
    Thanks in advance.
    Regards,
    Kavya.

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • Is ALV List Possible in Web Dynpro for JAVA ? Please Advice.

    Hello,
    I would like to know if we can simulate the ALV List which we have in ABAP using Web Dynpro for JAVA. I would really appreciate if someone could suggest how it could be done.
    Best Wishes,
    John.

    Hallo John,
    The Abstract List Viewer (ALV) is not available in Web Dynpro for Java within SAP NetWeaver 04s.
    Regards, Bertram

  • 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

  • Serial No in ALV list

    Hi everyone,
    i am gerarating a alv list which gisplays all the PO's that have been half delivered, but i need to add a serial no col for this list, so that if i sort the list on any of the fields the serial no should be intact,
    plz help,
    Shri Hari

    Hi Sri Hari,
    I think the earlier logic works fine . If the alv is implemented with Object Oriented concept then this example will be helpful.The user command can be handled before SAP handles it in the event before_user_command of cl_gui_alv_grid and after handling the event you can avoid further processing. I have done the same for the copy of standard program ERGP2020 and handled it .Here I did not go for any custom buttons but handled the standard SAP provided buttons.
    And here is the code.......
    REPORT ztest LINE-SIZE 90 NO STANDARD PAGE HEADING.
    DATA :
    t_column TYPE lvc_t_col,
    fs_column TYPE lvc_s_col.
    DATA: txt_report LIKE dokhl-object.   "Reportname für Erläuterungsaufruf
    DATA: BEGIN OF mylist OCCURS 20,       " Internal table for preparing
            sno(4)       TYPE n,
            zuordnung(8) TYPE c,                                " the list
            belegnr(10) TYPE c,
            ba(2) TYPE c,
            bldatum TYPE d,
            bs(2) TYPE c,
            s(4) TYPE c VALUE ' ',
            wrg(4) TYPE c,
            betrag TYPE p DECIMALS 2,
          END OF mylist.
    DATA: ok_code LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'LIBS_GRID_CONTROL_CONTAINER',
          grid TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    DATA: gt_fieldcatalog TYPE lvc_t_fcat,
          gs_layout   TYPE lvc_s_layo.
    DATA: seed1 TYPE i VALUE '123',                  " Rand number seed 1
          seed2 TYPE i VALUE '2345',                 " Rand number seed 2
          seed3 TYPE i VALUE '23'.                   " Rand number seed 3
          CLASS cls_event_handler DEFINITION
    CLASS cls_event_handler DEFINITION.
      PUBLIC SECTION .
        METHODS :
          handle_before_user_command FOR EVENT before_user_command OF
        cl_gui_alv_grid IMPORTING e_ucomm.
    ENDCLASS.                    "cls_event_handler DEFINITION
          CLASS cls_event_handler IMPLEMENTATION
    CLASS cls_event_handler IMPLEMENTATION.
      METHOD handle_before_user_command.
        IF e_ucomm EQ '&SORT_ASC' OR e_ucomm EQ '&SORT_DSC'.
          CALL METHOD grid->get_selected_columns
            IMPORTING
              et_index_columns = t_column.
          IF sy-subrc EQ 0.
            IF t_column[] IS INITIAL.
              MESSAGE 'Select one column' TYPE 'I'.
            ENDIF.
            READ TABLE t_column INDEX 1 INTO fs_column.
            IF sy-subrc EQ 0.
              IF e_ucomm EQ '&SORT_ASC'.
                SORT mylist BY (fs_column-fieldname).
              else.
                SORT mylist BY (fs_column-fieldname) descending.
              ENDIF.
              LOOP AT mylist INTO mylist.
                MOVE sy-tabix TO mylist-sno.
                MODIFY mylist FROM mylist.
              ENDLOOP.
              CALL METHOD grid->refresh_table_display
                EXCEPTIONS
                  finished = 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.
              CALL METHOD grid->set_table_for_first_display
                EXPORTING
                  is_layout                     = gs_layout
                CHANGING
                  it_outtab                     = mylist[]
                  it_fieldcatalog               = gt_fieldcatalog
                EXCEPTIONS
                  invalid_parameter_combination = 1
                  program_error                 = 2
                  too_many_lines                = 3
                  OTHERS                        = 4.
              IF sy-subrc <> 0.
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              ENDIF.
            ENDIF.
          ENDIF.
          CALL METHOD grid->set_user_command
            EXPORTING
              i_ucomm = space.
        ENDIF.
      ENDMETHOD.                    "handle_before_user_command
    ENDCLASS.                    "cls_event_handler IMPLEMENTATION
    Main Program *******************************
    START-OF-SELECTION.
      PERFORM fill_itab.
      PERFORM fieldcatalog_init USING gt_fieldcatalog[].
      PERFORM layout_init USING gs_layout.
      PERFORM main.
    Form Routines ******************************
          FORM MAIN                                                     *
          Main output routine                                           *
    FORM main.
      CALL SCREEN 100.
    ENDFORM.                    "main
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN1'.
      SET TITLEBAR 'MAIN100'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.
        CREATE OBJECT grid
               EXPORTING i_parent = g_custom_container.
        DATA :
          obj_event TYPE REF TO cls_event_handler.
        CREATE OBJECT obj_event.
        SET HANDLER obj_event->handle_before_user_command FOR grid.
        CALL METHOD grid->set_table_for_first_display
          EXPORTING
            is_layout                     = gs_layout
          CHANGING
            it_outtab                     = mylist[]
            it_fieldcatalog               = gt_fieldcatalog
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDMODULE.                    "pbo OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      to react on oi_custom_events:
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN '&F03' OR '&F15' OR '&F12'.
          PERFORM exit_program.
        WHEN 'ERLE'.
          txt_report = 'ERGP2020'.
          CALL FUNCTION 'ERGO_TEXT_SHOW'
            EXPORTING
              textname = txt_report
              id       = 'RE'
              langu    = sy-langu.
        WHEN OTHERS.
        do nothing
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "pai INPUT
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
          FORM FILL_ITAB                                                *
          Fills the internal table for the list output                  *
    FORM fill_itab.
      DATA: ran TYPE f,
            rani TYPE i,
            ranp TYPE p DECIMALS 2,
            belnr TYPE i VALUE 1600000040,
            date TYPE d.
      date = '19920417'.
      DO 18 TIMES.
        MOVE '19920316' TO mylist-zuordnung.
        ADD 1 TO belnr.
        MOVE belnr TO mylist-belegnr.
        MOVE 'DA' TO mylist-ba.
        PERFORM random(ergphelp) USING seed1 seed2 seed3 ran.
        rani = 10 * ran.
        IF rani > 7.
          ADD 1 TO date.
        ENDIF.
        MOVE date TO mylist-bldatum.
        MOVE '01' TO mylist-bs.
        PERFORM random(ergphelp) USING seed1 seed2 seed3 ran.
        rani = 10 * ran.
        IF rani > 7.
          MOVE text-w10 TO mylist-wrg.                          "USD
        ELSE.
          MOVE text-w20 TO mylist-wrg.                          "DM
        ENDIF.
        PERFORM random(ergphelp) USING seed1 seed2 seed3 ran.
        ranp = 1000000 * ran.
        IF mylist-wrg = text-w10.
          ranp = ranp / 2.
        ENDIF.
        MOVE ranp TO mylist-betrag.
        MOVE sy-index TO mylist-sno.
        APPEND mylist.
      ENDDO.
    ENDFORM.                    "fill_itab
          FORM FIELDCAT_INIT
    FORM fieldcatalog_init USING lt_fieldcatalog TYPE lvc_t_fcat.
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SNO'.
      ls_fieldcatalog-datatype  = 'N'.
      ls_fieldcatalog-reptext   = text-u99.
      ls_fieldcatalog-coltext  = text-u99.
      ls_fieldcatalog-seltext  = text-u99.
      ls_fieldcatalog-tooltip  = text-u99.
      ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'ZUORDNUNG'.
      ls_fieldcatalog-datatype  = 'C'.
      ls_fieldcatalog-reptext   = text-u10.
      ls_fieldcatalog-coltext  = text-u10.
      ls_fieldcatalog-seltext  = text-u10.
      ls_fieldcatalog-tooltip  = text-u10.
      ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'BELEGNR'.
      ls_fieldcatalog-datatype  = 'C'.
      ls_fieldcatalog-reptext   = text-u20.
      ls_fieldcatalog-coltext   = text-u20.
      ls_fieldcatalog-seltext  = text-u20.
      ls_fieldcatalog-tooltip  = text-u20.
      ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname    = 'BA'.
      ls_fieldcatalog-datatype  = 'C'.
      ls_fieldcatalog-reptext   = text-u30.
      ls_fieldcatalog-coltext   = text-u30.
      ls_fieldcatalog-seltext  = text-u30.
      ls_fieldcatalog-tooltip = text-u30.
      APPEND  ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname    = 'BLDATUM'.
      ls_fieldcatalog-datatype  = 'DATS'.
      ls_fieldcatalog-reptext   = text-u40.
      ls_fieldcatalog-coltext   = text-u40.
      ls_fieldcatalog-seltext  = text-u40.
      ls_fieldcatalog-tooltip  = text-u40.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname    = 'BS'.
      ls_fieldcatalog-datatype  = 'C'.
      ls_fieldcatalog-reptext   = text-u50.
      ls_fieldcatalog-coltext   = text-u50.
      ls_fieldcatalog-seltext = text-u50.
      ls_fieldcatalog-tooltip  = text-u50.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname    = 'S'.
      ls_fieldcatalog-datatype  = 'C'.
      ls_fieldcatalog-reptext   = text-u60.
      ls_fieldcatalog-coltext  = text-u60.
      ls_fieldcatalog-seltext = text-u60.
      ls_fieldcatalog-tooltip  = text-u60.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname    = 'WRG'.
      ls_fieldcatalog-datatype  = 'C'.
      ls_fieldcatalog-reptext  = text-u70.
      ls_fieldcatalog-coltext  = text-u70.
      ls_fieldcatalog-seltext  = text-u70.
      ls_fieldcatalog-tooltip = text-u70.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname     = 'BETRAG'.
      ls_fieldcatalog-datatype      = 'CURR'.
      ls_fieldcatalog-outputlen      = '15'.
      ls_fieldcatalog-reptext     = text-u80.
      ls_fieldcatalog-coltext      = text-u80.
      ls_fieldcatalog-seltext      = text-u80.
      ls_fieldcatalog-tooltip  = text-u80.
      ls_fieldcatalog-cfieldname = 'WRG'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
          FORM layout_init                                              *
    -->  LS_LAYOUT                                                     *
    FORM layout_init USING ls_layout TYPE lvc_s_layo.
    ls_layout-no_toolbar = 'X'.
      ls_layout-zebra = 'X'.
    ENDFORM.                    "layout_init

  • F4 help in ALV list

    Hi.
    I have a problem with f4 help in alv list.
    There is a field in my alv list which have a domain. This domain has its own values in value range.
    I have found how to show f4 help according to system tables ( for example kunnr in kna1 ) but I need to show this value range values as f4 help in my alv list.
    Please help me.
    Thanks.

    hi
    try this example
    REPORT zoo_alvf4 .
    DATA : alvgrid TYPE REF TO cl_gui_alv_grid,
    custom_container TYPE REF TO cl_gui_custom_container,
    fieldcatalog TYPE lvc_t_fcat.
    table to contain fields that require f4...............................
    DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
    DATA : ok_code TYPE sy-ucomm.
    TABLES : zemployee_c7.
    TYPES : BEGIN OF ty_emp,
    empid LIKE zemployee_c7-empid,
    empname LIKE zemployee_c7-empname,
    END OF ty_emp.
    DATA : i_emp TYPE TABLE OF ty_emp.
    DATA : wa_emp TYPE ty_emp.
    SELECT-OPTIONS : s_empid FOR zemployee_c7-empid.
    CLASS lcl_event_handler DEFINITION.
    PUBLIC SECTION.
    METHODS :
    handle_on_f1 FOR EVENT onf1 OF cl_gui_alv_grid
    IMPORTING e_fieldname es_row_no er_event_data,
    handle_on_f4 for event onf4 of cl_gui_alv_grid
    importing e_fieldname es_row_no er_event_data
    ENDCLASS.
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_on_f1.
    IF e_fieldname = 'EMPID'.
    CALL SCREEN 3001.
    ENDIF.
    to prevent processing of standard f1 help............................
    er_event_data->m_event_handled = 'X'.
    ENDMETHOD.
    Method handle_on_f4.
    endmethod.
    ENDCLASS.
    start of selection....................................................
    START-OF-SELECTION.
    SELECT empid empname FROM zemployee_c7
    INTO CORRESPONDING FIELDS OF TABLE i_emp
    WHERE empid IN s_empid.
    CALL SCREEN 3000.
    MODULE status_3000 OUTPUT.
    SET PF-STATUS 'ZTOOL'.
    SET TITLEBAR 'ZTITLE'.
    IF alvgrid IS INITIAL.
    CREATE OBJECT custom_container
    EXPORTING
    container_name = 'ZCONTAINER'.
    CREATE OBJECT alvgrid
    EXPORTING
    i_parent = custom_container.
    PERFORM prepare_f4.
    CALL METHOD alvgrid->register_f4_for_fields
    EXPORTING
    it_f4 = lt_f4[]
    creating instance for event handler..................................
    DATA : event_handler TYPE REF TO lcl_event_handler.
    CREATE OBJECT event_handler.
    SET HANDLER event_handler->handle_on_f1 FOR alvgrid.
    SET HANDLER event_handler->handle_on_f4 FOR alvgrid.
    preparing field catalog..............................................
    PERFORM prepare_fieldcatalog CHANGING fieldcatalog.
    CALL METHOD alvgrid->set_table_for_first_display
    EXPORTING
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    CHANGING
    it_outtab = i_emp
    it_fieldcatalog = fieldcatalog
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    others = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDMODULE. " STATUS_3000 OUTPUT
    preparing field catalog...............................................
    FORM prepare_fieldcatalog CHANGING i_fieldcatalog TYPE lvc_t_fcat.
    DATA : ls_fcat TYPE lvc_s_fcat.
    ls_fcat-fieldname = 'EMPID'.
    ls_fcat-ref_table = 'ZEMPLOYEE_C7'.
    ls_fcat-coltext = 'EMPLOYEE ID'.
    APPEND ls_fcat TO i_fieldcatalog.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'EMPNAME'.
    ls_fcat-ref_table = 'ZEMPLOYEE_C7'.
    ls_fcat-coltext = 'EMPLOYEE NAME'.
    APPEND ls_fcat TO i_fieldcatalog.
    ENDFORM.
    MODULE user_command_3000 INPUT.
    CASE ok_code.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_3000 INPUT
    MODULE user_command_3001 INPUT.
    CASE ok_code.
    WHEN 'SAVE'.
    LEAVE TO SCREEN 0.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_3001 INPUT
    MODULE status_3001 OUTPUT.
    SET PF-STATUS 'GUI'.
    SET TITLEBAR 'TITLE'.
    ENDMODULE. " STATUS_3001 OUTPUT
    preparing fields to be registered for f4 help.........................
    FORM prepare_f4.
    lt_f4-fieldname = 'EMPNAME'.
    lt_f4-register = 'X'.
    lt_f4-getbefore = 'X'.
    lt_f4-chngeafter = 'X'.
    APPEND lt_f4.
    ENDFORM.
    Regards

  • Total in ALV List (own calculation)

    Hi All,
    do you know how to display total in ALV List which calculated by me ?
    Previously I am using Before Line Output event ?
    I dont know why it's not working now (see the code below)? Now it is always overrided by standard sum calculation. Please help me.
    Thank you in advance.
    Sandi
    FORM ALV_BEFORE_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO.
      IF RS_LINEINFO-endsum = 'X'.
        I_DATA-PERFORMANCE = L_AVG.
        "MODIFY I_DATA INDEX RS_LINEINFO-SUMINDEX.
      ENDIF.
    ENDFORM.

    Hi All,
    do you know how to display total in ALV List which calculated by me ?
    Previously I am using Before Line Output event ?
    I dont know why it's not working now (see the code below)? Now it is always overrided by standard sum calculation. Please help me.
    Thank you in advance.
    Sandi
    FORM ALV_BEFORE_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO.
      IF RS_LINEINFO-endsum = 'X'.
        I_DATA-PERFORMANCE = L_AVG.
        "MODIFY I_DATA INDEX RS_LINEINFO-SUMINDEX.
      ENDIF.
    ENDFORM.

  • Editable column in ALV list report

    Hi,
    I  developed a ALV list block report. I want to make some of column editable in my alv list report.I set WA_FIELDCAT-EDIT     = 'X' in fieldcatalog but it's not working.
    Could you please sugest.
    Regards,
    Mohit

    Hi Mohit ,
    please  check WA_FIELDCAT-EDIT = 'X'    fieldcat which you are passing to ALV grid function module is same  or different  .
    or use in this way
    perform get_fieldcat using  'QUANTITY'     'Enter.Qty'               12 'R' 'N' '000' 'N' 'N' 'N' 'N'  'N' 'N' .
    get_fieldcat  using   p_fieldname
                                p_txtname
                                p_length
                                p_justfy
                                p_keyfld
                                p_color
                                p_hotspt
                                p_total
                                p_sort
                                p_subtot
                                p_para1
                                p_zero .
      clear ms_fieldcat .
      ms_fieldcat-fieldname = p_fieldname .
      ms_fieldcat-seltext_l = p_txtname   .
      ms_fieldcat-ddictxt   = 'L'         .
      ms_fieldcat-outputlen = p_length    .
      ms_fieldcat-just      = p_justfy    .
      ms_fieldcat-lzero     = 'X'         .
      ms_fieldcat-checkbox = 'X'          .
      ms_fieldcat-edit     = 'X'          .
      if p_fieldname = 'CHK' .
        ms_fieldcat-checkbox = 'X'.
        ms_fieldcat-edit = 'X'.
      else.
        ms_fieldcat-checkbox = ' '.
        ms_fieldcat-edit = ' '.
      endif.
      if p_fieldname = 'QUANTITY' .
        ms_fieldcat-edit = 'X'.
      endif.
    regards
    Deepak.

  • How to save edited ALV List.

    hi all,
    i have created a program which displays two ALV LISTS and i made some of the fileds editable by using input key. Now when i press the SAVE button ,i couldnt capture the edited fileds contents .
    have a look at the code below .
    call function 'REUSE_ALV_BLOCK_LIST_INIT'
        exporting
          i_callback_program             = sy-repid
          i_callback_pf_status_set       = 'SET_PF_STATUS'
          i_callback_user_command        = 'USER_COMMAND'.
    *---------------------for top of page----------------*
          xs_event-name = slis_ev_top_of_page.
          xs_event-form = 'TOP_OF_PAGE'.
          append xs_event to IT_events.
          xs_event-name = slis_ev_top_of_page.
          xs_event-form = 'TOP_OF_PAGE1'.
          append xs_event to IT_events1.
    *---------------------appending 1st alv---------------*
        if not it_DATA is initial.
        call function 'REUSE_ALV_BLOCK_LIST_APPEND'
          exporting
            is_layout                        = gd_layout
            it_fieldcat                      = it_fieldcat
            i_tabname                        = 'IT_DATA'
            it_events                        = IT_events
          tables
            t_outtab                         = it_DATA.
      endif.
    *---------------------appending 2nd alv---------------*
       call function 'REUSE_ALV_BLOCK_LIST_APPEND'
          exporting
            is_layout                        = gd_layout1
            it_fieldcat                      = it_fieldcat1
            i_tabname                        = 'IT_PEND'
           it_events                        = IT_events1
          tables
            t_outtab                         = IT_PEND.
    *---------------------ALV Display------------------------------*
      gt_print-reserve_lines = 2.
          call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
         exporting
           is_print                      = gt_print.
    endform.                    " report_output
    regards,
    Venkat

    i was able to get the changed data in ALV grid by this code
    data: gd_repid like sy-repid,
            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.
    is there any equivalent code for ALV LIST like the above code??

Maybe you are looking for

  • Back-up in dead computer

    hi all, its my first post. i (proudly) own a 3GS and it was syncing and backing up to a computer which is now dead. I wanted to back up my 3gs to a different computer (the new one i had to buy). My main issue is with all my music library (about 1 GB

  • How to restore Ipod Touch running ios 5 without passcode or itunes?

    Hello All, I updated my Fourth Generation Ipod Touch to ios5. The Itouch's home computer broke down so i am now forced to use my other pc which is authorised with the same apple id as the one on my old pc and on my itouch. I have not used my itouch i

  • ABAP field symbols and PERL reference variables to unnamed arrays.

    Rob - Please do NOT delete this post even though it contains this link: ABAP field symbols and PERL reference variables to unnamed arrays. to a question I posted in the Scripting Languages forum. It's a question that should be of interest to ABAP pro

  • Is there a way to remove images based on size?

    Because of my improper maintenance on an earlier version of iPhoto my iPhoto 9 (AKA 11) has hundreds of thumbnail sized images in it as originals. Is there an easy way to remove them? one by one will take many hours.

  • HT3819 The article says you can "simply drag music between computer libraries."

    Is there an easy way to transfer music between computer libraries?  I am using home sharing and can stream music between one computer to another with no problem.  However, when I try to transfer files from one library to another, I can not transfer a