cancel
Showing results for 
Search instead for 
Did you mean: 

Line-logging and protected text on custom control, protect_lines

Former Member
0 Kudos

I have a module pool with various screens which contain texts. Because of other requirements, it was necessary to create custom controls which show those texts as a sort of preview pane, that it, a white box which shows the text and allows one to enter new text. Now the customer would like the text to have log lines and have it be protected. That is to say, once you enter a text and save your work, both the log line and the new text are preserved and grayed-out allowing only new lines to be entered - you can't go back and change old lines. Research I've done in the past leads me to believe that using the method protect_lines in the C_TEXTEDIT_CONTROL class is the way to go. However, I have been having all kinds of trouble with it. Are there examples which show how to use this? For example, how do I put a protected log line in the white box, allow the customer to add a new line, protect that line on save and, at the same time, if they don't enter a new line, don't save the log line?

I've mostly accomplished the above, however, the following still eludes me:

I have used CL_GUI_TEXTEDIT class to create a custom control for text entry. I am using the PROTECT_LINES method to afix a date/time stamp and then make it non-editable. The problem is, when I am in the editable area and I hit back-arrow until the cursor jumps up to the end of the protected date/time stamp, when I begin typing again, it pulls the last part of the protected text down into the editable area. For example, if your protected text ends in a phone number, say "555-1212", after back-arrowing up to the end of it and beginning to type again, the "1212" will be down in the editable area and will be changeable. Can anyone tell me what I am doing wrong?

Edited by: Buckman Michael on Dec 3, 2008 6:37 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Further research has led me to believe that the PROTECT_SELECTION method solves this problem. Specifically, if you look at include file LIQS0F50 at about line 1065 you can see how QM01/QM02 handles this on screen 7710 of SAPLIQS0 when you have line-logging turned on.