Application Development and Automation 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: 
Read only

Changing Cell Contents

Former Member
0 Likes
1,022

Hi folks,

I have a requirement to display table output in an ALV grid, making 1 column editable.

I have done this by setting the EDIT = 'X' flag in the field catalog for the field in question. Yet, when the field value is modified and the users try to continue processing, I cannot find the value that was changed.

The process for building and displaying the table is as follows:

1)

  method constructor.
*/ Initialise variables here...

*/  Set the name of the internal table that will be displayed
*/  in the ALV grid

    m_active_Table = 'IT_SPECTRUM_RECS'. 

2)

*/  Assign the data display table to a field-symbol for ALV display
    assign (m_active_Table) to <fs_datatab>. 

3)

    call method go_grid->set_table_for_first_display
      EXPORTING
        is_layout            = ms_layout
        is_variant           = ms_Variant
        i_save               = m_var_save_st
        it_toolbar_excluding = mt_Excl_UI_Func
      CHANGING
        it_sort              = mt_sort
        it_fieldcatalog      = mt_FieldCat
        it_outtab            = <fs_datatab>. 

Coming back into the PAI of the program, the changes in the editable field are not displayed, only the PBO values of the table (IT_SPECTRUM_RECS) and the field symbol <FS_DATATAB>.

My requirement is to loop through the table and verify the edited column details. Any thoughts would be greatly appreciated, and points will be rewarded accordingly.

Cheers,

Stephen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
912

Beejal,

Thank you for this suggestion. I am in the middle of implementing it, but I still see 1 problem - namely where is the edited data 'i_spfli' obtainined from. If i_spfli is the data outtab specified, then where is the changed data stored. For eaxample, if i_spfli is the table containing the data written into the ALV grid, when I come back into the PAI 'When ...' modules, i_spfli contains the old table values only, not the modified values?

Thanks,

Steve

Hi folks,

I have a requirement to display table output in an ALV grid, making 1 column editable.

I have done this by setting the EDIT = 'X' flag in the field catalog for the field in question. Yet, when the field value is modified and the users try to continue processing, I cannot find the value that was changed.

The process for building and displaying the table is as follows:

1)

  method constructor.
*/ Initialise variables here...

*/  Set the name of the internal table that will be displayed
*/  in the ALV grid

    m_active_Table = 'IT_SPECTRUM_RECS'. 

2)

*/  Assign the data display table to a field-symbol for ALV display
    assign (m_active_Table) to <fs_datatab>. 

3)

    call method go_grid->set_table_for_first_display
      EXPORTING
        is_layout            = ms_layout
        is_variant           = ms_Variant
        i_save               = m_var_save_st
        it_toolbar_excluding = mt_Excl_UI_Func
      CHANGING
        it_sort              = mt_sort
        it_fieldcatalog      = mt_FieldCat
        it_outtab            = <fs_datatab>. 

Coming back into the PAI of the program, the changes in the editable field are not displayed, only the PBO values of the table (IT_SPECTRUM_RECS) and the field symbol <FS_DATATAB>.

My requirement is to loop through the table and verify the edited column details. Any thoughts would be greatly appreciated, and points will be rewarded accordingly.

Cheers,

Stephen

7 REPLIES 7
Read only

Former Member
0 Likes
912

Hello,

Check if you have done the following:

---You have to modify the field Catalog fields to set the field EDIT as 'X'.

---Call the method

CALL METHOD ALV_GRID_INSTANCE->set_ready_for_input

EXPORTING

i_ready_for_input = 0. ( For Display ) and '1' for Edit )

Put this after the set_table_for_first_display method.

--- If you want to check if the user has entered any value on the grid, use the Method : CALL METHOD ALV_GRID_INSTANCE->check_changed_data.

This will reflect as a change in your existiing data table to new data added on the editable grid.

For example,you can use it at user-command 'SAVE':

WHEN 'SAVE'.

call method alv->check_changed_data

importing e_valid = l_valid.

if l_valid = 'X'.

MODIFY SPFLI FROM TABLE I_SPFLI.

endif.

Regards,

Beejal

**Reward if this helps

Read only

Former Member
0 Likes
913

Beejal,

Thank you for this suggestion. I am in the middle of implementing it, but I still see 1 problem - namely where is the edited data 'i_spfli' obtainined from. If i_spfli is the data outtab specified, then where is the changed data stored. For eaxample, if i_spfli is the table containing the data written into the ALV grid, when I come back into the PAI 'When ...' modules, i_spfli contains the old table values only, not the modified values?

Thanks,

Steve

Read only

0 Likes
912

check this demo program on how to get the modified cell value

BCALV_EDIT_03

Raja

Read only

0 Likes
912

Thanks Durairaj, but unfortunately the client has deleted all the SFLIGHT details from the system. I can see the code of the BCALV* programs, but can't test them or see what they do.

Read only

0 Likes
912

you can run tcode BC_DATA_GEN to reload those data into flight tables.

Raja

Read only

0 Likes
912

?

Read only

0 Likes
912

Raja,

Thanks for the program. It worked fine, and from that, I have been able to get individual cell data changes to work.

Cheers,

Stephen