Application Development and Automation 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: 
Read only

Remove field in Alv grid module pool

Former Member
0 Likes
818

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...

5 REPLIES 5
Read only

Former Member
0 Likes
785

Hi Srini,

Chk this links.Using conditions we can set the display

Try using this function module.'REUSE_ALV_HIERSEQ_LIST_DISPLAY'.

Hope it will be useful.

Regards,

Lakshman.

Edited by: Lakshman N on Mar 17, 2009 6:38 AM

Read only

Former Member
0 Likes
785

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

Read only

0 Likes
785

Hi Lakshman and Neha,

I appreciate your immediate response.I think my issue is fixed.Thanks a lot.

With Regards,

Srini...

Read only

0 Likes
785

Sorry I was late....

Read only

Former Member
0 Likes
785

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