Is there a way to prevent an instance of CL_SALV_TABLE
from removing leading spaces in the display?
I have the following piece of code in which I put a single space in front of Master
text and two spaces in front of Slave
text.
REPORT zzy.
CLASS lcl_main DEFINITION FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS:
main.
ENDCLASS.
CLASS lcl_main IMPLEMENTATION.
METHOD main.
TYPES: BEGIN OF l_tys_test,
name TYPE string,
value TYPE i,
END OF l_tys_test,
l_tyt_test TYPE STANDARD TABLE OF l_tys_test WITH EMPTY KEY.
DATA(lt_test) = VALUE l_tyt_test(
( name = `Root` value = 0 )
( name = ` Master` value = 1 )
( name = ` Slave` value = 2 )
).
cl_salv_table=>factory(
IMPORTING
r_salv_table = DATA(lo_salv_table)
CHANGING
t_table = lt_test
).
lo_salv_table->display( ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
lcl_main=>main( ).
Unfortunately the leading spaces get trimmed in the view.
In this tutorial the guy seems to have made it somehow.
Yes, there is:
lo_salv_table->get_columns( )->get_column( 'NAME' )->set_leading_spaces( abap_true ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With