cancel
Showing results for 
Search instead for 
Did you mean: 

Remove a blank columm from the ALV grid

Former Member
0 Kudos

hello all,

How to remove a blank columm from the ALV grid..

With Regard,

PARUL

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi parul,

sorry for late reply but i jus want to tell you that log_handle is nothing but the attribute name. so replace the 'LOG_HANDLE' with your attribute name what ever you have created in the context menu or the attribute name of the column which is binded.

eg : ihave created an attribute A B C and i wanted to hide A then use the code whatever i have given previous by replacing Log_handle with 'A'

Sathish

Answers (2)

Answers (2)

Former Member
0 Kudos

not working

Former Member
0 Kudos

Hi,

DATA lr_column TYPE REF TO cl_salv_wd_column.

if column is empty (check by some condition).........

lr_column = lv_value->if_salv_wd_column_settings~get_column( 'LOG_HANDLE' ).

CALL METHOD lr_column->set_visible

EXPORTING

value = '01'.

endif.

sathish

Former Member
0 Kudos

thanks...

bt i want to ask one more thing... becouse i m new in ABAP.

so please can you tell me what is " lv_value" and "( 'LOG_HANDLE' )."

in the given statement :=>

lr_column = lv_value>if_salv_wd_column_settings~get_column

( 'LOG_HANDLE' ).

Former Member
0 Kudos

hi,

i want to add one thing regarding this thread. we are binding an internal table to the alv.

so after we have done the binding, the we have to run this code.

Thanks,

Ritwik.

Former Member
0 Kudos

till now i m unable to run this code... can any body help me out

Former Member
0 Kudos

Hi parul,

I've just posted a possible solution in the thread:

Just check it, it may help.

BR,

Peter

Former Member
0 Kudos

hi parul,

In init method

first check the columns that r empty .

then u add the code given by satish.

before init method is executed ,u must have data in the internal table. then it will be available in init method.

Regards,

janakiram.

Former Member
0 Kudos

sorry bt till nw i m unable to do that....

i did like this :

DATA: lr_column TYPE REF TO cl_salv_wd_column.

then

FORM blank_cell USING p_i_heading.

IF lr_column IS INITIAL.

lr_column = lv_value->if_salv_wd_column_settings~get_column( 'LOG_HANDLE' ).

CALL METHOD lr_column->set_visible

EXPORTING

value = '01'.

ENDIF.

ENDFORM.

here the error is :

Field "LR_COLUMN" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . .

please tell me what is : lv_value and 'LOG_HANDLE'

in this code.

Former Member
0 Kudos

'LOG_HANDLE' technical name of the column in the table.

Former Member
0 Kudos

what abt LV_VALUE

Former Member
0 Kudos

lv_value is of type cl_salv_wd_config_table

lv_value = lo_ref_interface_controller->get_model( ).

this method will return the model instance of the alv.

Former Member
0 Kudos

still not able to perform...

please correct me...

FORM blank_cell USING p_i_heading.

  • lv_value = wdyn_interface_controller_name->get_model( ).

IF i_display2-v1_ktp IS NOT INITIAL.

lr_column = lv_value->if_salv_wd_column_settings~get_column( 'v1_ktp' ).

CALL METHOD lr_column->set_visible

EXPORTING

value = '01'.

ENDIF.

ENDFORM.

where i_display2 is internal table from which check field v1_ktp should be initial.

Former Member
0 Kudos

The table u r passing to alv has to be checked whether it has any empty colums.

only those columns has to be set invisible.

Logic for checking empty columns

u define one structure with flags. for each column in the data table u have to define one flag in the structure.

suppose my table is having columns A B C

then i will define structure

types begin of str_flags,

A_f type c ,

B_f type c,

C_f type c,

end of str_flags.

loop on the internal table and check each column whether it is empty or not

if it is not empty set the flag as 'X'.

finally after the end of loop u will come to know which columns r empty.

Regards,

janakiram.

Former Member
0 Kudos

thanks alt...

but still i m unable to do that