2022 Jul 20 8:46 AM
I am not able to enable the function code in screen painter for the text area. I created this text area using custom table control. please help
2022 Jul 20 8:54 AM
Scince screen painter is a SAPGUI transaction it is not available in SAP BTP, ABAP Environment.
I am thus changing the tag.
2022 Jul 20 9:27 AM
Hi misbaseemath
Are you referring to the FctCode of screen for the custom control you defined as TEXTEDITOR.?
The FctCodes are not active for Custom Control objects. They are the place holders.
You need to attach the Text Editor object inside this custom container in your PBO module.
2022 Jul 20 10:29 AM
Can you elaborate a little on attach the Text Editor object inside this custom container in your PBO module.
2022 Jul 20 10:40 AM
Hi
You have defined the custom control in the screen. Now in PBO of your screen, write this code to display the text editor object.
In PBO
The data defintion part, you put it in global. In PBO you can write
MODULE prepare_text_editor.
Inside that MODULE you write the below code.
DATA: LINE_LENGTH TYPE I VALUE 1000,
EDITOR_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
lv_EDITOR TYPE REF TO CL_GUI_TEXTEDIT.
EDITOR_CONTAINER = 'TEXT EDITOR' . "The container name you gave in screen
if lv_editor is initial.
CREATE OBJECT lv_editor
EXPORTING
wordwrap_mode = lv_editor->wordwrap_at_fixed_position
wordwrap_position = LINE_LENGTH
wordwrap_to_linebreak_mode = lv_editor->true
parent = editor_container "TEXT_EDITOR
EXCEPTIONS
OTHERS = 1.
endif.<br>
2022 Jul 20 10:55 AM
Custom control always holds a control object, which is event-driven by nature. Function code assignment only works for 'classic' GUI element, such as input fields or buttons.
You have to define an event handler for the DBLCLICK event of the CL_GUI_TEXTEDIT control to be able to react to the double click.
2022 Jul 20 1:01 PM
I dont want the double click event. I just want to save the data i enter in the custom table control. In pa30 i want to save while creating a record
2022 Jul 20 2:39 PM
From ABAP help function code is:
Sequence of up to 20 characters that can be assigned to specific control elements of the user interface in SAP GUI. When one of these control elements is selected, the dynpro event PAI is triggered and the function code is passed to the ABAP program using the system field sy-ucomm or the OK field of the dynpro.
So fct codes can be assigned only to pushbutton, checkbox, radio button, or dropdown box.
Read more about user interactions on the screen
2022 Jul 20 2:48 PM
I think all people who answered till now don't understand what you want to achieve. How I understand the question with your latest comment scares me a little bit, if you mean adding a custom save function inside the custom control, separated from the standard save function. I'd say it's not UX friendly at all. You'd better clarify the requirement.
NB: it's not a "custom table control" that you are using, it's a "custom control". Table control is completely different.
2022 Jul 20 2:58 PM
Hi Misba,
You cannot enter function code for Custom control.
Refer standard program SAPTEXTEDIT_LENGTH_DEMO as a reference to use TEXT EDITOR in module pool. Do not miss the CALL METHOD cl_gui_cfw=>flush method call.
Text editor here is placed in custom control, via code in PBO.
2022 Jul 20 4:04 PM