fidley/falv

Set Fixed Header Text is not working

Closed this issue · 5 comments

Hi,
When setting the Long Text from Data Element as Fixed Header text via code:
O_FALV->COLUMN( DFIES-FIELDNAME )->SET_COLDDICTXT( 'L' ).
It does not work.
Whereas doing the same in SALV works
O_ALV->GET_COLUMNS( )->GET_COLUMN( DFIES-FIELDNAME )->SET_FIXED_HEADER_TEXT( 'L' ).

Update:
Came up with this workaround for now:

DATA(O_COLUMN) = O_FALV->COLUMN( DFIES-FIELDNAME ).
O_COLUMN->SET_OUTPUTLEN( CONV #( STRLEN( O_COLUMN->GET_SCRTEXT_L( ) ) ) ).

Hello @aditya-deloitte ,

sorry for long waiting for the answer but I was on holidays. Can you tell me if with
O_FALV->COLUMN( DFIES-FIELDNAME )->SET_COLDDICTXT( 'L' ).
you wanted to set the 'L' as header of the column or you wanted to set the column header from long description of the field?

Cheers
Łukasz

With your workaround you just changing the width of the column, so in this case also header is adjusted to the long one.
DATA(O_COLUMN) = O_FALV->COLUMN( DFIES-FIELDNAME ).
O_COLUMN->SET_OUTPUTLEN( CONV #( STRLEN( O_COLUMN->GET_SCRTEXT_L( ) ) ) ).

Hello @aditya-deloitte ,

sorry for long waiting for the answer but I was on holidays. Can you tell me if with O_FALV->COLUMN( DFIES-FIELDNAME )->SET_COLDDICTXT( 'L' ). you wanted to set the 'L' as header of the column or you wanted to set the column header from long description of the field?

Cheers Łukasz

Yes I wanted the long description from the data element of the field.
By using the workaround, I changed the output length of the field, which in turn displayed the long description.
Just wanted to confirm, is there another or a better way to do this like in CL_SALV_TABLE?

As far as I remember there is no standard way for that on ALV grid, so the way you did it is quite good. Other would be to replace heading in the REPTEXT field of the generated fieldcatalog, this also might have work, but I personally think, that your way is good.

Thank you Lukasz for your help and validation!
Closing the issue now.