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: 

Input Fields in ALV

Former Member
0 Kudos

Hi,

I displayed a ALV list wich some fields ready for input.

The problem I'm facing is, when I enter a value in, for example TEXT ITEM, I can easly catch the new value. <b>But</b> when I change a field wich is DATE FORMAT i don't see the changes and therefore can't update the value in my table.

Thanks,

Joseph

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

You should be using

handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING

er_data_changed.

Inside the Handle_Data_changed method,

Use the methods get_cell_value exporting ls_mod_cell-row_id to get the changed value and validate.

8 REPLIES 8

Former Member
0 Kudos

Hi Joseph,

I hope you are might using the event data_changed where you will be getting a object er_data_changed an object of cl_alv_changed_protocol

which has a table mt_mod_cells which will have the changed or inserted records.

0 Kudos

No I'm using FM REUSE_ALV_HIERSEQ_LIST_DISPLAY.

0 Kudos

Hi

How do you do to find out the new value is wroten in your ALV?

Max

Former Member
0 Kudos

Hi

You should be using

handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING

er_data_changed.

Inside the Handle_Data_changed method,

Use the methods get_cell_value exporting ls_mod_cell-row_id to get the changed value and validate.

0 Kudos

But that means that I should change my program from using FM REUSE_ALV_HIERSEQ_LIST_DISPLAY to CALL METHOD.

0 Kudos

Hi,

You can do editable alv using set_table_for_first_display.

struct_grid_lset TYPE lvc_s_layo,

i_grid_fcat TYPE lvc_t_fcat

DATA ls_fcat TYPE lvc_s_fcat.

CLEAR ls_fcat.

ls_fcat-fieldname = 'DATE'.

ls_fcat-ref_table = 'TYPE'.

ls_fcat-ref_field = 'C'.

<b>ls_fcat-edit = 'X'.</b>

ls_fcat-coltext = text-030."Date

ls_fcat-seltext = text-030.

APPEND ls_fcat TO p_i_grid_fcat.

CALL METHOD o_grid->set_table_for_first_display

EXPORTING

i_bypassing_buffer = space

is_variant = ws_f_grid_disvar

i_save = ws_c_grid_save

is_layout = struct_grid_lset

CHANGING

it_outtab = i_grid_outs[]

it_fieldcatalog = i_grid_fcat[]

it_sort = i_sort_fcat. " Period

Also Check this code.Another way using field symbols.

i_fieldcat TYPE lvc_t_fcat,

w_layout TYPE lvc_s_layo ,

w_variant TYPE disvariant.

FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.

*Default display

LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.

CASE <lfs_fieldcat>-fieldname.

WHEN 'DATE'.

<lfs_fieldcat>-coltext = text-050.

<lfs_fieldcat>-no_out = ' '.

<lfs_fieldcat>-scrtext_l = text-050.

<<b>lfs_fieldcat>-edit = 'X'.</b>

WHEN OTHERS.

ENDCASE.

ENDLOOP.

Hope it helps you,

Regards,

Anjali

Former Member
0 Kudos

Hi

I dont know who to do it without Call Method. Please go to Se80 -> Packages -> SLIS. In that , look out for an example program BCALV_EDIT_03.

I hope this solves ur problem.

Murli.

Former Member
0 Kudos

hi, you can't get the user inputted from ALV?

have you tried this way?


DATA:
LC_GLAY TYPE LVC_S_GLAY.
 
* this is the critical point 
LC_GLAY-EDT_CLL_CB = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
       I_GRID_SETTINGS = LC_GLAY
       IT_FIELDCAT = L_ALV_FILEDCAT
     TABLES
       T_OUTTAB = ITAB.

hope it will be helpful