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: 

cl_salv_table - How to set column editable/input

Former Member
0 Kudos
26,775

Hi All,

I am using the class "cl_salv_table" on display an ALV grid. (Factory method)

How can I set the only one column of report to input/editing? 

same as slis_layout_alv-edit parameter   use in the REUSE_ALV_GRID_DISPLAY function.

Is the any method/class on factory method by which this requirement can be possible.

Please suggest.

Thanks,

Shrinivas

Moderator Message: Please search for available content before posting your question.

Message was edited by: Suhas Saha

6 REPLIES 6

Former Member
0 Kudos
3,825

former_member300076
Participant
0 Kudos
3,825

Hi,

Please use ALV Grid to set column as editable and not SALV.

In the field catalog of the ALV Grid you have a field 'EDIT' to put to 'X' if you want your column to be editable.

Regards

Sam

Former Member
0 Kudos
3,825

Refer the below link:

http://scn.sap.com/thread/1217035

Thanks

Akankshi

Rambabu_Botsa
Explorer
0 Kudos
3,825

0 Kudos
3,825

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 !

Sergiu
Contributor
0 Kudos
3,825

This code worked for me.

https://sapcodes.com/2019/12/11/custom-button-select-all-deselect-all-and-filter-option-in-oops-alv-....

I added code for Variant Layout.


*<<< added code
DATA  gv_variant          LIKE disvariant.
DATA  gv_repname          LIKE sy-repid.
INITIALIZATION.
  gv_repname = sy-repid.
  gv_variant-report = gv_repname.
*<<< added code

*...

      CALL METHOD gr_alv->set_table_for_first_display
        EXPORTING
          is_variant                     = gv_variant " added code
          i_save                        = 'A' 
          is_layout                     = gw_layout
          it_toolbar_excluding          = gt_exclude
        CHANGING
          it_outtab                     = gt_sflight
          it_fieldcatalog               = gt_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.

I added code for Search Help.

FORM f_fcat USING p_pos
* ...
*<<< added code
IF p_fname = 'CARRID'.
gw_fcat-edit = abap_true.
gw_fcat-ref_table = 'SCARR'.
gw_fcat-domname = 'CARRID'.
endif.
*>>> added code

APPEND gw_fcat TO gt_fcat.
CLEAR : gw_fcat.
ENDFORM.<br>