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

Any function module for calling a text editor in subscreen?

Former Member
0 Likes
6,083

Hi,

I would like to know if there is any function module that can be used to call a text/note editor and can be displayed in a subscreen of a main screen (dialog programming)? This text/note editor should not be able to edit, but for display only.

Please help. Thanks...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,204

check this fm TERM_CONTROL_EDIT & TXW_TEXTNOTE_EDIT

Edited by: Kartik Tarla on Apr 15, 2009 12:07 PM

20 REPLIES 20
Read only

former_member194669
Active Contributor
0 Likes
3,204

This message was moderated.

Read only

Former Member
0 Likes
3,204

Hi,

Simplest would be:

DATA: objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,

*

  • Just populate your data in objtxt & use:

EDITOR-CALL FOR objtxt DISPLAY-MODE.

I hope this helps,

Regards

Raju Chitale

Read only

0 Likes
3,204

Hi Raju,

I tried using the codes, but is it possible not to have it in full screen?

Many thanks,

Chuak Fen

Edited by: Chuak Fen Soo on Apr 15, 2009 3:07 PM

Read only

0 Likes
3,204

Hi,

Then its better to use TXW_TEXTNOTE_EDIT with EDIT_MODE = ' '.

Regards

Raju Chitale

Read only

Former Member
0 Likes
3,205

check this fm TERM_CONTROL_EDIT & TXW_TEXTNOTE_EDIT

Edited by: Kartik Tarla on Apr 15, 2009 12:07 PM

Read only

Former Member
0 Likes
3,204

hi,

try this...

CATSXT_SIMPLE_TEXT_EDITOR

hope this helps

Regards

Ritesh J

Read only

0 Likes
3,204

Hi all,

Thanks for all your replies.

I have tried using the FM TERM_CONTROL_EDIT, FM TXW_TEXTNOTE_EDIT and FM CATSXT_SIMPLE_TEXT_EDITOR, but these will pop up the text/note editor window, right?

Read only

former_member182371
Active Contributor
0 Likes
3,204

Hi,

have a look at function group MR1M dynpro 6160.

Here you´ll find an example.

It is the "Notes" tab in header of MIRO transaction

within the above code, for "display only" have a look at:


    CALL METHOD editor->set_readonly_mode
         EXPORTING readonly_mode = 1.

Best regards

Edited by: Pablo Casamayor on Apr 15, 2009 4:07 PM

Read only

0 Likes
3,204

> Hi,

>

> have a look at function group MR1M dynpro 6160.

> Here you´ll find an example.

> It is the "Notes" tab in header of MIRO transaction

>

> within the above code, for "display only" have a look at:

>


>     CALL METHOD editor->set_readonly_mode
>          EXPORTING readonly_mode = 1.
> 

>

> Best regards

>

> Edited by: Pablo Casamayor on Apr 15, 2009 4:07 PM

Hi Pablo,

The class used here is C_TEXTEDIT_CONTROL and i find it almost suits my requirements. Same as the class for CL_GUI_TEXTEDIT, they both have the same methods.

So, for now, by using either the C_TEXTEDIT_CONTROL class or CL_GUI_TEXTEDIT class, i would like to highlight certain words with certain string pattern in the text editor. i tried using the methods FIND_AND_SELECT_TEXT and HIGHLIGHT_SELECTION but to no luck. Maybe I am not coding it correctly.

  DATA: v_string_found TYPE I.

   EDITOR3->FIND_AND_SELECT_TEXT(
     EXPORTING
       CASE_SENSITIVE_MODE    = 1
       SEARCH_STRING          = '<H>'
*       WHOLE_WORD_MODE        = FALSE
     CHANGING
       STRING_FOUND           = v_string_found
*     EXCEPTIONS
*       ERROR_CNTL_CALL_METHOD = 1
*       INVALID_PARAMETER      = 2
          ).
   IF SY-SUBRC <> 0.
*    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.

   EDITOR3->HIGHLIGHT_SELECTION(
     EXPORTING
       HIGHLIGHT_MODE         = 1
*      EXCEPTIONS
*        HAS_NO_EFFECT          = 1
*        ERROR_CNTL_CALL_METHOD = 2
*        INVALID_PARAMETER      = 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.

Any guides for using these 2 methods?

Thanks...

Read only

0 Likes
3,204

Hi,

maybe this can help:

check program SAPTEXTEDIT_TEST_1

in this program pay attention to:


MODULE pai INPUT.

  CASE ok_code.
....
    WHEN 'FIND'.
      PERFORM find_text.
....
    WHEN 'HIGHLIGHT'.
      highlight = 1.
      PERFORM highlight_lines USING highlight.



*&---------------------------------------------------------------------*
*&      Form  FIND_TEXT
*&---------------------------------------------------------------------*
FORM find_text.
  found = 0.
  IF case_sensitive = 'X'.             " button on Dynpro
    case_sensitive_mode = editor->true.
  ELSE.
    case_sensitive_mode = editor->false.
  ENDIF.
  IF whole_word = 'X'.                 " button on Dynpro
    whole_word_mode = editor->true.
  ELSE.
    whole_word_mode = editor->false.
  ENDIF.

  CALL METHOD editor->find_and_select_text
               EXPORTING search_string = search_string
                         case_sensitive_mode = case_sensitive_mode
                         whole_word_mode = whole_word_mode
               CHANGING string_found = found.
* Flush for proper work of the following if statement
  CALL METHOD cl_gui_cfw=>flush.
  IF NOT search_string IS INITIAL.
    IF found NE 0.
      MESSAGE s000 WITH text-013.
    ELSE.
      MESSAGE s000 WITH text-014.
    ENDIF.
  ENDIF.
ENDFORM.                               " FIND_TEXT

*&---------------------------------------------------------------------*
*&      Form  HIGHLIGHT_LINES
*&---------------------------------------------------------------------*
*      -->P_HIGHLIGHT  text                                            *
*----------------------------------------------------------------------*
FORM highlight_lines USING    p_highlight.
  IF selection EQ 'X'.
    CALL METHOD editor->highlight_selection
         EXPORTING highlight_mode = p_highlight
         EXCEPTIONS has_no_effect = 1.
    IF sy-subrc NE 0.
*      add your handling
    ENDIF.
  ELSE.
    CALL METHOD editor->highlight_lines
         EXPORTING
                 from_line = from_line
                 to_line = to_line
                 highlight_mode = p_highlight
         EXCEPTIONS has_no_effect = 1.
    IF sy-subrc NE 0.
*      add your handling
    ENDIF.
  ENDIF.

ENDFORM.                               " HIGHLIGHT_LINES

and this link:

http://help.sap.com/saphelp_45b/helpdata/EN/0e/514035634d761fe10000009b38f889/frameset.htm

Best regards.

Edited by: Pablo Casamayor on Apr 17, 2009 9:19 AM

Read only

0 Likes
3,204

>

> Hi,

>

> maybe this can help:

>

> check program SAPTEXTEDIT_TEST_1

> in this program pay attention to:

>

>


> MODULE pai INPUT.
> 
>   CASE ok_code.
> ....
>     WHEN 'FIND'.
>       PERFORM find_text.
> ....
>     WHEN 'HIGHLIGHT'.
>       highlight = 1.
>       PERFORM highlight_lines USING highlight.
> 
> 
> 
> *&---------------------------------------------------------------------*
> *&      Form  FIND_TEXT
> *&---------------------------------------------------------------------*
> FORM find_text.
>   found = 0.
>   IF case_sensitive = 'X'.             " button on Dynpro
>     case_sensitive_mode = editor->true.
>   ELSE.
>     case_sensitive_mode = editor->false.
>   ENDIF.
>   IF whole_word = 'X'.                 " button on Dynpro
>     whole_word_mode = editor->true.
>   ELSE.
>     whole_word_mode = editor->false.
>   ENDIF.
> 
>   CALL METHOD editor->find_and_select_text
>                EXPORTING search_string = search_string
>                          case_sensitive_mode = case_sensitive_mode
>                          whole_word_mode = whole_word_mode
>                CHANGING string_found = found.
> * Flush for proper work of the following if statement
>   CALL METHOD cl_gui_cfw=>flush.
>   IF NOT search_string IS INITIAL.
>     IF found NE 0.
>       MESSAGE s000 WITH text-013.
>     ELSE.
>       MESSAGE s000 WITH text-014.
>     ENDIF.
>   ENDIF.
> ENDFORM.                               " FIND_TEXT
> 
> *&---------------------------------------------------------------------*
> *&      Form  HIGHLIGHT_LINES
> *&---------------------------------------------------------------------*
> *      -->P_HIGHLIGHT  text                                            *
> *----------------------------------------------------------------------*
> FORM highlight_lines USING    p_highlight.
>   IF selection EQ 'X'.
>     CALL METHOD editor->highlight_selection
>          EXPORTING highlight_mode = p_highlight
>          EXCEPTIONS has_no_effect = 1.
>     IF sy-subrc NE 0.
> *      add your handling
>     ENDIF.
>   ELSE.
>     CALL METHOD editor->highlight_lines
>          EXPORTING
>                  from_line = from_line
>                  to_line = to_line
>                  highlight_mode = p_highlight
>          EXCEPTIONS has_no_effect = 1.
>     IF sy-subrc NE 0.
> *      add your handling
>     ENDIF.
>   ENDIF.
> 
> ENDFORM.                               " HIGHLIGHT_LINES
> 

> and this link:

> http://help.sap.com/saphelp_45b/helpdata/EN/0e/514035634d761fe10000009b38f889/frameset.htm

>

> Best regards.

>

> Edited by: Pablo Casamayor on Apr 17, 2009 9:19 AM

Hi Pablo,

I have look through the program SAPTEXTEDIT_TEST_1. This program does the Text Selection and Highlighting the Text only after the buttons of each of the function is clicked.

My requirements will be, having all the selected text (with a string pattern) to be highlighted when this text editor is displayed. Is this possible?

Really thanks for your replies...

Regards,

Chuak Fen

Read only

0 Likes
3,204

Hi,

1.- execute program SAPTEXTEDIT_TEST_1

2.- write some text

3.- tick the following checkboxes:

Case-sensitive

Whole-word

Use for selection

4.- in Find input field put the text you want to highlight

5.- Click button "Find and select"

6.- click button "Highlight text area"

7.- click on button "Display<->Change"

Now if you click on the text editor although you are on display mode you can see that the text is hilighted.

Best regards.

Edited by: Pablo Casamayor on Apr 17, 2009 12:04 PM

Read only

0 Likes
3,204

>

> Hi,

>

> 1.- execute program SAPTEXTEDIT_TEST_1

> 2.- write some text

> 3.- tick the following checkboxes:

> Case-sensitive

> Whole-word

> Use for selection

> 4.- in Find input field put the text you want to highlight

> 5.- Click button "Find and select"

> 6.- click button "Highlight text area"

> 7.- click on button "Display<->Change"

>

> Now if you click on the text editor although you are on display mode you can see that the text is hilighted.

>

> Best regards.

>

> Edited by: Pablo Casamayor on Apr 17, 2009 12:04 PM

Hi Pablo,

Thanks a lot for all your replies. I finally have what I required to do by using this program SAPTEXTEDIT_TEST_1 as the reference.

Thanks to others as well... =D

Read only

Former Member
0 Likes
3,204

you may use CL_GUI_TEXTEDIT.

Read only

Former Member
0 Likes
3,204

Hi,

Try using Function Module:

CATSXT_SIMPLE_TEXT_EDITOR

Hope it helps

Regards

Mansi

Read only

Former Member
Read only

Former Member
0 Likes
3,204

Hi,

Check this FM 'CATSXT_SIMPLE_TEXT_EDITOR'

Regards,

Jyothi CH.

Read only

Former Member
0 Likes
3,204

Try this FM 'TXW_TEXTNOTE_EDIT'.

Regards,

Joan

Read only

Former Member
0 Likes
3,204

Check this program SAPBC460D_09_TEXT1

Read only

0 Likes
3,204

>

> Check this program SAPBC460D_09_TEXT1

Hi Gayathri,

I couldn't find program SAPBC460D_09_TEXT1. Thank you..