2008 Feb 07 3:04 PM
Hi everybody
The new cl_salv_table class is fine for a lot of things but it definitely needs EDIT type of functionality -- doesn't need a huge amount but the user should be able to edit individual cell(s) and insert / delete lines as with the current cl_gui_alv_grid.
To show SAP that this function is needed just postunder this a single line Agree.
If enough replies come back I'm sure SAP will consider this in future.
I'd love to do a Poll but this Forum doesn't seem to have that facility available.
Cheers
jimbo
2008 Feb 12 4:49 PM
We need this definately !
Currently I'm using *alv for editable tables and *salv for view tables, that's not satisfactorily.
Furthermore the *alv API disagrees with the modern *salv OO concept.
Hope SAP will implement the edit issue in *salv !
Regards
Olaf
2008 Jul 24 4:31 PM
Add me to this list. I can't believe they didn't provide this. I just found out about this issue today from one of our developers who was using the old grid (reuse_alv) because of this issue.
Since all of our employees went to the new grid (cl_salv) class and don't know the old grid other than from examples, now we've got an issue because we stated up front to all of our contractors that only the new grid was to be used.
I know what SAP is going to say - use a dialog - that's a major pain compared to the old grid way. And now I've got a standards issue on my hands - oh what fun.
2008 Jul 24 4:36 PM
I'm in.
>And now I've got a standards issue on my hands - oh what fun.
I love standards. So many to choose from...
matt
2008 Jul 25 10:55 AM
2008 Jul 25 4:08 PM
Count me in. I haven't used this new ALV OM a lot yet, but I've discovered this edit mode lack yesterday on a thread while searching for another functionality.
I just couldn't believe it. What would happen if you develop a fairly complicated program using CL_SALV* classes and then the user requests to "just add editing capability on this field and we're done" (which is quite common)? Half of the program would have to be redone using CL_GUI_ALV_GRID?
2008 Jul 30 10:02 PM
I've tried a bit of "Old Fashioned" Hacking --- hope the US military are not reading this or I might be extradited to the US to serve 50 years in jail for "Terrorism" (referring to what the US are attempting to do to one of our UK citizens at the moment).
Inheriting the the cl_salv class doesn't actually help as this cl_salv_class makes calls all over the place and by the time you are done you are better off using the cl_gui_alv_grid anyway.
I certainly can understand the concept of making a quick easy callable ALV display has attractions but as people have posted users often want an "Editable" facility after a report has been designed.
I'm actually surprised this wasn't built in to the factory model.
Cheers
jimbo.
2008 Aug 27 10:39 AM
Oh yes, there should definitely be an editing function!
BR Jörg
2008 Aug 29 10:32 AM
Yeah
I too join the group, It's very much appreciated if edit option is incorporated!
Regards,
Ravi
2009 Mar 04 7:28 AM
Hello Everybody,
I am also facing the same problem , so include me also.
Thanks,
Pavan.
2009 Mar 04 10:33 AM
2009 Mar 04 1:30 PM
Before starting the poll, have look at this work around:
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12187
Regards,
Naimesh Patel
2009 Apr 20 1:20 PM
I am happy about the work-around. But I still think it should be available from cl_salv_table without that. It's annoying that SAP seems to have abandoned OO ALV in favor of webdynpro.
2009 Oct 28 10:10 AM
Hi there
I'm still amazed this hasn't YET been done.
Actually Web Dynpro won't replace this functionality yet -- there's a big difference in running web dynpro and an OO report from a bog standard R/3 system.
Also -FM REUSE people
Don't use that -- use cl_gui_alv_grid -- this is fully OO and does have edit capability -- bit complex but does have it.
You can also run it in batch so there's absolutely NO NEED to use the old FM any more.
cheers
jimbo
2009 Oct 29 8:41 AM
>
> Hi there
> I'm still amazed this hasn't YET been done.
> Actually Web Dynpro won't replace this functionality yet -- there's a big difference in running web dynpro and an OO report from a bog standard R/3 system.
>
> Also -FM REUSE people
>
> Don't use that -- use cl_gui_alv_grid -- this is fully OO and does have edit capability -- bit complex but does have it.
>
> You can also run it in batch so there's absolutely NO NEED to use the old FM any more.
>
> cheers
> jimbo
only problem is dat cl_gui_alv_grid doesn't have full screen mode. I started to investigate a new OO standard for the reuse_alv a few years ago but got stuck in the 2 classes cl_gui_alv_grid and cl_salv_table which both had major incapabilities compared to reuse_alv.
http://forums.sdn.sap.com/thread.jspa?threadID=301620
it's already complex enough to set up and understand 1 standard way of programming ALV lists editable or not. so It's not feasible to do a lot of investigation in setting up a standard for 1 class while you know that 1/3 of the z programms require the other class which require an equal amount of investigation and testing.
with the function GUI_UPLOAD they make a method 1-1 also called GUI_UPLOAD in CL_GUI_FRONTEND_SERVICES
which just calls the old function. so from now on I can easily use the method instead of the function.
why is that not done with the reuse_alv ?
Edited by: A. de Smidt on Oct 29, 2009 9:53 AM
2009 Nov 10 4:32 PM
Hi there
this is a COMMON misconception - you CAN use the WHOLE screen in cl_gui_alv_grid.
Don't define a CUSTOM container - just use a docking container.
This gives you a FULL SCREEN.
If you need to split then use splitting control (continer).
(The CODE directive in the forum doesn't seem to work any more as I only get PLAIN TEXT input options.)
Cheers
jimbo
2011 Dec 13 11:16 PM
I also tried this workaround, but it is still quite complicated...
there is another way to get acces to this functionality,
by using function module GET_GLOBALS_FROM_SLVC_FULLSCR
to get the reference to CL_GUI_ALV_GRID
In this example you just have to enter in the command field:
%_EDIT_ALL - to set the whole ALV editable
or
%_EDIT_[FIELDNAME] - to set only one column editable
in addition i added a check, so this is only available on NON-productive systems
*&---------------------------------------------------------------------*
*& Report ZTEST_ALV_EDITABLE
*&
*&---------------------------------------------------------------------*
REPORT ztest_alv_editable.
*----------------------------------------------------------------------*
* CLASS lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
on_user_command
FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function,
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed sender.
ENDCLASS. "lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_report DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_report DEFINITION.
PUBLIC SECTION.
DATA: gt_tab TYPE REF TO data,
gr_alv TYPE REF TO cl_salv_table.
METHODS: constructor,
show_alv.
ENDCLASS. "lcl_report DEFINITION
PARAMETERS: p_table TYPE tabname.
DATA: lr_report TYPE REF TO lcl_report.
START-OF-SELECTION.
CREATE OBJECT lr_report.
lr_report->show_alv( ).
*----------------------------------------------------------------------*
* CLASS lcl_report IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_report IMPLEMENTATION.
METHOD constructor.
FIELD-SYMBOLS: <lt_tab> TYPE ANY TABLE.
CREATE DATA gt_tab TYPE TABLE OF (p_table).
ASSIGN gt_tab->* TO <lt_tab>.
SELECT * FROM (p_table) INTO TABLE <lt_tab>.
ENDMETHOD. "constructor
METHOD show_alv.
DATA: lr_func TYPE REF TO cl_salv_functions_list,
lr_events TYPE REF TO cl_salv_events_table,
lr_handler TYPE REF TO lcl_event_handler.
FIELD-SYMBOLS: <lt_tab> TYPE ANY TABLE.
ASSIGN gt_tab->* TO <lt_tab>.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = gr_alv
CHANGING
t_table = <lt_tab> ).
CATCH cx_salv_msg.
ENDTRY.
lr_func = gr_alv->get_functions( ).
lr_func->set_all( 'X' ).
lr_events = gr_alv->get_event( ).
CREATE OBJECT lr_handler.
SET HANDLER lr_handler->on_user_command FOR lr_events.
gr_alv->display( ).
ENDMETHOD. "show_alv
ENDCLASS. "lcl_report IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_user_command.
DATA: lr_grid TYPE REF TO cl_gui_alv_grid,
lv_layout TYPE lvc_s_layo,
lt_fieldcat TYPE lvc_t_fcat,
lr_grid_events TYPE REF TO lcl_event_handler,
lv_fieldname TYPE lvc_fname.
FIELD-SYMBOLS: <ls_fieldcat> LIKE LINE OF lt_fieldcat.
CALL FUNCTION 'PRGN_CHECK_SYSTEM_PRODUCTIVE'
EXCEPTIONS
client_is_productive = 1
OTHERS = 2.
IF sy-subrc NE 1.
IF e_salv_function(7) EQ '%_EDIT_'.
IF e_salv_function NE '%_EDIT_ALL'.
lv_fieldname = e_salv_function+7.
ELSE.
CLEAR lv_fieldname.
ENDIF.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lr_grid.
CALL METHOD lr_grid->get_frontend_layout
IMPORTING
es_layout = lv_layout.
IF lv_fieldname IS NOT INITIAL.
lr_grid->get_backend_fieldcatalog(
IMPORTING et_fieldcatalog = lt_fieldcat ).
READ TABLE lt_fieldcat ASSIGNING <ls_fieldcat>
WITH KEY fieldname = lv_fieldname.
IF <ls_fieldcat> IS NOT ASSIGNED.
MESSAGE w398(00)
WITH 'Fieldname'
lv_fieldname
'does not exist'.
EXIT.
ENDIF.
IF <ls_fieldcat>-edit = 'X'.
lv_layout-no_toolbar = abap_true.
<ls_fieldcat>-edit = abap_false.
ELSE.
lv_layout-no_toolbar = abap_false.
<ls_fieldcat>-edit = abap_true.
ENDIF.
lr_grid->set_frontend_fieldcatalog(
EXPORTING it_fieldcatalog = lt_fieldcat ).
ELSE.
IF lv_layout-edit = abap_true.
CLEAR lv_layout-edit.
ELSE.
lv_layout-edit = abap_true.
ENDIF.
ENDIF.
CALL METHOD lr_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CREATE OBJECT lr_grid_events.
SET HANDLER lr_grid_events->handle_data_changed FOR lr_grid.
CALL METHOD lr_grid->set_frontend_layout
EXPORTING
is_layout = lv_layout.
CALL METHOD lr_grid->refresh_table_display( ).
ENDIF.
ENDIF.
ENDMETHOD. "on_user_command
Edited by: Jakob Simon Mainka on Dec 14, 2011 12:17 AM
2011 Dec 15 8:30 AM
can you perhaps split the code blocks into several blocks, above a certain amount of characters code blocks are scrambled since they don't want you to copy past complete programs here on sdn
kind regards
arthur
2011 Dec 21 2:29 PM
&----
*& Report ZTEST_ALV_EDITABLE
*&
&----
REPORT ztest_alv_editable.
----
CLASS lcl_event_handler DEFINITION
----
*
----
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
on_user_command
FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function,
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed sender.
ENDCLASS. "lcl_event_handler DEFINITION
----
CLASS lcl_report DEFINITION
----
*
----
CLASS lcl_report DEFINITION.
PUBLIC SECTION.
DATA: gt_tab TYPE REF TO data,
gr_alv TYPE REF TO cl_salv_table.
METHODS: constructor,
show_alv.
ENDCLASS. "lcl_report DEFINITION
PARAMETERS: p_table TYPE tabname.
DATA: lr_report TYPE REF TO lcl_report.
START-OF-SELECTION.
CREATE OBJECT lr_report.
lr_report->show_alv( ).
----
CLASS lcl_report IMPLEMENTATION
----
*
----
CLASS lcl_report IMPLEMENTATION.
METHOD constructor.
FIELD-SYMBOLS: <lt_tab> TYPE ANY TABLE.
CREATE DATA gt_tab TYPE TABLE OF (p_table).
ASSIGN gt_tab->* TO <lt_tab>.
SELECT * FROM (p_table) INTO TABLE <lt_tab>.
ENDMETHOD. "constructor
METHOD show_alv.
DATA: lr_func TYPE REF TO cl_salv_functions_list,
lr_events TYPE REF TO cl_salv_events_table,
lr_handler TYPE REF TO lcl_event_handler.
FIELD-SYMBOLS: <lt_tab> TYPE ANY TABLE.
ASSIGN gt_tab->* TO <lt_tab>.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = gr_alv
CHANGING
t_table = <lt_tab> ).
CATCH cx_salv_msg.
ENDTRY.
lr_func = gr_alv->get_functions( ).
lr_func->set_all( 'X' ).
lr_events = gr_alv->get_event( ).
CREATE OBJECT lr_handler.
SET HANDLER lr_handler->on_user_command FOR lr_events.
gr_alv->display( ).
ENDMETHOD. "show_alv
ENDCLASS. "lcl_report IMPLEMENTATION
----
CLASS lcl_event_handler IMPLEMENTATION
----
*
----
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_user_command.
DATA: lr_grid TYPE REF TO cl_gui_alv_grid,
lv_layout TYPE lvc_s_layo,
lt_fieldcat TYPE lvc_t_fcat,
lr_grid_events TYPE REF TO lcl_event_handler,
lv_fieldname TYPE lvc_fname.
FIELD-SYMBOLS: <ls_fieldcat> LIKE LINE OF lt_fieldcat.
CALL FUNCTION 'PRGN_CHECK_SYSTEM_PRODUCTIVE'
EXCEPTIONS
client_is_productive = 1
OTHERS = 2.
IF sy-subrc NE 1.
IF e_salv_function(7) EQ '%_EDIT_'.
IF e_salv_function NE '%_EDIT_ALL'.
lv_fieldname = e_salv_function+7.
ELSE.
CLEAR lv_fieldname.
ENDIF.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lr_grid.
CALL METHOD lr_grid->get_frontend_layout
IMPORTING
es_layout = lv_layout.
IF lv_fieldname IS NOT INITIAL.
lr_grid->get_backend_fieldcatalog(
IMPORTING et_fieldcatalog = lt_fieldcat ).
READ TABLE lt_fieldcat ASSIGNING <ls_fieldcat>
WITH KEY fieldname = lv_fieldname.
IF <ls_fieldcat> IS NOT ASSIGNED.
MESSAGE w398(00)
WITH 'Fieldname'
lv_fieldname
'does not exist'.
EXIT.
ENDIF.
IF <ls_fieldcat>-edit = 'X'.
lv_layout-no_toolbar = abap_true.
<ls_fieldcat>-edit = abap_false.
ELSE.
lv_layout-no_toolbar = abap_false.
<ls_fieldcat>-edit = abap_true.
ENDIF.
lr_grid->set_frontend_fieldcatalog(
EXPORTING it_fieldcatalog = lt_fieldcat ).
ELSE.
IF lv_layout-edit = abap_true.
CLEAR lv_layout-edit.
ELSE.
lv_layout-edit = abap_true.
ENDIF.
ENDIF.
CALL METHOD lr_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CREATE OBJECT lr_grid_events.
SET HANDLER lr_grid_events->handle_data_changed FOR lr_grid.
CALL METHOD lr_grid->set_frontend_layout
EXPORTING
is_layout = lv_layout.
CALL METHOD lr_grid->refresh_table_display( ).
ENDIF.
ENDIF.
ENDMETHOD. "on_user_command
2011 Dec 22 8:19 AM
2009 Apr 22 12:31 PM
Even i like the workaround I too think that there should be and "offical" (and supportet) way of makin an SALV Grid editable
2009 Apr 26 12:17 PM
2009 Aug 14 1:34 PM
2009 Oct 13 10:40 AM
Hi Flavio,
Do you mean the ALV editable functionality is now available in CL_SALV_TABLE? If yes, can you explain which method you used?
Cheers,
Jodie
2009 Oct 13 12:54 PM
2009 Oct 16 11:21 AM
To be fair, the V stands for Viewer, not Editor (cos that would make it ALE and confusing ). SAP should never have opened the original viewer code up for editing.
2009 Oct 21 8:20 AM
so in that case if V stands for viewing there must come an class
CL_SALE_TABLE for the editing which inherits all the methods from CL_SALV_TABLE.
question remains the same. we also stick to reuse_alv since the class is not complete with the edit mode.
kind regards
arthur
2009 Oct 22 8:35 AM
2009 Oct 29 5:23 PM
Count me in.
Edited by: Shanmugam Maheswaran on Oct 29, 2009 6:23 PM
2009 Nov 02 9:42 AM
Add me to the Group too guys. I had to convince our guys a lot to get back to cl_alv_grid instead cl_salv_table for edit purposes.
Regards
2009 Nov 17 7:58 PM
Count me in!
Containers aren't supported in batch mode (someone always requests their reports in background), and i'm getting tired of the REUSE function, this needs to be incorporated into this new architecture.
2009 Nov 18 7:05 AM
I totally agree that ALV OM should have support for Editable content in the ALV. I have used the new model which is really nice and easy to understand, i just don't understand why the editing functionality is not supported. I haven't looked at the work around solution that was suggested here but i hope that i don't have to use the old classes since i never worked with them.
2009 Dec 08 4:11 AM
Hi,
I also tried finding the editing function but was not able to find anything.
I strongly support you in this. Lets see if SAP does something about it.
Regards,
Manish Kumar
2009 Dec 16 4:59 PM
I agree.
I'd rather SAP supplied and supported a well-documented solution. Using workarounds like the one Naimesh Patel has blogged about is probably not supported by SAP.
Regards,
Paul
2010 Jan 05 12:28 PM
2010 Jan 05 12:46 PM
2010 Jan 29 9:42 PM
Yes, very annoying. Someone should come up with a solution to this!
2010 Jan 05 1:11 PM
2010 Jan 05 1:20 PM
2010 Feb 01 3:29 PM