Recently I received an Email from Marco Nickel pertaining to a past weblog I had done on BSP Developer’s Journal Part XVI – Using the BTF Editor. Marco was looking for a BTF example that wasn’t implemented in Model View Controller. Quite frankly I haven’t coded much that wasn’t MVC in quite some time. Let’s hope my Non MVC BSP programming skills aren’t quite as rusty as my German is.
event handler for data retrieval
****If we don’t have any data coming in from a previous event,
****then we want to initialize it with some default text.
****This could also be some code to load text from the database.
IF s_documentdata-btf_doc IS INITIAL.
DATA: text(25) TYPE c.
DATA: l_text TYPE xstring.
text = ‘This is test text’.
event handler for checking and processing user input and
for defining navigation
****Perform this code before we handle any events. Regardless of the event,
****we have to bring the editor content back in to keep it.
Read data from editor:
DATA: editor TYPE REF TO cl_btf_bsp_editor.
editor ?= cl_btf_bsp_manager=>get_data( request = request
name = ‘editor’
id = ‘btf1’ ).
IF editor IS NOT INITIAL.
s_documentdata-btf_doc = editor->document.
I hope that this little example has been a useful addition to the content that already exists on BTF. At the very least it might be the starting point for further questions.