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: 

Set ALV cell, use of event DATA_CHANGED

michael_fallenbchel
Active Participant
0 Kudos

Hi experts,

I want to set some ALV input fields using abap.

That's easy, I can modify the table as I need and call the refresh of the ALV table ( refresh_table_display).


But how can I "fill" the fields that the event DATA_CHANGED is called?

When I fill manually in ALV, this event is raised...I need the event also when filling with ABAP...

Thanks in advance

Michael

4 REPLIES 4

Former Member
0 Kudos

Hello Michael,

This link shows you the right way to do:

Get Changed Value In ALV Grid Dynamically - ABAP Development - SCN Wiki

Inside HANDLE_DATA_CHANGED method, you can change the value of a cell in this way:

CALL METHOD PR_DATA_CHANGED->MODIFY_CELL

    EXPORTING

      I_ROW_ID    = IT_TABLE-ROW_ID

      I_FIELDNAME = 'FIELD'

      I_VALUE     = IT_FLIGHT-FIELD.

I hope you help.

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Michael,

Please find the link below to update the ALV Grid using REFRESH_TABLE_DISPLAY

demo program to refresh alv grid(oops) - Code Gallery - SCN Wiki

Regards

Rajkumar Narasimman

michael_fallenbchel
Active Participant
0 Kudos

I'm almost there now!

First, I use method  change_data_from_inside from cl_gui_alv_grid, exporting all the changed fields with tabix, value and fieldname.

But now I have a problem - if I change a field of type MENG13 (QUAN, length 13), I got a dump

ASSIGN_CASTING_ILLEGAL_CAST  - CX_SY_ASSIGN_CAST_ILLEGAL_CAST

in method GET_CHANGED_DATA:


assign component is_style_cells-fieldname of structure

<ls_comp1> to <ls_comp> casting type c.

What I can do now?

0 Kudos

Hi michael.fallenbchel,
I know it was 6 years ago but maybe you recall the way you have overcome that obstacle? If so feel free to share it 😉
Regards,
Bartosz
P.S. Now I know that I can't seek any help from SAP as "all methods that are related to editability of the ALV grid are not released for customer software developments" - SAP note 695910