2008 Jan 24 4:34 AM
hi,
i have created ALV list and application toolbar also. i have added 'ADD' button in the toolbar. Now i want to insert one row at the end of that list by clicking on that 'ADD' button and which will show the next number of row (suppose there are 10 rows and each one has sr no. associated with it, now i want last new row to be displayed with sr no. 11 and other blank fields).
thanks in advance.
hi,
i have created ALV list and application toolbar also. i have added 'ADD' button in the toolbar. Now i want to insert one row at the end of that list by clicking on that 'ADD' button and which will show the next number of row (suppose there are 10 rows and each one has sr no. associated with it, now i want last new row to be displayed with sr no. 11 and other blank fields).
thanks in advance.
2008 Jan 24 4:44 AM
Hi,
In the fieldcatalog table all the fields should be in editable mode
ie lw_fcat-edit = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = lv_layout
it_fieldcat = lt_fcat[]
i_save = 'A'
is_variant = lv_variant
TABLES
t_outtab = lt_license[]
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.
ENDFORM. " display_data
&----
*& Form user_command
&----
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'ADD'. "
data: lv_ind type i.
data: lv_line type i.
describe table lt_license lines lv_line.
loop at lt_license into lw_license.
lv_ind = sy-tabix.
if lv_ind = lv_line.
append initial line to lt_license.
endif.
endloop.
ENDCASE.
ENDFORM. "user_command
regards,
Santosh Thorat