11-05-2014 9:33 AM
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.
11-05-2014 9:38 AM
What do you mean with "autoselected"? From what? A table? Text symbol? System information?
11-05-2014 9:44 AM
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.
11-05-2014 9:49 AM
So the logic is:
If so, F1 on MESSAGE statement
11-05-2014 9:49 AM
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'
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
11-05-2014 9:46 AM
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 .
11-05-2014 9:51 AM
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
11-05-2014 9:54 AM
Hi Sujay,
I mean do you want to save the text in clipboard?
Thanks & Regards,
Sree
11-05-2014 9:57 AM
Hi Sreedevi,
Yes, I want to save the text to clipboard directly by pressing ctrl+c .
Thanks,
Sujay
11-05-2014 10:03 AM
11-05-2014 10:23 AM
Hi Sreedevi,
I tried with the above methods, but its not meeting the requirements.
Thanks.
11-05-2014 10:33 AM
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
11-05-2014 10:40 AM
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
11-05-2014 11:24 AM
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
11-05-2014 11:35 AM
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
11-05-2014 12:18 PM
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.
11-05-2014 1:48 PM
Hi Esh,
The FM's will not suit for my requirement.
Any other suggestions/comments
Thanks.
11-06-2014 5:06 AM
11-06-2014 5:26 AM
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