Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Event for edit fields in Object ALV grid

Former Member
0 Kudos

Hi community,

I've building an ALV Grid in a SubDynpro of Tabstrip...

Any fields are edit.

I would like refresh my internal table at data changed of ALV object but if not assign a field at F4 event this result

not refresh.

Thanks everybody,

Antonello

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor
0 Kudos

Hi,

I don't understand your message :

to force refresh of your ALV Grid (edit mode) you could use :


    move '&REFRESH' to v_ucomm.
    call method obj_grid->set_function_code
         changing c_ucomm = v_ucomm.

To refresh the display :


  call method obj_grid->refresh_table_display.

Regards

Frédéric

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:14 PM

11 REPLIES 11

FredericGirod
Active Contributor
0 Kudos

Hi,

I don't understand your message :

to force refresh of your ALV Grid (edit mode) you could use :


    move '&REFRESH' to v_ucomm.
    call method obj_grid->set_function_code
         changing c_ucomm = v_ucomm.

To refresh the display :


  call method obj_grid->refresh_table_display.

Regards

Frédéric

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:14 PM

Former Member
0 Kudos

I got probably the same problem ,

The quetion is.. which is the method to make effective changes to the column that is editable on my grid, I can change the value but the value on my internal table is the same one before the changes...

0 Kudos

Hi Guys,

I think its a problem of the frontend (GRID) not being in sync with the internal table.

Call this method in the PAI and you should be able to see the updated values in the grid as well as the internal table.]

Grid_object->CHECK_CHANGED_DATA.

This will synchronize the grid and the internal table.

Regards,

Ravi

0 Kudos

I use the '&REFRESH' .. That the command call by the button refresh. That will save the data you have modify into the screen to the internal table.

It's explain in the http://help.sap.com

0 Kudos

OMG Ravi, I love your answer. It was exactly what I was looking for.

Former Member
0 Kudos

Hi again !! I tried to refresh the table with the relate command but the system return me this error :

"the field xxx is not in the abap dictionary"

????

ssimsekler
Active Contributor
0 Kudos

Hi Antonello

You can make use of the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control"</a>.

Regards

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">bc</a>

Link fixed by: Alvaro Tejada Galindo on Jan 8, 2009 2:15 PM

0 Kudos

Resolved , the problem was that I declared the alv's field "like" the one of the internal table and not like the one of the db, now works...

Former Member
0 Kudos

Hi

I have the same problem as you , the error message says , the field is not defined in the data dictionary . I then declared the internal tale field : LIKE LIPS-LFIMG . Still the problem persists. Do I have to make any changes to the field catalog aswell.

Thankyou

Former Member
0 Kudos

Hello Krish. I know that this is a very old message, but thought I would reply just in case someone else was having this same problem. I was receiving the same error and my particular error was due to the REF_FIELD & REF_TABLE having values in them within my FIELDCAT table. I removed the values for the fields that I made editable and it now works.

I355602
Advisor
Advisor
0 Kudos

Hi Antonello Didonna,

Use this code, its working:-

After the user edits any records and performs an action then place this code.

Say when user presses a button with function code 'EXECUTE', and all the changes from the output screen in ALV reflects back to internal table.

 
* handle the code execution based on the function code encountered
CASE sy-ucomm.

* when the function code is EXECUTE then process the selected records
  WHEN 'EXECUTE'.

* to reflect the data changed into internal table
    DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new

    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.

    " now your internal table data is changed as in ALV output
    " append your code

  WHEN OTHERS.
    " your code

ENDCASE.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir