Skip to Content

Gray out of ALV report after call screen

Hi All,

I am using REUSE_ALV_GRID_DISPLAY to display number of document. After click one document it open a screen where user can provide input by using call screen. I need to gray out that particular row after user save in secondary screen in ALV report.

Thanks,

Sunil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2013 at 07:02 PM

    Hi Sunil,

    You can use the method: cl_gui_alv_grid=>mc_style_disabled.

    Please read the below links;

    http://wiki.sdn.sap.com/wiki/display/Snippets/Disable+or+Enable+Input+fields+Conditionally+In+ALV

    Hope this will help you 😊

    Thanks & Regards

    😉

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2013 at 07:33 PM

    Check if it is saved using SY_SUBRC Check, then based on the condition call the below statements

    
    

    DATA: v_fld_dischn TYPE slis_fieldname

    t_editcell TYPE lvc_t_styl,

    s_editcell TYPE lvc_s_styl.

    s_editcell-fieldname = v_fldname.

    s_editcell-style = cl_gui_alv_grid=>mc_style_disabled.

    INSERT s_editcell INTO TABLE t_editcell.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2013 at 07:52 AM

    For making a row editble or non editable, you need to include one more column in the input table.

    data : begin of it_out,

    field1,

    field2,

    ......,

    ......,

    field_style TYPE lvc_t_styl,

    end of it_out.

    Whichever field you want to edit and disable editing, that field edit attribute must be set in the field catalog.

    wa_fieldcat-fieldname = 'BELNR

    wa_fieldcat-scrtext_m = 'Doc No'.

    wa_fieldcat-edit *= 'X'. "*sets whole column to be editable

    wa_fieldcat-col_pos = 7.

    wa_fieldcat-outputlen = 15.

    APPEND wa_fieldcat TO it_fieldcat.

    CLEAR wa_fieldcat.

    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    case r_ucomm.

    when 'SAVE'.

    Now after saving data in secondary code, add the following code.

    DATA ls_stylerow TYPE lvc_s_styl .

    DATA lt_styletab TYPE lvc_t_s

    if sy-subrc = 0 . "Document number is saved.

    read table it_out into wa_out where belnr = "saved document number.

    ls_stylerow-fieldname = 'BELNR' .

    ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.

    "set field to disabled

    APPEND ls_stylerow TO ls_style-field_style.

    MODIFY it_out FROM wa_out.

    endif.

    RS_SELFIELD-REFRESH = 'X'. "Refresh ALV.

    Now the document number would be non-editable for documents already saved.

    Your requirement can also be acheived though the following logic.

    Add an extra column save_flag in your output tab for the first ALV screen.

    data : begin of it_data,

    field1,

    field2,

    ......,

    ......,

    save_flag type c,

    end of it_data.

    FORM user_command USING r_ucomm LIKE sy-ucomm

    rs_selfield TYPE slis_selfield.

    case 'EDIT'

    READ TABLE it_data INTO wa_data INDEX rs_selfield-tabindex.

    if wa_data-save_flag is initial.

    CALL 200 . "Secondary screen.

    * if document saved is successful

    wa_data-save_flag = 'X'.

    modify it_data from wa_data .

    * endif.

    endif.

    RS_SELFIELD-REFRESH = 'X'. "Refresh ALV.

    In this case, the secondary screen will be called for inputting data only for documents not already saved.

    Regards,

    Susmitha

    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.