안녕하세요.
>> 우선 다음과 같은 코드가 들어가면 되구요.
data: lr_column type ref to cl_salv_column.
lr_column = l_value->if_salv_wd_column_settings~get_column( 'BUKRS' ).
lr_column->set_visible( cl_wd_uielement=>e_visible-none ).
lr_column = l_value->if_salv_wd_column_settings~get_column( 'BELNR' ).
lr_column->set_visible( cl_wd_uielement=>e_visible-none ).
lr_column = l_value->if_salv_wd_column_settings~get_column( 'CURRENCY' ).
lr_column->set_visible( cl_wd_uielement=>e_visible-none ).
>> 저는 다음처럼 해서 씁니다.
data: lt_fieldname type table of zfis0010,
ls_fieldname type zfis0010.
ls_fieldname-fieldname = 'BUKRS'. append ls_fieldname to lt_fieldname.
ls_fieldname-fieldname = 'BELNR'. append ls_fieldname to lt_fieldname.
ls_fieldname-fieldname = 'CURRENCY'. append ls_fieldname to lt_fieldname.
zficl_utility=>set_column_visible(
exporting
pt_fieldname = lt_fieldname
p_status = cl_wd_uielement=>e_visible-none
changing
prl_value = l_value ).
>> static method는 다음과 같습니다.
method set_column_visible.
data: lt_fieldname type table of zfis0010,
lr_column type ref to cl_salv_wd_column,
wa_fieldname type zfis0010.
lt_fieldname[] = pt_fieldname.
loop at lt_fieldname into wa_fieldname.
lr_column = prl_value->if_salv_wd_column_settings~get_column( wa_fieldname-fieldname ).
lr_column->set_visible( p_status ).
endloop.
endmethod.
>> field가 아주아주 많을 경우에는 일일이 나열하기 힘들기 때문에 다음처럼 할 수도 있습니다.
data: lt_columns type salv_wd_t_column_ref,
ls_column type salv_wd_s_column_ref.
lt_columns = lr_column_settings->get_columns( ).
loop at lt_columns into ls_column.
case ls_column-id.
when 'BUKRS' or 'BELNR'.
when 'CURRENCY'.
when others.
endcase.
endloop.
wda로 많이 개발하시는가보네요~