fidley / falv

FALV - Fast ALV Grid
https://abapblog.com
GNU General Public License v3.0
141 stars 52 forks source link

Set Fixed Header Text is not working #73

Closed aditya-deloitte closed 2 years ago

aditya-deloitte commented 2 years ago

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( ) ) ) ).
fidley commented 2 years ago

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

fidley commented 2 years ago

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

aditya-deloitte commented 2 years ago

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?

fidley commented 2 years ago

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.

aditya-deloitte commented 2 years ago

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