Issue in Editable ALV

Hi Leads,
I am working on Editable ALV using REUSE_ALV_GRID_DISPLAY_LVC.
But, my requirement is I need to track the changes in Report.
After editing the ALV report, I need to update the data base with the changed records and Need to display them as One more Report.
Can you please suggest me any to resolve my issue?
Thanks,
Sandeep

You may need to check
http://wiki.sdn.sap.com/wiki/display/Snippets/UpdatingtheInternalTable-AfterEditinALVusingFunctionModules

Similar Messages

  • Issue with editable alv using  cl_gui_alv_grid

    Hello all,
    its a table update program . user can save create new entry and delete the entires . the screen should be avaiable for multiple time inputs by the user . i achived it by  method handle double click and i am refreshing the scrren and making the alv for ready for input . but user wants the screen shoukld get refreshed automatically once user clicks on save button .
    how can I achive plz advise .
    I am working on ALV by cl_gui_alv_grid , I am using the followingmethods of the class
    1)  METHODS:  handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
                  IMPORTING e_object e_interactive.
    2)     METHODS:     handle_user_command FOR EVENT
                     user_command OF cl_gui_alv_grid
                     IMPORTING e_ucomm,
                     check_changed_data.
    3)     METHODS:      handle_double_click FOR EVENT
                      double_click  OF  cl_gui_alv_grid
                      IMPORTING e_row e_column.
    4)    METHODS: handle_data_changed
                  FOR EVENT data_changed OF cl_gui_alv_grid
                  IMPORTING er_data_changed.
    Thanks in advance .

    Hi Soumyaprakash,
    SAve is an user command . I want to have the values which are changed by the user and again the output should be ready for any actions like change the data , create new and delete any entry .
    basically  the alv output screen should be reday for inputs any number of times untill user clicks on back button .
    Thanks
    Basavaraj

  • Editable ALV issue: When Delete/Modify a row, ztable doesnt reflect changes

    Greeting Fellow Abapers,.
    I have been running into an issue that I need some advice on.  I am allowing users to edit a Ztable via ALV.  When the quantity field is updated everything is fine. However, when the field "lic_plate" is edited the code appends another row into the Ztable instead of modifying it.  Also, when the delete row functionality of the grid is used the row is not deleted from the Ztable.
    Here is the ztable structure. The fields I allow to be edited are in BOLD...
    ZPALLET-VBELN
    ZPALLET-MATNR
    ZPALLET-LINE_NUM
    ZPALLET-LIC_PLATE
    ZPALLET-LOT_NUMBER
    ZPALLET-PAL_TYPE
    ZPALLET-MAN_DATE
    ZPALLET-QUANTITY
    ZPALLET-PROC_DATE
    Here is the source code that the APPEND is taking place...
    FORM save_database .
    Getting the selected rows index*
      CALL METHOD o_grid->get_selected_rows
        IMPORTING
          et_index_rows = i_selected_rows.
    Through the index capturing the values of selected rows*
      LOOP AT i_selected_rows INTO w_selected_rows.
        READ TABLE itab INTO wa INDEX w_selected_rows-index.
        IF sy-subrc EQ 0.
          MOVE-CORRESPONDING wa TO w_modified.
          APPEND w_modified TO i_modified.
        ENDIF.
      ENDLOOP.
    IF sy-subrc = 0.
        MODIFY zpallet FROM TABLE i_modified.
    ENDIF.
    ENDFORM.
    Please help. I am in your debt.
    ...as always, points will be awarded.
    Best,
    Dan

    Hello Dan
    When you are using an editable ALV for table maintenance you have to take care that the users
    - cannot edit the key fields of existing DB records   and
    - every new record (row) does not match any existing record (i.e. has identical key field values)
    Instead of relying on selected rows for the DB update I would recommend to store a "PBO image" of your data and compare this with the "PAI image" of the data as soon as the user pushes the SAVE button.
    Example:
    DATA:
      gt_outtab_pbo    TYPE   < your table type>,  " PBO image
      gt_outtab           TYPE   < your table type>.  " PAI image
    " 1. Select data from DB table and store in both itabs:
      SELECT * ... INTO TABLE gt_outtab.
      gt_outtab_pbo = gt_outtab.
    " 2. Display editable ALV list -> user modifies gt_outtab
    " 3. SAVE function requested
    " ... compare gt_outtab vs. gt_outtab_pbo
    " .... INSERT, UPDATE, or DELETE DB records
    " Finally set:
      gt_outtab_pbo = gt_outtab.
    " 2. User continues with editing
    In order to compare PBO vs. PAI data you may have a look at my sample coding:
    [Comparing Two Internal Tables - A Generic Approach|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach]
    Regards,
      Uwe

  • Problem While Saving the editable ALV GRID

    Dear Experts,
    I have a scenario in which i am display the ALV(using class) with some data in the custom container of module pool screen in the non-editable mode.Also i have save and edit buttons.If i click the edit button i have written the code to edit the some columns in the ALV grid, it is working fine.After editing it,when i click the save button then ALV has to refreshed with edited data and then it should go to non editable mode but it is not working.I have written the code for changing the editable ALv to non editable mode as follows :
      call method c_alvgd->set_ready_for_input
        exporting
          i_ready_for_input = 0.
    *****Row and column of the alv are refreshed after changing values
      stable-row = 'X'.
      stable-col = 'X'.
    *REfreshed ALV display with the changed values
    *This ALV is non editable and contains new values
      call method c_alvgd->refresh_table_display
        exporting
          is_stable = stable
        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.
    Could you Suggest me solution for this issue ?
    Thanks & Regards,
    R.Dhineshraj.

    Dhinesh,
    I suppose that you are able to get your changes values on screen but not able to get your field in DISPLAY mode from editable mode, let me know if this is not your problem.
    When you press SAVE, after the PAI, again PBO will run and hence the editable code for that field will overwrite which will keep it editable.
    So, do something like this.
    data: gv_edit value 'X'.....  "global variable in TOP include
    PBO....
    loop at ...
    if gv_edit = 'X'.
    CALL METHOD lo_alv->set_ready_for_input
      EXPORTING
        i_ready_for_input = 1.
    else.
    CALL METHOD lo_alv->set_ready_for_input
      EXPORTING
        i_ready_for_input = 0.
    endif.
    endloop.
    PAI.
    when 'SAVE'.
    gv_edit =  space.
    When 'EDIT'.
    gv_edit = 'X'.
    Regards,
    Diwakar

  • Is "Enter" the only way to let an ABAP OO editable ALV know data's changed?

    In the past two years, I've coded numerous ABAP OO editable ALV's, and once Uwe set me straight about how ti use the canned "handle data changed" methods,. it's been very straightforward.
    But here's my question.
    I have a modal dialog box in a MIGO dialog exit (yes, there is one although it's in a very odd function group - XQSM.)
    In the modal dialog box, I have an editable ALV and an OK pushbutton underneath it.
    If the user enters data into the ALV and then presses OK immediately afterwards (without pressing ENTER first), the ALV doesn't recognize that data has been entered.  So the underlying itab winds up empty.
    What is the right way to handle this?
    Is there a way of forcing the ALV to do its thing from within the PAI that handles the OK pushbutton?
    At my last client, the customers were willing to live with this as a training issue - tell the users to hit ENTER at least once before pressing OK.
    But surely, SAP must have something else in mind here that I'm not yet aware of.
    Thanks for any advice anyone can provide.
    djh

    Hi Vijay -
    Thanks for both answers!
    Regarding your first answer, here's my current code:
    class lcl_event_receiver          definition deferred.
    data:
      o_event_receiver                  type ref to lcl_event_receiver.
    class lcl_event_receiver definition.
    public section.
        methods:
          handle_data_changed
             for event data_changed of cl_gui_alv_grid
                 importing er_data_changed.
    private section.
    endclass.
    And this:
      call method o_grid->register_edit_event
                   exporting
                      i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      create object o_event_receiver.
      set handler o_event_receiver->handle_data_changed for o_grid
    Are you saying that instead of mc_evt_enter, I should use "mc_evt_modified" ????
    Please clarify if you have the time.
    Thanks
    djh

  • Editable alv using checkboxes.

    Hi All,
    I am working on editable alv using checkboxes.I have few requirements.
    1) i have all checkboxes in my row.If i select the Row fieldname all of my checkboxes hsould be checked.
    2) in my internsl table i have field called comments.If comment field has space i need to disable the checkbox.If comment is filled then i need to enable the chekkbox.
    Field catalog need to be changed based on my internal table.
    Can anybody please let me know how can i solve the above issues.
    Thanks
    Swapna.

    1. There is no event for this (row of column), so this will not be possible.
    2. Check report BCALV_EDIT_05.

  • Custom button on a editable alv grid

    Hi experts,
    I'm using an editable alv   like this:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
           EXPORTING
                i_callback_program            = gd_repid
                i_callback_user_command  = 'USER_COMMAND'
    *            I_STRUCTURE_NAME       = 'ZPEDAUTOMTAB'
                is_layout_lvc           = gd_layout
                it_fieldcat_lvc         = it_fieldcat
                i_save                  = 'X'
           TABLES
                t_outtab                = gt_zpedautomtab
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    Does anybody know if i can add a custom button to the header or anywhere else to program a custom action?
    If it is not; i can use another type of editable alv that lets me do that; if that exists.
    Tank-you.

    Hi
    Check the following template code and adjust accordingly:
    Call the ALV
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_pf_status_set    = 'PF_STATUS_SET'
          i_callback_user_command     = 'LINE_CLICK'
          i_callback_top_of_page      = 'TOP_ROUTINE'
          i_callback_html_end_of_list = 'EOL_LOG'
          i_grid_title                = text-ttl
          is_layout                   = my_layout
          it_fieldcat                 = it_fieldcatalog
          it_sort                     = it_sort
          i_save                      = g_save
          i_grid_settings             = lc_glay
          is_variant                  = w_variant
          is_print                    = my_print
        TABLES
          t_outtab                    = i_out
        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_routine
    FORM top_routine.
    { Local
      DATA:
        w_page(5) TYPE c,
        l_line TYPE slis_entry,
        lh_top TYPE slis_listheader,
        lt_top TYPE slis_t_listheader.
      DEFINE top_line.
        clear lh_top.
        lh_top-typ = &1.
        lh_top-key = &2.
        lh_top-info = &3.
        append lh_top to lt_top.
      END-OF-DEFINITION.
      WRITE sy-datum TO l_line.
      top_line 'S' text-t01 l_line.
      WRITE sy-uname TO l_line.
      top_line 'S' text-t02 l_line.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = lt_top.
    ENDFORM.  "top_routine
    *&      Form  pf_status_set
    FORM pf_status_set USING extab TYPE slis_t_extab.
      data: wa_extab like LINE OF extab.
      wa_extab-fcode = '&REFRESH'.
      append wa_extab to extab.
      wa_extab-fcode = 'MODE'.
      append wa_extab to extab.
      SET PF-STATUS 'ZSD_DA01' EXCLUDING extab.
    ENDFORM.  "pf_status_set
    *&      Form  line_click
    FORM line_click USING ucomm LIKE sy-ucomm
                           selfield TYPE slis_selfield.
      DATA: wl_ucomm LIKE sy-ucomm.
      DATA: es_l TYPE slis_layout_alv,
            es_fld TYPE slis_t_fieldcat_alv,
            es_sort TYPE slis_t_sortinfo_alv,
            es_mark TYPE slis_t_fieldcat_alv.
      wl_ucomm = sy-ucomm.
      CLEAR sy-ucomm.
      CASE wl_ucomm.
    Set printing mode
        WHEN 'MODE'.
          IF w_mode = 'O'.
            w_mode = 'T'.
            w_mode_txt = text-018.
          ELSE.
            w_mode = 'O'.
            w_mode_txt = text-019.
          ENDIF.
          SET PF-STATUS 'ZSD_DA01'.
    Exit Functions
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          LEAVE TO SCREEN 0.
    Show Log
        WHEN 'LOG'.
          selfield-refresh = 'X'.
          PERFORM log_show.
    Issue output
        WHEN 'ISSUE'.
          selfield-refresh = 'X'.
          PERFORM print_deliveries.
    Select all
        WHEN 'SALL'.
          selfield-refresh = 'X'.
          LOOP AT i_out.
            i_out-box = 'X'.
            MODIFY i_out.
          ENDLOOP.
    Deselect all
        WHEN 'DSAL'.
          selfield-refresh = 'X'.
          LOOP AT i_out.
            i_out-box = ' '.
            MODIFY i_out.
          ENDLOOP.
      ENDCASE.
    Handle User clicks
      CASE selfield-fieldname.
    Display Vendor Master
        WHEN 'KUNNR' OR 'KUNAG'.
          IF NOT selfield-value IS INITIAL.
            READ TABLE i_out INDEX selfield-tabindex.
            IF selfield-fieldname = 'KUNAG'.
              SET PARAMETER ID 'KUN' FIELD i_out-kunag.
            ELSEIF selfield-fieldname = 'KUNNR'.
              SET PARAMETER ID 'KUN' FIELD i_out-kunnr.
            ENDIF.
            SET PARAMETER ID 'BUK' FIELD i_out-bukrs_vf.
            SET PARAMETER ID 'VKO' FIELD i_out-vkorg.
            SET PARAMETER ID 'VTW' FIELD i_out-vtweg.
            SET PARAMETER ID 'SPA' FIELD i_out-spart.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          ENDIF.
    Go To VL03N
        WHEN 'VBELN'.
          READ TABLE i_out INDEX selfield-tabindex.
          IF NOT i_out-vbeln IS INITIAL.
            SET PARAMETER ID 'VL' FIELD i_out-vbeln.
            CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
          ENDIF.
    Go To VA03
        WHEN 'VGBEL'.
          READ TABLE i_out INDEX selfield-tabindex.
          IF NOT i_out-vgbel IS INITIAL.
            SET PARAMETER ID 'AUN' FIELD i_out-vgbel.
            CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    ENDFORM.  "line_click
    Please, reward if helpful
    Regards,
    George

  • Handle deletion in an editable alv

    Hi,
    I have an editable alv . When I delete a record from this editable alv , I also want to delete it from the corresponding database .
    Please could someone tell me how we can capture the particular record selected for deletion in this editable alv .
    Regards,
    Sushanth H.S.

    Hello Sushanth
    Assuming that you can only delete entire rows but not modify rows (editable cells) you could use a simple approach by storing a PBO image of your data.
    For a sample report have a look at report ZUS_SDN_ALV_EDITABLE_1A in Issue with CHECK_CHANGED_DATA  method of CL_GUI_ALV_GRID class
    By comparing GT_OUTTAB_PBO and GT_OUTTAB (PAI data) you can simply find out the deleted records.
    Alternatively, you may use a more sophisticated approach:
    [Comparing Two Internal Tables - A Generic Approach|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach]
    This approach will also be helpful if the ALV rows can be modified because in this case you have to find out the MODIFIED rows.
    Regards
      Uwe

  • How to save the editable alv data to another program ?

    hi friends,
    please solve this issue..
    i have one editable alv grid report. after edit my data in the grid..
    i want to
                save those data (edited data )or
                download those data into another internal table or
                pass those data as input to another report program..
    how can i do this ?

    The form switch to edit mode could be :
    form p_edit.
      data : is_fieldcatalog type lvc_s_fcat ,
             it_ucomm        type table of syucomm with header line ,
             v_ucomm         type syucomm.
    * Switch Edit <-> Display
      loop at it_fieldcatalog into is_fieldcatalog.
        check is_fieldcatalog-fieldname ne 'NUM' and
              is_fieldcatalog-fieldname ne 'RCODE'.
        if is_fieldcatalog-edit eq 'X'.
          clear is_fieldcatalog-edit.
        else.
          move 'X' to is_fieldcatalog-edit.
        endif.
        modify it_fieldcatalog from is_fieldcatalog.
      endloop.
    * Change the status of the grid.
      if is_fieldcatalog-edit eq space.
        move '&REFRESH' to v_ucomm.
        call method obj_grid->set_function_code
             changing c_ucomm = v_ucomm.
        call method obj_grid->set_ready_for_input
             exporting i_ready_for_input = '0'.
      else.
        call method obj_grid->set_ready_for_input
             exporting i_ready_for_input = '1'.
      endif.
    * Modify the fieldcatalog.
      call method obj_grid->set_frontend_fieldcatalog
           exporting it_fieldcatalog = it_fieldcatalog.
    * Refresh the display of the grid.
      call method obj_grid->refresh_table_display.
    * Set the column lines number.
      perform p_set_lines_num.
    * Clear the flag control.
      clear v_flag_control.
    * Messages.
      if is_fieldcatalog-edit eq space.
        move 'Passage en mode affichage.' to v_buff.
        perform p_add_message
                using v_buff
                      'ICON_DISPLAY'
      else.
        move 'Passage en mode édition.' to v_buff.
        perform p_add_message
                using v_buff
                      'ICON_CHANGE'
      endif.
    * Inactiv function.
      if is_fieldcatalog-edit eq space.
        set pf-status '100'.
      else.
        move '' to it_ucomm. append it_ucomm.
        set pf-status '100' excluding it_ucomm.
      endif.
    endform.                     " P_EDIT.
    and for the table:
    data : w_id(60).
    move 'ZTOTO' to w_id.
    export it_table[] to memory id w_id.
    in the other program, it's the same with the IMPORT instead of export.

  • Update the Billing orders after display/ modifiy in the Editable ALV

    Hi Experts,
    I have created one Editable ALV to display theBilling order with BP details,
    Once user get the ALV output he can modify the content and same will be updated once he hits UPDATE button.
    my requirement is after user hits the UPDATE button a background should be created and update of BO should happen also user user should able to see the status by checking the SPOOL.
    currently i am using the FM crm_order_maintain to update, kindly guide me how to process this step in background for all the entries which are selected in ALV by user.
    i think i can use SUBMIT with JOB_OPEN and JOB_CLOSE, but i need some same code & guidance.
    Thanks in Advance.
    Regards,
    Pradeep

    problem solved

  • How can we find out data in an editable ALV grid has been changed or not?

    Hi Experts,
    How can we find out whether a data in an editable ALV grid has been changed or not.
    I am using the
    FM -> REUSE_ALV_GRID_DISPLAY_LVC
    for ALV display.
    I have to chekc whther data has been changed or not befor saving. if changed then only i want to
    SAVE
    . I cannot use the internal table comparison method for this purpose also i am not using OOP ALV.
    So kindly sugest me an alternative.
    Thanks and Regards,
    Shahana

    Hi,
    Thanks for your answer. I already saw this post.
    See this method.
    CALL METHOD reuse_alv_grid->check_changed_data
    IMPORTING
    e_valid = lv_check.
    This will update the internal table with the edited values. Then we can go for internal table comparison.
    But my scenario will not allow me for itab comparisons.I just want to know the ALV data has been changed or not.
    Regards,
    Shahana

  • Check unchanged data in an editable alv grid

    Hi,
    I have a problem with my editable ALV. As long as I'm changing my data the event DATA_CHANGED is raised and my fields are checked correctly. But what about unchanged data like appended rows. In that case no changes have been made and the event is not triggered.
    Even if i raise the event by using the method:      
    CALL METHOD gr_grid1->check_changed_data
        IMPORTING
          e_valid   = lv_valid
        CHANGING
          c_refresh = lv_refresh.
    there are no changed data so that my checks:
    FORM data_changed USING  lr_data_changed TYPE REF TO
                                             cl_alv_changed_data_protocol.
      DATA: ls_mod_cells TYPE lvc_s_modi.
      DATA: ls_cells TYPE lvc_s_modi,
            lv_value TYPE lvc_value ,
            lv_matnr TYPE matnr,
            lv_maktx TYPE maktx,
            lv_error TYPE c.
      CLEAR lv_error.
      LOOP AT lr_data_changed->mt_good_cells INTO ls_mod_cells.
        CASE ls_mod_cells-fieldname.
          WHEN 'MATNR'.
            CALL METHOD lr_data_changed->get_cell_value
              EXPORTING
                i_row_id    = ls_mod_cells-row_id
                i_fieldname = 'MATNR'
              IMPORTING
                e_value     = lv_value.
    * CHECK MARA SEGMENT
            SELECT SINGLE mara~matnr
                          makt~maktx INTO (lv_matnr,
                                           lv_maktx)
                                      FROM mara AS mara
                                INNER JOIN makt AS makt
                                        ON mara~matnr = makt~matnr
                                WHERE mara~matnr = lv_value AND
                                      makt~spras = sy-langu.
            IF NOT sy-subrc IS INITIAL.
              CALL METHOD lr_data_changed->add_protocol_entry
                EXPORTING
                  i_msgid     = 'M3'
                  i_msgno     = '305'
                  i_msgty     = 'E'
                  i_msgv1     = lv_value
                  i_fieldname = ls_mod_cells-fieldname
                  i_row_id    = ls_mod_cells-row_id.
              lv_error = 'X'.
            ELSE.
              CALL METHOD lr_data_changed->modify_cell
                EXPORTING
                  i_row_id    = ls_mod_cells-row_id
                  i_fieldname = 'MAKTX'
                  i_value     = lv_maktx.
            ENDIF.
          WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    ENDFORM.
       are not working.
    Thank you for your help
    Gregor
    Edited by: Gregor Sure on Oct 13, 2009 1:58 PM

    Try to capture the event DATA_CHANGED_FINISHED. You can use the method REGISTER_EDIT_EVENT of the class CL_GUI_ALV_GRID to register the edit events.
    Regards,
    Naimesh Patel

  • Row wise total in editable ALV

    hello all,
                I am workin on editable alv, the user need to enter the values in the editable fields and in the last column(non-editable) i need to populate the total row wise,as soon as user enters a value and goes to next editable cell or on entering a vale and press enter.how to accomplish this task...
    with regards,
    sandeep akella.
    Edited by: sandeep akella on Aug 20, 2009 1:58 PM

    You need to Implement the OnCellAction event.follow these steps;
    1. Goto WDDOMODIFYVIEW and place the following code
    IF first_time IS INITIAL.
        DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
        lo_cmp_usage =   wd_this->wd_cpuse_usg_alv( ).
        IF lo_cmp_usage->has_active_component( ) IS INITIAL.
          lo_cmp_usage->create_component( ).
        ENDIF.
        DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
        lo_interfacecontroller =   wd_this->wd_cpifc_usg_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        CALL METHOD lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled
         EXPORTING
            value = abap_true.
      ENDIF.
    2. Implement the onCellAction event as follows;
        Goto Methods tab, create a new method. Method Type- Event Handler , Event - ON_CELL_ACTION
    3. Now in this  method retrive the contents of the row and calculate the value as follows.
    DATA: l_element TYPE REF TO if_wd_context_element.
      DATA:ls_stru TYPE wd_this->element_cn_alv.
      DATA: l_node TYPE REF TO if_wd_context_node.
      l_node  = wd_context->get_child_node( 'CN_ALV' ).
      l_element = l_node->get_element(  r_param->index ).
      l_element->get_static_attributes( IMPORTING static_attributes = ls_stru ).
      ls_stru-last_col = ls_stru-col1+ls_stru-col2....+ ls_stru-col5. " add all the cells data
      l_element->set_static_attributes( exporting static_attributes = ls_stru ).

  • Search help for date field in Editable ALV

    Hello Friends,
    I am using editable alv using 'reuse_* '.
    I have used date as input field. While creating fieldcatlog also i have  declared dat as a mkpf-budat.
    But i am not getting serach help for date in output.
    Is it possible with reuse or i have to go by object oriented ?

    Hi,
    Just pass the Edit option of the fieldcatalog for those specific fields...
    fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'    "<----  pass this
          i_callback_top_of_page   = 'TOP'
          is_layout                = it_layout
          it_fieldcat              = it_fcat
          i_default                = 'X'
          i_save                   = 'A'
          it_events                = it_event
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&DATA_SAVE'.                "<-------check this
          PERFORM save_data.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Check_changed_data method on editable ALV Grid ( class cl_gui_alv_grid)

    Hi guys,
    I use the following method (register_edit_event) in the PBO soon after first display of an editable ALV grid to register enter as an event to do validations on fields like qty. If user enters some character like 'abc' for qty and hits enter on keyboard, ALV grid pop's up a standard message ( I haven't coded for this.Since I use DDIC structure in field catalog, the Std. ALV program takes care of it. ). THis takes care of the validation before I click on save.
    call method alv_grid->register_edit_event
                            exporting
                               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    This works fine. But I want this validation to run when I also click the SAVE button of the screen. Is it possible to run this standard validation in my PAI event eg. SAVE ? I thought I will be, by calling the method check_changed_data in my PAI event. But this is doing nothing. Does this method conflict with register_edit_event or something ? So , basically what I am looking for is to trigger the event or call the method which does the same work as the "check" button on ALV grid.
    Any advice or tips or sample code is greatly appreciated.
    Thanks,
    Shareen

    Hi Shareen,
    Handle the data_changed event in the grid.
    Whenever you make changes in the data in ALV Grid this event would be triggered. Here you can perform additional validations that you may need to perform.
        METHODS handle_data_changed
          FOR EVENT data_changed OF cl_gui_alv_grid
          IMPORTING er_data_changed.
    Implementation:
      METHOD handle_data_changed.
        PERFORM validations USING er_data_changed.
      ENDMETHOD.
    FORM validations USING er_data_changed TYPE REF TO cl_alv_changed_data_protocol.
      DATA: ls_good TYPE lvc_s_modi.
      DATA  wa LIKE LINE OF lt_good_cells.
      CALL METHOD g_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_modified.
      LOOP AT er_data_changed->mt_good_cells INTO ls_good.
        CASE ls_good-fieldname.
        WHEN 'FIELDNAME'. "Your fieldname
            CALL METHOD er_data_changed->get_cell_value "Get the changed value
              EXPORTING
                i_row_id    = ls_good-row_id
                i_fieldname = ls_good-fieldname
              IMPORTING
                e_value     = temp. "Your temp variable
            "Make your validations here.
        ENDCASE.
    Ps: Reward points if helpful.
    Regards,
    Wenceslaus.

Maybe you are looking for

  • USB device does not work after sleep

    The problem in the following: X230t in tablet mode, connect to the USB port of the adapter USB to COM Port (ftdi232) all works fine, but if not disconnect the adapter from the USB port and put the laptop into sleep (or hibernation) the following incl

  • Slight bluish tinge on print margins

    I built 3 profiles with ColorMunki for three different papers (I print with an Epson 3880).  Using each of the profiles, a slight bluish tinge appears in what I'll call the "margin" of the prints.  My tests were done on 4x6 paper, but the image was o

  • Net bill value - why not possible in SAP

    hai, I have one basic doubt. Why SAP is not showing the balance amount of the bill? ex bill value is Rs.10000.00 partpayment received Rs.5000.00  in sap for partpayment, the saparate document is creating but it is not deducting the bill amount. Why i

  • Maximum 30 seconds...

    I can only get maximum 30 seconds of a song before the light turns yellow and I lose contact with the AirTunes. Not playing music it will stay connected for days on end with no problem. This occurs on both an MBP and MB. I set the device close to the

  • Ingest question for any Red users

    Hi there, just wanted to get a rough idea on which of the following Red cutters prefer as their ingest method. (I'm going back to R3D files for main post but all ingest is to Pro res for cutting now) 1. use FCP log & transfer tool 2. use Redcine-x 3.