Application Development and Automation 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: 
Read only

How to enable button while changing text in text editor?

Former Member
0 Likes
1,469

Hi,

I have a text editor in my custom made transaction. I would like to enable the SAVE button immediatly in the application toolbar while chaging the text(after entering a character) in the text editor.

Kindly provide your inputs.

Regards,

Satish.

10 REPLIES 10
Read only

Former Member
0 Likes
1,345

Hi,

the class cl_gui_textedit does not have an event for your purpose. Either you keep the button active always or you have to create your own class with an additional event (and the corresponding handler method) for your task.

Read only

0 Likes
1,345

Hi Jorge,

Thanks for your reply.

I can not keep the save button active always since it is depending on other screen fields.

May be i can try for 2nd option, but i have created the text editor using the standard class CL_GUI_TEXTEDIT.

If i have use my own class and event i think i have to change the complete design of that part.

is there any other possibility?

- Satish

Read only

Kiran_Valluru
Active Contributor
0 Likes
1,345

Hi.,

there is no such Event., In ABAP you have to press enter then Enable the Button. Unfortunately there are no events like OnBlur, OnKeyPress, OnKeyUp ( which offered by java script ). You have to press Enter

Once you enter the text in text editor and press Enter

if lv_text is not initial.

enable button.

endif.

hope this helps u.,

Thanks & regards,

Kiran

Read only

0 Likes
1,345

Hi Kiran,

Where can i add the sample code which you have given?

Regards,

Satish.

Hi.,

>

> there is no such Event., In ABAP you have to press enter then Enable the Button. Unfortunately there are no events like OnBlur, OnKeyPress, OnKeyUp ( which offered by java script ). You have to press Enter

>

> Once you enter the text in text editor and press Enter

>

> if lv_text is not initial.

>

> enable button.

>

> endif.

>

>

> hope this helps u.,

>

> Thanks & regards,

> Kiran

Read only

0 Likes
1,345

Hi.,

In PAI you have to do.,

check sy-ucomm = space. " space for Enter key.

if lv_text is not initial .

do for enabling save., " else set a flag here., In PBO if flag is set do for enable save. ( loop at screen ..... )

endif.,

Thanks & Regards,

Kiran

Read only

0 Likes
1,345

Hi Kiran,

PAI will not be triggered by pressing enter in the text editor. That is the problem i am facing.

Is there any other alternative?

Regards,

Satish.

Read only

0 Likes
1,345

Hi.,

> PAI will not be triggered by pressing enter in the text editor. That is the problem i am facing.

.

Why..!!

Ok then code in At User Command Event.

hope this helps u.,

Thanks & Regards,

Kiran

Read only

0 Likes
1,345

Hi Kiran,

I am not working with Interactive reports.

I have my own screen which has a text editor. I want to trigger an event as soon as i enter a character in that text editor.

is it possible? if possible how?

Regards,

Satish.

Read only

0 Likes
1,345

Hi.,

It is not possible as soon as we enter in text editor., ( which was discussed previously ). As you said you have custom screen. So for custom screen PAI Event has to be there..!! You have to press Enter after Entering in text editor,, And in PAI based on sy-ucomm you have to make button enable.

Thanks & Regards,

Kiran

Read only

0 Likes
1,345

Hi,

As it has been discussed, it is not possible to trigger an event and make the save button active as soon as you type into the text editor. Unfortunately you cannot do with the ENTER also as there is no event for the ENTER button in the text editor. The only way I find is to keep the save button active and when you are saving, check if the user has entered any new text or made any changes, then only save and give the message as "saved successfully" otherwise do not save.

Thanks,

Sri.