‎2021 Feb 17 9:41 AM
Hello, I have a field which is TYPE STRING and I ant the user to edit it through the small editor that SAP provides (by pressing a button that I have put in the Screen Painter).
Can someone tell me ho to do?
But keep in mind that the TYPE of the FIELD Comments is STRING.
I tried to find to find sth for STRINGs and not for CHARs but I couldn't.
Thanks in advance
Elias
‎2021 Feb 17 9:46 AM
Hello elkekakos
Google: SAP ABAP edit string value in text editor: https://www.google.com/search?q=sap+abap+edit+string+value+in+text+editor
First result: https://answers.sap.com/questions/6606796/how-to-create-text-editor.html
One of the answers contains whole example (I have not tested it): https://answers.sap.com/answers/6607286/view.html
Kind regards,‎2021 Feb 17 9:46 AM
Hello elkekakos
Google: SAP ABAP edit string value in text editor: https://www.google.com/search?q=sap+abap+edit+string+value+in+text+editor
First result: https://answers.sap.com/questions/6606796/how-to-create-text-editor.html
One of the answers contains whole example (I have not tested it): https://answers.sap.com/answers/6607286/view.html
Kind regards,‎2021 Feb 17 9:56 AM
Thanks Mateusz, but there is a missing point in this. There is no method to pass the already existing text for editing. Here I couldn't find a way for strings type elements. I found a lot of FM but all are for CHARs data element and ends with ST22 error.
So my question is how to pass the existing TEXT to the editor.
I found the below but I cannot fill the ITAB it is asking because it must be charlike.
DATA: gt_outtab TYPE STANDARD TABLE OF as4text
CALL METHOD text_editor->set_text_as_stream
EXPORTING
text = gt_outtab
EXCEPTIONS
error_dp = 1
error_dp_create = 2
OTHERS = 3.<br>Again thanks
‎2021 Feb 17 10:46 AM
Hello
Class CL_GUI_TEXTEDIT contains method SET_TEXTSTREAM which imports a text with STRING type. Have you tried it?
Kind regards,‎2021 Feb 17 11:15 AM
Damn, damn, ... I saw also this metho yesterday but I choose the other one. And I was trying to find a way to convert the STRING to CHAR. I found this after your 1st answer (CONVERT_STRING_TO_TABLE) with hich I managed to overcome my problem (fill a charlike table from the string). I was preparing my answer and you came to tell me the correct method that must be used. Jesus, what a waste time.
Thnks a lot Mateusz Adamus
‎2021 Feb 17 11:23 AM
No worries. We've all been there - looking at the obvious and not seeing it.
‎2021 Feb 17 11:24 AM
Elias Kekakos Hopefully "fill the ITAB it is asking because it must be charlike", hopefully it must be charlike to store text... 😉
If it's about how to transfer string to itab, it has already been asked in the forum.
‎2021 Feb 17 11:33 AM
Yes you are right Sandra, here I found the above FM CONVERT_STRING_TO_TABLE. But unfortunately yesterday I read about other FMs that unfortunately convert big CHARs to a charlike ITAB. Maybe my mistake was that I was trying to find an answer to 'split a string into a charlike ITAB'.
Thanks