2009 Mar 17 5:31 AM
Hi Experts,
I have a requirement where in I need to remove a field on the display screen for a particular record.
In detail..
I have a created a module pool program where in the final out put was shown using CL_gui_alv_grid on the new screen.The normal display will start with a check box(editable),kunnr,ktokd etc..The requirement is for a particular ktokd(9009 or 1001) the check box should either disappear or disable.Please help me out in achieving this.Thanks in advance.
With Regards,
Srini...
Hi Experts,
I have a requirement where in I need to remove a field on the display screen for a particular record.
In detail..
I have a created a module pool program where in the final out put was shown using CL_gui_alv_grid on the new screen.The normal display will start with a check box(editable),kunnr,ktokd etc..The requirement is for a particular ktokd(9009 or 1001) the check box should either disappear or disable.Please help me out in achieving this.Thanks in advance.
With Regards,
Srini...
2009 Mar 17 5:34 AM
2009 Mar 17 5:41 AM
Hi,
You can do like this:
DATA ls_listrow LIKE LINE OF i_list . " i_list is ur final int table
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
LOOP AT i_list INTO ls_listrow .
IF ls_listrow-ktokd = '9009' or ls_listrow-ktokd = '1001' .
ls_stylerow-fieldname = 'CHECKBOX' . " 'CHECKBOX' --> field name u've given to checkbox field
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled .
APPEND ls_stylerow TO lt_styletab .
ENDIF .
INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles .
MODIFY i_list FROM ls_listrow .
ENDLOOP .i hope this fulfills ur requirement...
regards,
Neha
2009 Mar 17 5:46 AM
Hi Lakshman and Neha,
I appreciate your immediate response.I think my issue is fixed.Thanks a lot.
With Regards,
Srini...
2009 Mar 17 5:53 AM
2009 Mar 17 5:52 AM
Hi,
NOTE: Please dont confuse with gt_style table, & structure in gt_soitems internal table.
While populating ALV layout use the STYLE name as below...
Declare data:
* Itab to display data in ALV
DATA: BEGIN OF gt_soitems OCCURS 0,
--------------------application data fields
gt_style TYPE lvc_t_styl, " To make editable
END OF gt_soitems.
* Structures / Table for ALV styles
DATA: gs_soitems LIKE gt_soitems, " Sales Order line items
gs_style TYPE lvc_s_styl, " Style - Stucture
gt_style TYPE lvc_t_styl. " Style - Table
Populate ALV Layout:
*-Populate ALV layout
gs_layout-zebra = gc_x. " Zebra print
gs_layout-no_author = gc_x. " No Author
gs_layout-no_rowmark = gc_x. " Hide row selection
gs_layout-stylefname = 'GT_STYLE'. " Style
gs_layout-CWIDTH_OPT = 'X'.
*-Disable - FIELD1
gs_style-style = cl_gui_alv_grid=>mc_style_disabled.
gs_style-fieldname = 'FIELD1'.
APPEND gs_style TO gt_style.
gs_soitems-gt_style = gt_style.
MODIFY gt_soitems INDEX lv_index FROM gs_soitems
TRANSPORTING gt_style disable.
Regards,
~Satya
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |