Application Development 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: 

Popup-Text highlight

Former Member
0 Kudos

Hi Experts,

We have come across a requirement, can anyone of you help us to achieve.

Requirement:

Developing a report to display a POP-UP with a text.

To be more precise,

The text should show up in the popup as auto selected text. Please look for the below screen shot.

Please give me valuable suggestions/ solutions will be appreciated.

Thanks in advance.

18 REPLIES 18

SimoneMilesi
Active Contributor
0 Kudos

What do you mean with "autoselected"? From what? A table? Text symbol? System information?

0 Kudos

Hi Simone,

Say like custom text populated to POP-UP window(Eg: Welcome to SAP) from a report....here the  word SAP should be Auto-selected.....means user can copy that selected text directly and use it accordingly.

Please let me know your suggestion.

Thanks.

0 Kudos

So the logic is:

  1. the user put a value in input to a report
  2. the report get the input value and show in popup?

If so, F1 on MESSAGE statement

0 Kudos

Hi,

can you please try the below code

data : input_text type CATSXT_LONGTEXT_ITAB.

CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'

  EXPORTING

    im_title              = 'Test'

  •   IM_DISPLAY_MODE       = ' '
  •   IM_START_COLUMN       = 10
  •   IM_START_ROW          = 10

  changing

    ch_text               = input_text.

    IF sy-ucomm = 'CX_CONT'.

    WRITE: 'OK'.

   

    

    ELSE.                                                  " SY-UCOMM = 'CX_CANC'

    WRITE: 'CANCEL'. 

  CLEAR input_text.

    ENDIF.

Thanks & Regards,

Sree

Pavithra_madhu
Participant
0 Kudos

Hi,

Auto select means ?? Do u need to highlight the word.. Then u can add color to text as below..

WRITE:'Welcome To ', ' SAP ' CENTERED COLOR COL_KEY INTENSIFIED ON .

0 Kudos

Hi Pavithra,

Actually the user requirement is, he needs to get a pop-up on the screen whenever the report is executed. Say like, WELCOME TO SAP for example. Here, in this sentence, the word SAP should get auto-selected(as shown above in the screenshot) so that the user can directly copy the text and paste it wherever he needs.

Thanks,

Sujay

0 Kudos

Hi Sujay,

I mean do you want to save the text in clipboard?

Thanks & Regards,

Sree

0 Kudos

Hi Sreedevi,

Yes, I want to save the text to clipboard directly by pressing ctrl+c .

Thanks,

Sujay

0 Kudos

Hi Sujay,

Please try below methods.

CLIPBOARD_EXPORT

CLIPBOARD_IMPORT

Thanks & Regards,

Sree

0 Kudos

Hi Sreedevi,

I tried with the above methods, but its not meeting the requirements.

Thanks.

0 Kudos

Hi Sujay,

Have you tried like below.

DATA: gt_text TYPE STANDARD TABLE OF char255,

      gs_text LIKE LINE OF gt_text,

      gv_rc   TYPE i.

.

gs_text = 'Welcome to SAP'.

APPEND gs_text TO gt_text.

*export data to clipboard.

CALL METHOD cl_gui_frontend_services=>clipboard_export

  IMPORTING

    data = gt_text

  CHANGING

    rc   = gv_rc.

IF gv_rc = 0.

* import data from clipboard.

cl_gui_frontend_services=>clipboard_import(

  IMPORTING

    data                 = gt_text

  EXCEPTIONS

    cntl_error           = 1

    error_no_gui         = 2

    not_supported_by_gui = 3

*display text wherever its required.

endif.

Thanks & Regards,

Sree

0 Kudos

Hi Sujay,

please use below function module to save the text in clipboard and use ctrl+v to paste the text wherever required.

*maintain the text in int_tab internal table.

CALL FUNCTION 'CLPB_EXPORT'

     TABLES

          DATA_TAB   = int_tab

     EXCEPTIONS

          CLPB_ERROR = 1

          OTHERS     = 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.

Thanks & Regards,

Sree

0 Kudos

Hi Sreedevi,

Through this FM we can able to achieve paste(CTRL+V) functionality, but first we need to show up with the selected area of a text say like SAP as discussed above.

Thanks,

Sujay

0 Kudos

Hi Sujay,

you are displaying popup window with some text right. if you use the above fm for the same text after popup window logic then automatically the displayed text saved in clipboard. so you can use the same text wherever required by using ctrl+v.

Regards,

Sree

0 Kudos

Hi Sreedevi,

As per my knowledge, his requirement is to select a particular text in a sentence.....for example, in the sentence WELCOME TO SAP - SAP should be selected automatically and the user will just use ctrl+c to copy to the clipboard and paste it wherever he wants to.

@Sujay Vempalli

I think you should use both the function modules CATSXT_SIMPLE_TEXT_EDITOR  and  CLPB_EXPORT  to achieve this requirement.

Thanks,

Esh.

0 Kudos

Hi Esh,

The FM's will not suit for my requirement.

Any other suggestions/comments

Thanks.

0 Kudos

It can't be done.

0 Kudos

Hi Sujay,

Tried to find out if there is any possible way to meet your requirement but, i dint come across any FM or Methods to achieve this.

I think your requirement cannot be met..!!

Thanks,

Esh