Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CL_GUI_TEXTEDIT refresh problem - Updated

Former Member
0 Likes
1,208

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.

1 ACCEPTED SOLUTION
Read only

paul_abrahamson_sap
Active Participant
0 Likes
601

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.

2 REPLIES 2
Read only

Former Member
0 Likes
601

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

Read only

paul_abrahamson_sap
Active Participant
0 Likes
602

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.