‎2009 Oct 15 10:27 AM
Dear Gurus , I made a custom screen that has 3 texteditor controls .
The screen works fine but the one problem that i have is the below :
I have 2 kind of users: Full user - Particiopant user.
When i load the screen at the first time all the controls are editable .
When i choose the the participant user i want the texteditor controls to be in readonly mode.
So i do the following :
IF PARTICIPANTS = 'X'.
CALL METHOD G_EDITOR_1->SET_READONLY_MODE
EXPORTING
READONLY_MODE = '1'
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
INVALID_PARAMETER = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.when i change the user to full can't change !!!!!!
Look the problem in steps:
1. load the screen in editable mode
2. changing the controls to readonly ok
3. changing to editble false
Only one time i can change the screen control !!!!
look my code ...
IF G_EDITOR_1 IS INITIAL.
G_REPID = SY-REPID.
CREATE OBJECT G_EDITOR_CONTAINER_1
EXPORTING
CONTAINER_NAME = 'TEXTEDITOR1'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
IF SY-SUBRC NE 0.
ENDIF.
CREATE OBJECT G_EDITOR_1
EXPORTING
PARENT = G_EDITOR_CONTAINER_1
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
WORDWRAP_POSITION = 65
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
TITEL = G_REPID
TXT2 = SPACE
TXT1 = TEXT-001.
ENDIF.
‎2009 Oct 22 2:04 PM
Perhaps you should try to explicitly set the readonly mode back to false in the PBO routine which currently turns readonly mode on.
IF PARTICIPANTS = 'X'.
CALL METHOD G_EDITOR_1->SET_READONLY_MODE
EXPORTING
READONLY_MODE = '1'
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
INVALID_PARAMETER = 2
OTHERS = 3.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
else.
CALL METHOD G_EDITOR_1->SET_READONLY_MODE
EXPORTING
READONLY_MODE = CL_GUI_TEXTEDIT=>FALSE
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
INVALID_PARAMETER = 2
OTHERS = 3.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.
‎2009 Oct 15 11:01 AM
Hi,
So your problem is that initially the text editors are editable. Thats working fine.
When you select Participant its become read only - Working fine.
But when you select Full its does not change?
Please clarify as your question is not clear.
Thanks,
Harini
‎2009 Oct 22 2:04 PM
Perhaps you should try to explicitly set the readonly mode back to false in the PBO routine which currently turns readonly mode on.
IF PARTICIPANTS = 'X'.
CALL METHOD G_EDITOR_1->SET_READONLY_MODE
EXPORTING
READONLY_MODE = '1'
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
INVALID_PARAMETER = 2
OTHERS = 3.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
else.
CALL METHOD G_EDITOR_1->SET_READONLY_MODE
EXPORTING
READONLY_MODE = CL_GUI_TEXTEDIT=>FALSE
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
INVALID_PARAMETER = 2
OTHERS = 3.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif.