on 04-06-2006 12:46 PM
Hi,
will u please tell me how to use protected method of class in application. (class:cl_gui_textcontrol, method:limit_text)
Thanks in advance,
Praba.
Hi,
I donot know the feasibility here but in such cases u can inherit that class into a custom class where u can write ur own method and in that method u can call the protected method.
Please let us know the requirement.
Regards,
ND
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabha,
You can set the maximum number of characters in a textedit control in the CREATE OBJECT statement itself.
Just see the first parameter in the method . I mean MAX_NUMBER_CHARS. Just set that value to the required number.
Eg:
data: edit type ref to CL_GUI_TEXTEDIT.
create object edit
exporting
MAX_NUMBER_CHARS = 10
STYLE = 0
WORDWRAP_MODE = WORDWRAP_AT_WINDOWBORDER
WORDWRAP_POSITION = -1
WORDWRAP_TO_LINEBREAK_MODE = FALSE
FILEDROP_MODE = DROPFILE_EVENT_OFF
parent = OBJ_CUSTOM_CONTAINER
LIFETIME =
NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5
others = 6
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
In this case, the max: number of characters will be set to 10.
I hope your query is solved.
Regards,
SP.
Hi Friends,
Can u please explain what is the use of the class CL_GUI_TEXTEDIT. I tried to find the doucmentation of this class. But I could not succeed. If anybody know it please explain.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabha,
Which version you are using? I don't think there is a class called CL_GUI_TEXTCONTROL till 4.7 Enterprise Edition.
So I suppose you are talking about CL_GUI_TEXTEDIT.
Protected components of a class can be accessed by instance of that class and all the subclasses of that class. So I think you have to create a new class whose superclass is CL_GUI_TEXTEDIT.
Then make the instance of the newly created class and access the protected members of the class.
Regards,
Sylendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
u can call ur protected method from ur class or its subclass.
if you wanna call from outside that is from a other class then declare it in <b>PUBLIC SECTION</b>.
Cheers,
Abdul Hakim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
make it a public method. protected methods are not callable from outside. Thats why they are protected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prabhavathi,
The PROTECTED method cannot be access inside a program. That is why it has been defined as PROTECTED.
If you want to use that, you will define a SUB Class for that and use it inside that.
Regards,
Ravi
Note : Please mark the helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.