‎2008 Jan 22 8:12 AM
Dear All,
I am using ALV Object Model (using class CL_SALV_TABLE) to display a ALV.
I have a requirement where a particular column should be editable. I am trying to do this using the method SET_ENABLED_COLUMN from class CL_SALV_COLUMNS_TABLE. But this is not working and moreover the documentation for that method says that the method is not released.
So how can I achieve a editable column in ALV Object model?
Regards,
Koushik Lingam
‎2008 Jan 22 8:30 AM
Hi,
perform the steps as mentioned.
data: gs_fieldcat type lvc_s_fcat.
clear gs_fieldcat.
gs_fieldcat-fieldname = 'CARRID'.
gs_fieldcat-ref_table = 'SFLIGHT'.
gs_fieldcat-outputlen = '5'.
gs_fieldcat-key = 'X'.
gs_fieldcat-edit = 'X'.
gs_fieldcat-auto_value = 'X'.
append gs_fieldcat to gt_fieldcat.
The property edit marked as Bold in the field catalog will allow the column to be editable mode.
Regards,
JLN
‎2008 Jan 22 8:31 AM
u make a coloum editable by passing x in the field cataloud for that coloum . like
int_fieldcat-edit = 'x' .
Thanks
ROhit
‎2008 Jan 22 9:20 AM
Dear All,
Please remember that I am using ALV Object model in which we cannot modify the field catalog manually. We have to use methods to do that.
So please reply accordingly
‎2008 Jan 24 2:23 PM
We can modify the field catalog in the ALV Object Model also. Just that you have to approach it in a tweaked manner.
Determine the field catalog for any given structure or internal table using the FM "LVC_FIELDCATALOG_MERGE"
Refer the package SLIS to find out how to use this FM.
Then modify the fields in the Field Catalog as you require and then pass it to SET_TABLE_FOR_FIRST_DISPLAY method.
In your case, you will have to pass 'X' to edit field in the necessary records of the field catalog.
have a look at this link.
[http://www.abap4.it/download/ALV.pdf]
Reward if helpful.
‎2008 Jan 24 2:41 PM
Hai,
Try with the following Code:
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'sflight'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = itab_lvc
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE 😕 'before'.
WRITE 😕 '----
'.
LOOP AT itab_lvc INTO wa_lvc.
WRITE 😕 wa_lvc-row_pos,wa_lvc-col_pos,wa_lvc-fieldname,wa_lvc-edit_mask.
ENDLOOP.
LOOP AT itab_lvc INTO wa_lvc WHERE fieldname = 'CARRID'.
wa_lvc-edit_mask = 'X'.
MODIFY itab_lvc FROM wa_lvc.
ENDLOOP.
WRITE 😕 'after'.
WRITE 😕 '----
'.
LOOP AT itab_lvc INTO wa_lvc.
WRITE 😕 wa_lvc-row_pos,wa_lvc-col_pos,wa_lvc-fieldname,wa_lvc-edit_mask.
ENDLOOP.
Thanks,
Madhu
‎2008 Jan 24 2:42 PM
‎2008 Apr 17 8:30 AM
I'm trying to use CL_GUI_ALV_GRID and it gives me some inconsistencies in java gui. So I have searched oss for notes and I have found
Note 695910 - ALV grid: Editable grid and non-released methods
that says:
"all methods that are related to editability of the ALV grid are not released for customer software developments"
Does that means that we can "play" with editable CL_GUI_ALV_GRID but we have no support for it?
Does anyone knows if that note still apply?
Many thanks,
Lorenzo
‎2015 Apr 07 7:05 PM
Hi Lorenzo,
did you ever find an answer to your question?
I found the same note when researching an issue with my editable ALV which started after we applied new service pack.
Regards,
Mahesh
‎2008 Apr 17 8:38 AM