report demo_show_text.
class demo definition.
public section.
class-methods main.
endclass.
class demo implementation.
method main.
data: text type ref to cl_demo_text,
text_table type cl_demo_text=>t_text,
text_line type cl_demo_text=>t_line.
text = cl_demo_text=>get_handle( ).
text_line = 'First line of text'.
text->add_line( text_line ).
text->add_line( ' ' ).
do 10 times.
clear text_line.
text_line(3) = sy-index.
text_line = |Table line { text_line }|.
append text_line to text_table.
enddo.
text->add_table( text_table ).
text->add_line( ' ' ).
text_line = 'Last line of text'.
text->add_line( text_line ).
text->display( ).
text->delete( ).
text->add_line( 'New text' ).
text->display( ).
endmethod.
endclass.
start-of-selection.
demo=>main( ).
阅读(847) | 评论(0) | 转发(0) |