Skip to Content
author's profile photo Former Member
Former Member

Specific cell Editable , Cl_gui_alv_grid

i have created a alv grid.

to display the confirmations of operations in prod order.

i have selected cells which are to be marked as non editable.

becoz these operations does not exist in routing of

that prod order material.


1.PNG (48.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2013 at 08:37 AM

    Hi Abhishek,

    You mean conditional editing.

    Create an extra field in your internal table.

    DATA: celltab TYPE lvc_t_styl.


    Now declare a table.

    DATA: lt_celltab TYPE lvc_t_styl,

    ls_celltab TYPE line of lvc_t_styl.


    Now Loop on your itab and make the value of this field based on condition.

    ls_celltab-fieldname = 'FIELDNAME of field to be disbaled'.

    IF prd_status EQ 'CONFIRMED'.

    ls_celltab-mode = cl_gui_alv_grid=>mc_style_enabled. "to enable the required fields

    ELSE.

    ls_celltab-mode = cl_gui_alv_grid=>mc_style_disabled.

    ENDIF.

    INSERT ls_celltab INTO TABLE lt_celltab.

    Continue this for all the fields

    Finally

    INSERT LINES OF lt_celltab INTO TABLE wa_tab-celltab.

    MODIFY itab FROM wa_tab INDEX l_index.

    clear lt_celltab.


    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      May I add that you need to add the field name "CELLTAB"

      in the layout parameter:

      DATA: ob_gui_alv_grid_1 TYPE REF TO cl_gui_alv_grid .


      CONSTANTS: gc_styl_fname TYPE lvc_ctfnm VALUE 'CELLTAB' ,

      DATA: st_layout TYPE lvc_s_layo .

      st_layout-stylefname = gc_styl_fname .

      CALL METHOD ob_gui_alv_grid_1->set_table_for_first_display
      EXPORTING
      is_layout = st_layout


      Regards.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2013 at 09:45 AM

    THANKS 😊

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.