02-02-2005 8:58 AM
Hi, I have a problem with C_TEXTEDIT_CONTROL interface.
I have to maintain a Function Module that displays a TEXT EDIT CONTROL in a popup. One parameter of this FM is MAX_NUMBER_CHARS that is passed to the control in the constructor method.
This parameter pretends to lock the maximum quantity of characters written in the popup. Its set to 255 characters.
At first, when user writes his commentary with 255 ch (yeah, he writes till the end) everything works ok; but after that, when he tries to visualize his commentary, nothing appears in the control, although the commentary is passed correctly to the control via set_text_as_r3table method.
I have done some tests, and sawn in Debugger Time that if I change the parameter MAX_NUMBER_CHARS to 265 when the commentary length is 255, the control displays the text.
Does anyone know what happens or what Im doing wrong?
02-02-2005 2:03 PM
02-02-2005 2:34 PM
"Hmmm....seems to me that you have found your problem."
Wow.... amazing response. O_o
Of course I have to limit input text, it's a requirement, and C_TEXTEDIT_CONTROL, and also CL_GUI_TEXT_EDITOR, allows it.
The problem is, why it's not working?!
02-02-2005 2:45 PM
02-02-2005 2:50 PM
I just written a quick & dirty to test this out. I have set my text editor to 20 max characters, I does limit my entry to the 20 characters, when setting it, it shows my 20 characters. In debug, if I change the max characters to 19, then the text no longer shows. In your case you put in 255 and expect to get out 255 when the max characters is set to 255, and you are not, right?
Would you be able to post your code?
Regards,
Rich Heilman
02-02-2005 3:06 PM
Yeah, that's it.
Here is the code:
EDITOR is declared as follows
data: editor type ref to c_textedit_control .
Here I'm trying to create the Obj. and gv_length is set to 255.
create object editor
exporting
repid = repid
dynnr = '0100'
dynpro_container = 'TEXTEDITOR1'
max_number_chars = gv_length
exceptions
others = 1.
In the next code, I pretend to pass the TEXT written by user.
call method editor->set_text_as_r3table
exporting
table = mytable
exceptions
error_dp = 1
error_dp_create = 2
others = 3
There are more lines of code, but they are not relevant to this problem.
At first, the user can write a comment with 255 characters, but I'm not able to show this same comment although mytable is fulfilled.
Thx
02-02-2005 3:16 PM
02-02-2005 4:04 PM
Its counting the CR as part of the text. You can see this by using the method get_text_as_stream. The CR are the "##" This explains why I need 14 more characters for the text to show. I had 8 lines of 20 with CR at the end of the first 7. Not sure how you are suppose to get around this.
Regards,
Rich Heilman
02-03-2005 8:34 AM
But I think this is not the problem.
I you retrieves the information with editor->get_text_as_r3table method, the CR doesn't appears; and if you check the length of the table, is the correct length (in my case 255).
I was looking into OSS but I saw nothing, I'll try posting a SAP OSS Note.
If I have some answer I'll post it here.
Thx
03-07-2005 10:14 AM
The problem is solved with <b>SAPGui's patch 52</b>.
Thanks to all.
02-02-2005 4:10 PM
Hi.
Ive been looking in to this and as you both can see is very strange.
If its very important you should post a message to SAP to see if it might be an error they can solve.
I've been looking into notes to see if any solves it but no god luck...
If you find a solution please post it... I'm also interested.
Kind Regards.
Jorge Balart.