You are on page 1of 5

SAP GUI: SAP Screen Personas - How to

replace the old style text editor


Posted by Tamas Hoznek Mar 3, 2015
In several transactions, if a long text is maintained, there is a choice between a simplified MS Word editor and
the old school, SAPscript style editor. Certainly most people will want to go with the easier-to-use Word-like
editor. However the trouble is that if the transaction is running via Personas (or the webgui for that matter), then
we are presented with the rather awkward SAPscript editor:

In the following, I will show a potential workaround to get something that's a little better. It will still not be the
Word-style editor, because that relies on OLE when using the SAP GUI and this is not available in Personas
or the webgui. Instead, it is possible to call a text editor control which is supported in Personas or the webgui
and allows automatic word wrapping, copy/paste and better usability than the line editor above. It will look
something like this:

Generated by Jive on 2015-09-03+02:00


1

SAP GUI: SAP Screen Personas - How to replace the old style text editor

It is possible to display this control in a popup window shown above or in full screen mode as well. To get this
working, it requires some backend ABAP coding and an enhancement implementation. If this is an acceptable
compromise, the below solution may be useful.
In all the cases when I faced this problem, I found that the same function module gets called in the backend.
It is called FULL_SCREEN_NEW. So my example will work with this function module but some transactions
may use a different function module to call the text editor. Still, the same principle should apply there too, so
this solution can then be adapted to those function modules.
When the text editor is called, the FULL_SCREEN_NEW function module will verify if Word is enabled and if it
isn't, it falls back to the old editor. This happens in line 172:

Screen 1100 will call the ugly editor, so we want to avoid this. Now, we could do a core modification and
replace this CALL SCREEN statement with an INCLUDE containing the code to call something else instead,
but such modifications are usually frowned upon, due to company policies prohibiting modifications.
To get around this issue, we can use an implicit enhancement at the beginning of the above function module.
With the enhancement point, we will essentially replace the complete code of the function module with
a slightly enhanced code, containing our logic to call the text edit control and any additional necessary
functionality. The standard code is thus retained and for a non-ITS processing (like the regular SAP GUI dialog
mode) it works exactly the same way like before. However when the ITS is in use, we will insert our enhanced
code in place of SCREEN 1100 and call a new function module we create. This new function module will take
care of calling the text editor control and write back the changed text into the standard data structures, so for
the subsequent standard code the result will be as if we had processed the text via screen 1100.

Generated by Jive on 2015-09-03+02:00


2

SAP GUI: SAP Screen Personas - How to replace the old style text editor

The attached file contains the changed code of function module FULL_SCREEN_NEW, so the enhancement
can be copied directly from this. It also has the complete code for the new, control-based text editor function
module as part of function group Z_PERS_GLOBAL, plus screen shots of the related GUI statuses for fullscreen and pop-up window mode.
Since the forum software doesn't allow ZIP files to be attached, you'll have to remove the .TEXT extension from
the file name in the archive to get the original ZIP file.
It is important to mention though that in case the function module FULL_SCREEN_NEW is changed by SAP,
the enhancement should be adapted to reflect the changes in the standard code.
This method actually also helps in Personas 3.0 although there we have much more freedom due to the
JavaScript-based scripting engine which could call a text edit control and feed the text into the backend line
editor. Going the route in this post may however be simpler than writing the script necessary for that. On the flip
side, the scripted way would eliminate the need for backend ABAP coding and ultimately is the better solution.
(122.4 K)
914 Views Tags: text_editor, personas

Tamas Hoznek in response to Mohsin Iqbal on page 3


Aug 27, 2015 6:25 PM
The above method should work if the transaction is run via the webgui as well. Personas sessions are seen by
the backend as webgui sessions when the decision is made about the editor.
Mohsin Iqbal in response to Tamas Hoznek on page 3
Aug 27, 2015 10:06 AM
Tamas,
Thank you very much for such a helpful post. Just a question. One of our clients is not using Personas due to
EHP4/NW7. They are interested to remove the default line editor in WebGUI with something more simpler like
notepad. We have done this in SAPGUI by disabling "SAPScript" & "Smart Forms" options using functional
module RSCPSETEDITOR.
Would appreciate if you could suggest a way to do it in WebGUI also (i-e disable line editor with a simple
notepad like large text field).
Tamas Hoznek in response to Saud Bhoira on page 3
Aug 17, 2015 6:40 PM
Hi Saud,

Thanks for the feedback! I'm glad the code helped you
Cheers,
Tamas.

Generated by Jive on 2015-09-03+02:00


3

SAP GUI: SAP Screen Personas - How to replace the old style text editor

Saud Bhoira
Aug 17, 2015 1:39 PM
Tamas, thank you very, very much for this! Your code worked like a gem! Made my own changes to make the
editor look cool. Thanks!
Gabriela de Pompignan in response to Tamas Hoznek on page 4
May 12, 2015 8:26 PM
Tamas, I have good and bad news.
I removed your enhancement and the text still won't save when in creation mode.
So, there is not a problem with your code.
But there is a problem with Personas, or my flavor at least. It does work when in Basic Mode. It also works if I
remove the Tab Caching...
The text has to be saved regardless of the enhancement, naturally.
Thanks,
Gabriela
Tamas Hoznek in response to Gabriela de Pompignan on page 4
May 12, 2015 5:29 PM
Since this solution involves an enhancement and it is not part of the standard functionality, you cannot open an
OSS incident about it. There is no official support for this workaround.
I will try to find some time to investigate where the mentioned flag can be set but I cannot promise a deadline
when I will get to it.
Gabriela de Pompignan in response to Tamas Hoznek on page 5
May 12, 2015 3:04 PM
Hi Tamas, we are actually approaching a go-live date with our Personas implementation, I'm wondering if this
would be a case for opening an OSS incident with SAP as a more proper channel for prioritizing this issue?
Thanks again for all your help.
Gabriela
Gabriela de Pompignan in response to Tamas Hoznek on page 5
May 8, 2015 9:25 PM
Yes, if you look at the code below, called upon saving a new notification in QM01, the flag indtx (line 1873) is
checked when executing via standard QM01 transaction, but when via Personas it's not; which causes the text
header to not be updated with the new notification number.
Hope it makes sense.
And thank you for asking.

Generated by Jive on 2015-09-03+02:00


4

SAP GUI: SAP Screen Personas - How to replace the old style text editor

Tamas Hoznek in response to Gabriela de Pompignan on page 5


May 8, 2015 8:54 PM
Hi Gabriela,
If you have a problem with a flag not being properly set, then this is probably caused by a bug in my code. I'd
have to implement this enhancement in one of our systems again and test to see what can cause this.
You mentioned "a flag" - do you know which flag is it?
Gabriela de Pompignan
May 7, 2015 7:15 PM
hi Tamas, thanks so much for that, it solved a big problem we had with a QM01 flavor.
I have a question: there seems to be a problem when you save a text before saving the document (say in
QM01 as opposed to QM02), where internally a flag is not set in Personas, and when you save the document
the text header is not updated with the document number, if that makes sense - so when you open it in
QM02/03 you can't see the long text anymore. Have you seen this problem happen and would you know what
to do to fix it?
Thanks.
Bhaskar B
Mar 5, 2015 7:02 PM
this is a great fix indeed. Thanks

Generated by Jive on 2015-09-03+02:00


5

You might also like