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: 

Screen Painter

0 Kudos

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

10 REPLIES 10

andrefischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Scince screen painter is a SAPGUI transaction it is not available in SAP BTP, ABAP Environment.
I am thus changing the tag.

ceterum censeo RAP esse utendam

venkateswaran_k
Active Contributor

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.

0 Kudos

Can you elaborate a little on attach the Text Editor object inside this custom container in your PBO module.

venkateswaran_k
Active Contributor
0 Kudos

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>

gabmarian
Active Contributor

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.

0 Kudos

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

Astashonok
Participant
0 Kudos

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

https://help.sap.com/docs/SAP_NETWEAVER_AS_ABAP_FOR_SOH_740/f68e489816e043f1add91d69a6842931/4a3bb6d...

Sandra_Rossi
Active Contributor

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.

0 Kudos

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.

0 Kudos

Hi Revolla.. Thank you so much :)))