cancel
Showing results for 
Search instead for 
Did you mean: 

How to count characters in a text field on WD4A MBO sheet

naofumisasami
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi experts,

I got a requirement from customer who is using MBO sheet on WD4A.

They have some text fields in the sheet, in which maximum characters are set.

They really hate the system warns about maximum characters when they try to save the sheet.

They want to see how many characters they already put in the text field in realtime manner.

(I think they want it like the way Amazon.com does in thier gift message input field)

If it's not possible they can compromise with a calculate button and popup windows which tell them the current number of characters.

They want us to do whatever it takes, add-on or modify,  to get this done.

Does anyone have any idea to implement this requirement?

Thank you for your help in advance.

Best Regards,

Naofumi

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Naofumi Sasami wrote:

If it's not possible they can compromise with a calculate button and popup windows which tell them the current number of characters.

You can create a button for calculating no. of characters and display them the no. of characters input and remaining no. of characters

Steps to achieve this

  1. Read the context attribute of text edit in which the message is being typed
  2. use the strlen key word to calculated the no. of characters in the text field

data lv_count type i.

          lv_count = strlen( lv_text_field ).

         

               " here lv_text_field is your context attribute bound to text field

               " You can also calculate the remaining no. of characters if required

Display the result in popup window or put and ui element text view and show the result on screen upon calculate action

    

Hope this helps you.

Regards,

Rama

Answers (0)