Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Centering Commentary OO

Hi,

I am using ABAP OO to Write and ALV header list. How do we center the commentary written above?

*Write Header Commentary
DATA :
l_oref_grid TYPE REF TO cl_salv_form_layout_grid.

* Add text items for top of page
*CREATE OBJECT l_oref_grid.

perform get_coaddr changing l_tmpstr.
l_oref_grid->create_text(
row = 1 column = 1 text = l_tmpstr ).

l_tmpstr = TEXT-003.
l_oref_grid->create_text(
row = 2 column = 1 text = l_tmpstr ).

How do I modify the elements written to center it instead of the default Left-aligned?

replied

Hello Mizan

Perhaps the following approach might work:

DATA: lo_column     TYPE REF TO CL_SALV_FORM_GRID_COLUMN.

  lo_column = l_oref_grid->get_column( column = 1 ).

  CALL METHOD lo_column->set_h_align
    EXPORTING
      value = IF_SALV_FORM_C_H_ALIGN=>CENTER.

Regards

Uwe

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question