Hi Thomas!
Thanks for the reply, really appreciate it.
Unfortunately, We already tried that procedure but it does not work...
The functionality where the standard text showing up in the text box works for us before the upgrade.
We had our system upgraded recently which caused this the standard text to disappear in the text box.
I tried tinkering with the codes and i was able to pull up the standard text from the SO10. -> (i celebrated with a beer when the standard text showed up in the textbox)
But the problem now is that when i press "save", the edited standard text (yes, the user will edit the textbox with the standard text in it) is not saved in the logs -> only the bare standard text is saved and appended in the logs.
Here is what i did so far:
1. I redefined class CL_SRQM_NOT_TEXTVIEW_IMPL method CHECK_CREATE_BTTEXT
2. the codes in red is the one i added, i included some part of the codes from the method for reference purposes to where you are in the code.
* creation logic is in on_new_focus of BTText node
* Add the new item to the collection
IF new_entity_x IS BOUND.
** Set the focus
current_x ?= new_entity_x.
* Set the text profile
current_x->set_property(
iv_attr_name = 'TDOBJECT' "#EC NOTEXT
iv_value = lv_text_obj_x ).
current_x->set_property_as_string(
iv_attr_name = 'TDSPRAS' "#EC NOTEXT
iv_value = new_tdspras_x ).
current_x->set_property_as_string(
iv_attr_name = 'TDID' "#EC NOTEXT
iv_value = new_tdid_x ).
**** LRON START NOV 19 2014
* new_entity_x->deactivate_sending( ).
* typed_context->bttext->collection_wrapper->add( iv_entity = new_entity_x
* iv_set_focus = abap_true ).
TYPES: text_line(132) TYPE c.
DATA: ls_attr TYPE crmst_text_btil,
lt_text_table TYPE TABLE OF text_line,
lt_itf_text TYPE comt_text_lines_t,
lv_string TYPE string,
lv_str TYPE string,
lv_blanks TYPE i.
FIELD-SYMBOLS: <str> TYPE text_line.
*****************************************************************************************
** GET THE TEMPLATE!
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'ST'
LANGUAGE = 'E'
NAME = 'ZST_ZTCASE'
OBJECT = 'TEXT'
TABLES
LINES = lt_itf_text
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF SY-SUBRC = 0.
* Implement suitable error handling here
CALL FUNCTION 'CONVERT_ITF_TO_STREAM_TEXT'
EXPORTING
language = 'E'
TABLES
itf_text = lt_itf_text
text_stream = lt_text_table.
LOOP AT lt_text_table ASSIGNING <str>.
* this crude logig has to be implemented since abap cuts off
* blanks at the end of a string
MOVE <str> TO lv_str.
SHIFT lv_str BY lv_blanks PLACES RIGHT.
CONCATENATE lv_string lv_str INTO lv_string.
lv_blanks = 132 - STRLEN( <str> ).
ENDLOOP.
ls_attr-conc_lines = lv_string. "CONCLINES!!!!!
* Fill out the concatenated formated text lines field ---
ls_attr-conc_formatted_lines = cl_gstext_tools=>transform_itf_to_itfstring( lt_itf_text ). "FORMATTED-CONCLINES!!!!!!
IF sy-subrc = 0.
IF new_tdid_x = 'ZTEM'.
current_x->set_property_as_string(
iv_attr_name = 'CONC_LINES' "#EC NOTEXT
iv_value = ls_attr-conc_lines ).
current_x->set_property_as_string(
iv_attr_name = 'CONC_FORMATTED_LINES' "#EC NOTEXT
iv_value = ls_attr-conc_formatted_lines ).
new_entity_x->deactivate_sending( ).
typed_context->bttext->collection_wrapper->add( iv_entity = new_entity_x
iv_set_focus = abap_true ).
else.
new_entity_x->deactivate_sending( ).
typed_context->bttext->collection_wrapper->add( iv_entity = new_entity_x
iv_set_focus = abap_true ).
ENDIF.
ENDIF.
ENDIF.
**** LRONEND NOV 19 2014
typed_context->bttext->collection_wrapper->publish_current( ).
ENDIF.
ENDIF.
gv_prev_changeable = lv_changeable_x.
Any thoughts?
Thank you very much!