Skip to Content
author's profile photo Former Member
Former Member

Editing and Updating Fields of an ALV_GRID

Good Afternoon,

I've created a program that shows me the content of a table according to an authority check. The content is showed using the following function:

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program       = gd_repid
            i_callback_pf_status_set = 'SET_PF_STATUS'
*              i_callback_top_of_page   = 'ESCREVE_TOP'
            i_callback_user_command  = 'USER_COMMAND'
*              i_grid_title           = outtext
            is_layout                = gd_layout
            it_fieldcat              = it_fieldcat[]
*              it_special_groups      = gd_tabgroup
*              IT_EVENTS              = GT_XEVENTS
*          i_save                   = 'X'
*              is_variant             = z_template

       TABLES
            t_outtab                = t_t001b
       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.

I have selected some fields to be editable, until now everything is fine.

What i'm not being able to do is... After editing one (or several) fields of the grid i want also to update the table. Updating the table is peanuts, the problem is that when i process USER_COMMAND i can't see the values i've updated in the screen anywhere, they-re still the old values.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 06:02 PM

    In the user command subroutine modify the parameter for the structure slis_selfield with the field

    REFRESH = 'X'.

    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    CASE r_ucomm.

    WHEN '&DEALL'.

    • Message for reselection of lines

    IF itab_display-kalab LE 0.

    MESSAGE i101.

    EXIT.

    To refresh...

    rs_selfield-refresh = 'X'.

    Regards,

    Prakash.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 06:03 PM

    I have never used REUSE_ALV_GRID_DISPLAY function module for such scenario but i have used OO ALV to get data realtime.

    "

    CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY

    EXPORTING

    IS_LAYOUT = GS_LAYOUT

    IS_VARIANT = GS_VARIANT

    I_SAVE = X_SAVE

    IT_TOOLBAR_EXCLUDING = TEMP_UI

    CHANGING

    IT_FIELDCATALOG = ITAB_FIELDCAT[]

    IT_OUTTAB = I_ORDER[]

    IT_SORT = I_SORT[]."

    I display ALV using above statement and whenever user clicks some button on the container, i use

    "* refresh screen display with new data.

    CALL METHOD GRID1->REFRESH_TABLE_DISPLAY.

    "

    method to get new data populated into internal table after this statement.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Sorry

      "CALL METHOD EVENT_RECEIVER->HANDLE_DATA_CHANGED" method to get new data into internal table.

      In my scenario i had checkboxes on the ALV and editable fields too on each row. After calling above method, internal table automatically had "X" populated for checkboxes and data populated in editable fields.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 05:38 PM

    Just check the link below to use USER_COMMAND

    chek if you not miss any thing

    http://www.sapfans.com/forums/viewtopic.php?t=11601

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.