Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8623

Re: hi experts how to edit a particular cell(field ) in alv report in abap

$
0
0

hi,

 

if u want to edit a particular cell u can acheive through oops abap . here the piece of code try it

 

FORM fill_celltab USING value(p_mode)

CHANGING pt_celltab TYPE lvc_t_styl.

  DATA: ls_celltab TYPE lvc_s_styl,

  l_mode TYPE raw4.

* This forms sets the style of column 'PRICE' editable

* according to 'p_mode' and the rest to read only either way.

  IF p_mode EQ 'RW'.

*§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell

* to status "editable".

    l_mode = cl_gui_alv_grid=>mc_style_enabled.

  ELSE. "p_mode eq 'RO'

*§2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell

*to status "non-editable".

    l_mode = cl_gui_alv_grid=>mc_style_disabled.

  ENDIF.

  ls_celltab-fieldname = 'CARRID'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'CONNID'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'FLDATE'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'PRICE'.

  ls_celltab-style = l_mode.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'CURRENCY'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'PLANETYPE'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'SEATSMAX'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'SEATSOCC'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

  ls_celltab-fieldname = 'PAYMENTSUM'.

  ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

  INSERTls_celltab INTOTABLEpt_celltab.

ENDFORM. " FILL_CELLTAB

*&---------------------------------------------------------------------*

*& Form SWITCH_EDIT_MODE

*&---------------------------------------------------------------------*

FORM switch_edit_mode.

  IF grid1->is_ready_for_input( ) EQ 0.

* set edit enabled cells ready for input

    CALL METHOD grid1->set_ready_for_input

      EXPORTING

        i_ready_for_input = 1.

  ELSE.

* lock edit enabled cells against input

    CALL METHOD grid1->set_ready_for_input

      EXPORTING

        i_ready_for_input = 0.

  ENDIF.

ENDFORM. "SWITCH_EDIT_MODE


Viewing all articles
Browse latest Browse all 8623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>