http://scn.sap.com/message/8424824
TextEdit UI for Long Text
Hi,
I have binded a TextEdit to a String Table. The purpose is to be able to save this texts as a Standard Text in the system. Noticed that it can only be appended as a new line in the String Table when user hits enter while entering the text.
Problem is, if the user keeps on entering texts without hitting enter, and there are >255 chars, the remainder texts will be truncated.
Is there anyway we can obtain the full text that are >255 chars entered by user, if he does not hit enter?
hi ,
to save the text use the FMs SWA_STRING_SPLIT ( String needs to be split into multiple lines of characters )
and SAVE_TEXT
I guess the following piece of code wud help
DATA lo_node TYPE REF TO if_wd_context_node. DATA lo_element TYPE REF TO if_wd_context_element. DATA ls_text TYPE if_main=>element_text_editor. DATA lv_string TYPE string. DATA lt_str_comp TYPE TABLE OF swastrtab. DATA ls_str_comp TYPE swastrtab. DATA lt_lines TYPE TABLE OF tline. DATA ls_tline TYPE tline. DATA ls_header TYPE thead. lo_node = wd_context->get_child_node( name = 'TEXT_EDITOR' ). lo_element = lo_node->get_element( ). lo_element->get_static_attributes( IMPORTING static_attributes = ls_text ). LOOP AT ls_text-text INTO lv_string. * String needs to be split into multiple lines of characters * of length 132 each to be passed to SAVE_TEXT FM. CALL FUNCTION 'SWA_STRING_SPLIT' EXPORTING input_string = lv_string max_component_length = 132 TABLES string_components = lt_str_comp EXCEPTIONS max_component_length_invalid = 1 OTHERS = 2. LOOP AT lt_str_comp INTO ls_str_comp. IF sy-tabix EQ 1. ls_tline-tdformat = '*'. ELSE. CLEAR ls_tline-tdformat. ENDIF. ls_tline-tdline = ls_str_comp-str. APPEND ls_tline TO lt_lines. CLEAR ls_tline. ENDLOOP. CLEAR lt_str_comp[]. ENDLOOP.