‎2005 Dec 20 10:03 AM
Hello
I'm working with the CL_GUI_TEXTEDIT control for displaying/changing text.
The text is set via the method
set_text_as_r3table.
After setting the text I would like to format it by indenting individual lines.
To indent the lines I use the method indent_lines in the way:
CALL METHOD edit->indent_lines
EXPORTING
from_line = 1
to_line = 1.Now the issue is as follows.
I start the application and create the control. Then I set the text in the control
via
SET_TEXT_AS_R3TABLEand do the indenting.
The result is
(
Ite m 1
AC E 5.4 & TAO 1. 4
AN D
Item 2
SA P
....
After the next PAI, PBO cycle (i.e. refilling the control again with
SET_TEXT_AS_R3TABLEand
redoing the indenting the result is:
(
Item 1 (indented twice)
ACE 5.4 & TAO 1.4 (indented 3time)
AND (indented one time)
Item 2 (indented twice)
....
(unfortunetaly the indenting is lost in this tool as well, I tried to make it clear by the comments in brackets, sorry)
And this is what I would have expected also after the start at the first display.
So I've no clue what happens at the first time. I tried to fix the issue to add
CL_GUI_CFW=>flushcalls, to position the cursor with
set_selection_pos_in_lineor with
edit->auto_redraw. No change.
Any ideas to solve the issue are welcome.
Many thanks and regards
Hans-Ludwig
‎2005 Dec 20 10:21 AM
Hi Hans-Ludwig ,
I tried with the standard program which SAP is providing for the scenario what you described, it is working fine. Please check this Program.<b>SAPTEXTEDIT_TEST_EVENTS</b>
Also Check the Help Here. <a href="here .http://help.sap.com/saphelp_erp2005/helpdata/en/eb/549e36cf0ecb7de10000009b38f889/frameset.htm">here .http://help.sap.com/saphelp_erp2005/helpdata/en/eb/549e36cf0ecb7de10000009b38f889/frameset.htm</a>
Hope This Info Helps YOU.
<i>Reward Points If It Helps YOU.</i>
Regards,
Raghav
‎2005 Dec 20 10:27 AM
Hi,
thanks for your quick reply.
Unfortunetaly the example does not help me, since the control is already displayed. I had also a look into the
SAPTEXTEDIT_TEST_2 program. Of course here the indenting works also.
My issue is that I need to load the coding from DB and do the indenting and get it displayed at the first time indented, and this 'at first time indented' I do not get working. But it must be possible to do somehow, since the ABAP editor does the same, doesn't it?
‎2005 Dec 20 12:40 PM
Hi,
I think it does not work for the first time around as the control has not been sent to frontend yet.
Try using the following method after SET_TEXT_AS_R3TABLE
and before edit->indent_lines call,
CALL METHOD cl_gui_cfw=>flush.
Hope this helps..
Sri
‎2005 Dec 20 1:03 PM
Hi, thank you again.
I tryed that one also already. It does not solve the issue.
I results in even more spaces :
with flush
(
I t e m 1
AC E 5 . 4 & T A O 1 . 4
AND
Item 2
SAP R/3 ENTERPRISE 47X200 - SAP R/3 Enterprise Server
)
without flush
(
Ite m 1
AC E 5.4 & TA O 1. 4
AND
‎2005 Dec 20 2:47 PM
Hi,
It just occured to me. Are you calling method set_readonly_mode before indent_lines to disable the editor?
If that is the case then try calling,
set_readonly_mode after indent_lines if possible
or
first call,
set_readonly_mode with readonly_mode = false
and then call,
indent_lines
and then again,
set_readonly_mode with readonly_mode = true.
Hope this helps..
Sri
‎2005 Dec 21 7:43 AM
That is exactly what I'm already doing. Also an additional set_readonly_mode with readonly_mode = false and set_readonly_mode with readonly_mode = true does not do a change.