I_grid_settings-edt_cll_cb = 'X' in editable ALV

Hi,
I displayed output in editable ALV in ABAP. In output I have edited the cell but in debugging the value is not getting reflected. Using
i_grid_settings-edt_cll_cb = 'X' we can catch the value but I am not able to catch.
Kindly provide the suggestion to catch the the edited value using above settings.
Thanks in advance,
Regards,
Arindam Samanta.

Hi,
I assume Your requirement like this .
Hope you activate >
I_GRID_SETTINGS         = I_GRID_SETTINGS.
and then check this full code will help you as example.
transferring alv grid data to other program
Otherwise if you only want few editable field,then you can follow this code,which I am using,it is also easy.
a snippet,
CONSTANTS :
   gc_refresh TYPE syucomm VALUE '&REFRESH'.
CONSTANTS :
   c_x VALUE 'X'.
data:    lt_event_exit TYPE slis_t_event_exit,
     ls_event_exit TYPE slis_event_exit.
wa_fieldcat-fieldname = 'REMARKS'.
wa_fieldcat-seltext_l = 'Remarks'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-col_pos = 1.
wa_fieldcat-outputlen = 50.
wa_fieldcat-emphasize = 'X'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR ls_event_exit.
   ls_event_exit-ucomm = gc_refresh.    " Refresh
   ls_event_exit-after = c_x.
   APPEND ls_event_exit TO lt_event_exit.
Depend upon your user command like save,refresh it ill work also,like example,
FORM user_command USING r_ucomm TYPE sy-ucomm
                         rs_selfield TYPE slis_selfield.
   CASE sy-ucomm.
     WHEN gc_refresh.
       refresh it_new_s.
  LOOP AT it_new into wa_new where flag eq 'X'.
    append wa_new to it_new_s.
  ENDLOOP.
it_fieldcat_s[] = it_fieldcat[].
delete it_fieldcat_s where fieldname = 'FLAG'.
     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program     = sy-repid
         i_callback_top_of_page = 'TOP-OF-PAGE'
         i_callback_user_command = 'USER_COMMAND_S'
         i_callback_pf_status_set = 'PF_STATUS_SET'
         it_fieldcat            = it_fieldcat_s
         is_layout              = wa_layout
         it_sort                = it_sort
               it_event_exit            = lt_event_exit
       TABLES
         t_outtab               = it_new_s[].
and
FORM pf_status_set USING ut_extab TYPE slis_t_extab.        "#EC CALLED
   DELETE ut_extab WHERE fcode = gc_refresh.
   SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
       EXCLUDING ut_extab.
ENDFORM.
There are lots of thread on editable alv,check also.
Thanks
Gourav.

Similar Messages

  • Editable ALV-No change in internal table

    Hello Experts,
       I have an ALV output, in which I have a column as editable. I have generated the output using 'REUSE_ALV_GRID_DISPLAY'. I got to know that after changing the editable cell's value, if we double click the cell or if operate with any PF-status  components, the value will automatically get changed in internal table also. For double click I am getting the expected result. But If I click a button the value doesn't get changed in internal table. Is there any other change I have to do for this. If I have checkbox in ALV will it be rectified. But my requirement is when I click the button only It has to be modified in the database table.
    Thanks and regards,
    Venkat.

    Hi Venkat,
    In your form for User Command
    write following
    DATA ref1 TYPE REF TO cl_gui_alv_grid.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_grid = ref1.
          CALL METHOD ref1->check_changed_data.
    Case 'User-Command'.
    Endcase.
    or
    data : i_grid_settings type lvc_s_glay.
    "Calling ALV grid for display
    call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program             = sy-repid
          i_callback_user_command   = i_callback_user_command
          i_grid_settings                    = i_grid_settings
          is_layout                            = is_layout
          it_fieldcat                           = it_fieldcat
        tables
          t_outtab                             = it_final
    "for call back values from editable grid cells
      i_grid_settings-edt_cll_cb = 'X'.
    Hope it helps you,
    Pratik

  • 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

  • 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.

  • Capture contents from an editable alv

    I'm trying to capture fields from an editable alv. I have an update button in the application toolbar. So when i press this button, whatever changes I have done on the screen, the internal table should get updated. I'm using the function module    REUSE_ALV_GRID_DISPLAY.
    Can anybody help me out??

    Yes you can,
    If you have access to the element in the context that is bound to the row in the ALV then you can connect the message. Marking a * is not possible by default with the WD message manager and you willl need to do it manually. Use the element method of the message manager API for this purpose.

  • My changes edited on editable ALV report are not transferring back to itab?

    Hello
    I was developed a heirarchila editable ALV by using FM 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'. The user will do some changes in the ITEMs (Z_VBAP_TABLE) on this heirarchila ALV report and presses the SAVE button.
    In my program am handling this SAVE command and even my break point is also triggering at SAVE, but my ITAB is not having the CHANGED/new data!! still it has the old data in it! How to capture the user changes done on the report? those changes are not tranferring back to my itab/prog! because, ineed to update Z_VBAP_TABLE with those changes
    Thank you

    Hi Raju,
    it is possible . But i know about your code.
       WHEN 'SAVE'(003).
        Lock the table
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              mode_rstable   = 'E'
              tabname        = viewname
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 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.
          IF NOT grid1 IS INITIAL .
            CALL METHOD grid1->check_changed_data .
          ENDIF .
          SORT i_mod BY row.
          DELETE ADJACENT DUPLICATES  FROM i_mod COMPARING row.
          lh_norec = LINES( i_mod ).
          lh_total = lh_norec.
          SHIFT lh_total LEFT DELETING LEADING space.
    Standard Table Update
          IF i_mod[] IS NOT INITIAL.
            LOOP AT i_mod INTO lwa_mod.
              READ TABLE <i_itab> INTO <wa_tab> INDEX lwa_mod-row.
              IF sy-subrc = 0 .
                IF lh_flag NE 'X'.
                  MODIFY (viewname) FROM <wa_tab>.
                ELSE.
                  INSERT (viewname) FROM <wa_tab>.
                  IF sy-subrc NE 0.
                    MESSAGE 'DATA NOT SAVED' type 'I'.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDLOOP.
            CONCATENATE lh_total '  ' text-s01 INTO lh_succ SEPARATED BY space.
            MESSAGE 'Data Saved' TYPE 'I'.
    This i did a long back. Check your code . I created an alv that will display data from my table . In this the user can click in any line item and he can change any value and press save  that will save the value .
    Regards,
    Madhu.

  • Urgent : Problem with Editable  ALV Grid  for Quantity and Currency Fields

    Hi All,
    I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
    When user changes these values these values are not changing properly .
    For the quantity field the domain is MENG13 with 3 deciamal places and here  if we enter 500 it takes it as 0.500   .
    The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
    Here also it takes last 2 digits after decimal places by default.
    Please advice how to get proper values in this case from ALV editable fields.
    Thanks and Regards
    Harshad
    Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AM

    for all the currency field , it will display like that only.
    u have to manipulate uin program before displaying.
    if they are giving 500, in program multiply with 100 and move it to table.
    when u are getting from table, divinde and display.
    this is what I am doing.
    Reward if helpfull.

  • Regarding editable alv

    Hi all,
              Frnds i am working in editable alv using function modules not object oriented abap.
    i m trying to edit a Field(MATNR ) in my output list and finally update it with changed values in the DB table.
    But i m getting syntax error like
    "the work area i_final is not alligned properly
    below i m providing my code.
    <code>
    *& Report  ZEDITABLE_ALV1
    REPORT  ZEDITABLE_ALV1.
    TABLES: vbak,vbap.
    TYPE-POOLS: slis. "ALV Declarations
    data: BEGIN OF i_final occurs 0,
          vbeln like vbap-vbeln,
          posnr like vbap-posnr,
          matnr like vbap-matnr,
          erdat like vbap-erdat,
    END OF i_final.
    DATA : C_X(1) TYPE C VALUE 'X',
           C_FC_MODIFY(6) TYPE C VALUE 'MODIFY'.
    *DATA: i_final TYPE STANDARD TABLE OF T_FINAL with header line.
         i_temp type standard table of T_FINAL with header line.
    *wa_final like line of i_final.
    *DATA:i_final LIKE vbap OCCURS 0.
    *DATA:wa_final LIKE vbap.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    gd_repid LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    PERFORM data_retrieval.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM display_alv_report.
    *& Form BUILD_FIELDCATALOG
    *•     Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    fieldcatalog-fieldname = 'VBELN'.
    fieldcatalog-seltext_m = 'sales order'.
    fieldcatalog-col_pos = 0.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'ERDAT'.
    fieldcatalog-seltext_m = 'date'.
    fieldcatalog-col_pos = 1.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'material no.'.
    fieldcatalog-col_pos = 2.
    fieldcatalog-edit = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-fieldname = 'POSNR'.
    fieldcatalog-seltext_m = 'line item no.'.
    fieldcatalog-col_pos = 3.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    fieldcatalog-FIELDNAME = 'REC_SEL'.
    fieldcatalog-NO_OUT = C_X.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    *•     Build layout for ALV grid report
    FORM build_layout.
    gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text = 'Totals'(201).
         gd_layout-totals_only = 'X'.
         gd_layout-f2code = 'DISP'. "Sets fcode for when double
         "click(press f2)
         gd_layout-zebra = 'X'.
         gd_layout-group_change_edit = 'X'.
         gd_layout-header_text = 'helllllo'.
    ENDFORM. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    *•     Display report using ALV grid
    FORM display_alv_report.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = gd_repid
    i_callback_user_command = 'USER_COMMAND'
    i_callback_pf_status_set = 'GUI_STAT'
    *i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    *it_special_groups = gd_tabgroup
    *it_events = it_events
    i_save = 'X'
    *is_variant = z_template
    TABLES
    t_outtab = i_final
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_ALV_REPORT
    **& Form DATA_RETRIEVAL
    *•     Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    *SELECT avbeln aerdat bmatnr bposnr FROM vbak AS a
    *INNER JOIN vbap AS b ON avbeln = bvbeln
    *INTO TABLE i_final WHERE a~vbeln = b~vbeln.
    select VBELN ERDAT MATNR POSNR up to 10 rows from vbap into corresponding fields of  table i_final.
    ENDFORM. " DATA_RETRIEVAL
    *•     FORM GUI_STAT *
    *•     --> RT_EXTAB *
    FORM gui_stat USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'MODIFY' EXCLUDING rt_extab.
    ENDFORM.
    *•     FORM USER_COMMAND *
    *•     --> U_COMM *
    *•     --> RS_SELFIELD *
    FORM user_command USING u_comm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    DATA:selfield TYPE slis_selfield.
    *RS_SELFIELD-REFRESH = C_X.
    CASE u_comm.
    *IF U_COMM = C_FC_MODIFY.
    WHEN 'UPDATE'.
    LOOP AT i_final. " into wa_final."into wa_final.
    *READ TABLE I_TEMP WITH KEY VBELN = I_FINAL-VBELN.
    *IF SY-SUBRC = 0.
    i_final-matnr = vbap-matnr.
    *MODIFY I_final INDEX SY-TABIX.
    *ENDIF.
    ENDLOOP.
    *ENDIF.
    MODIFY VBAP FROM TABLE i_final.
    IF SY-SUBRC = 0.
    COMMIT WORK AND WAIT.
    *MESSAGE I000 WITH SY-DBCNT
    *' Record(s) has been Updated'(020).
    ENDIF.
    *append i_final.
    *it_temp = i_final.
    *append it_temp.
    **UPDATE sflight FROM TABLE sflight_tab.
    *ENDLOOP.
    *update vbap from table i_final.
    *IF sy-subrc = 0.
    *MESSAGE s000(0) WITH 'records updated successfully'.
    *ENDIF.
    ENDCASE.
    ENDFORM.
    </code>
    Frnds plz help me in this regard.
    Thanks,
    satya

    Try something like this...ur code was not clear..i have done something u can understand.
    First check that u r not trying to update the primary key field.
    first before updating.
    Before updating select the record u r going to update from the main table.
    select single * from VBAP where <pass the key values>.
    if sy-subrc = 0.
    move the rest of the values to the table header except the key values.
    vbap-<field1> = value1.
    vbap-<field2> = value2.
    after moving the values.
    update <table>.
    if sy-subrc = 0.
    commit work.
    endif.
    data:st_vbap type vbap.
    WHEN 'UPDATE'.
    LOOP AT i_final. " into wa_final."into wa_final.
    select single * from vbap where vbeln = I_FINAL-VBELN.
    move-corresponding i_final to vbap.
    update vbap.
    if sy-subrc = 0.
    commit work.
    wk_cnt = wk_cnt + 1.
    endif.
    at last.
    *MESSAGE I000 WITH SY-DBCNT
    *' Record(s) has been Updated'(020).
    endat.
    endloop

  • Unable to display Refreshed editable alv

    hi
    I have developed editable alv which contains 7 colums. the final column is the addition of 4th n 5th cplumn. when i refresh after changing the values, the final column is not changing. but while debugging the changed values are reflected in internal table but its reflected in alv.
    help me out

    in the user_comand form you have to put rs_selfield-refresh = 'X'.
    like this:
    *& Form user_comand
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    rs_selfield-refresh = 'X'.

  • Retrieve front end values of editable alv in same format

    I have a problem to retrieve the front end values in editable alv filled by user.
    I am able to get it from MODIFIED CELL method but it gives the values after
    alv automatically conversion. For example if user filled 1 in cell of type numc
    then i want to keep it as 1 not as 00..001 format of numc.
    Same for when user fill alphbets in small letter the alv convert it in CAPS.
    I want to retain it as it as filled by user.
    Example: User filled aAbBcFG in a cell
    then it should update in database in same format not like AABBCFG as alv did
    <offer removed by moderator>
    Edited by: Rocky_S on Jan 20, 2011 7:50 AM
    Edited by: Rocky_S on Jan 20, 2011 7:51 AM
    Edited by: Thomas Zloch on Jan 20, 2011 11:24 PM

    Hi Srinivas I have used CONVERSION_EXIT_ALPHA_OUTPUT for number input. My problem is that
    when user fill 0 in the alv cell then alv automatically convert it into 00000000. My field is of type numc
    that why it converts in 00000000. I want to retrieve it as the user fill in alv cell. Through this function
    module the import parameter parameter is of numc format not as filled by user. In my case if it is 0
    then then i should retrieve it as it is.
    My actual scenario is i have a numc type field in alv and i want to keep it as mandatory. For which i am
    writing a logic. Because in my table there is a valid entry of 0. If user do not fill 0 then it takes automatically
    0 as input because of initial value of numc field. I want to restict it. I can not convert this field as char.
    Give me some logic to make numeric field mandatory.

Maybe you are looking for

  • Processing routine ENTRY in program ZRVADIN0111 does not exist for smartfor

    Hi , This is the log , I am getting in vf02 .. ==========log============== Message Text Processing routine ENTRY in program ZRVADIN0111 does not exist Technical Data Message type__________ E (Error) Message class_________ VN (Output control) Message

  • Toll free calling and automated menu recognition

    When I phone a toll free number with my iPhone 5, the automated system is not receiving any of my input. For example, if the automated system says press 1 for English, I press 1 and it won't recognize I'm pressing 1. Or press 5 for sales, it won't re

  • Regarding Cash Flow report

    Hi all,         one of my clients has asked for the cash flow report to be modified. They are making incoming payment and outgoing payments with different series for cash and cheque. However, in the PLD of the cash flow report they want the title to

  • How to implement Aggreagtion level

    Hi Every One, I created Aggregation level and based on that created Planning Function.. When using the t-code ' RSPLAN ' to create planning sequence , there in the edit sequence screen Filters are not populating for particular Planning function. Can

  • Compare two records column by column in same table

    Hi All, I have an address table with ID as the PK but there can be more than one ID. I need to take the latest address record and first see if that same ID has a previous address record and if so, compare each column to see if the data has changed. I