cancel
Showing results for 
Search instead for 
Did you mean: 

number of characters in a line of ABAP WD textedit

Former Member
0 Kudos

Hi guys,

I want to fix the number of characters you can write into the textedit component of my abap web dynpro. The problem is, that when i set cols to 73 ( that the ammount of characters i want to allow in one line) and then set the wrapping mode to hard or soft (makes no difference to me) there still is the possibilty of writing more than 73 characters into it. For Example when you input a line only containing 'i's : iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

as these are very small, you can insert a lot of them.

It would fix the issue, if you know the possibility of setting the font of the textedit. Than i could set it to a font were every character has the same width.

Thanks in advance.

Dave

Accepted Solutions (1)

Accepted Solutions (1)

former_member300158
Discoverer
0 Kudos

This had me bugged for ages, as my customer still wanted to display and maintain texts attached to infotypes (which are stored in PCL1(TX) with 72 chars in each line), as well as by a textedit box in WDA.

Ended up (it's quite dirty, so look away now if you dont like that sort of thing)

Implicitly enhance CL_WDR_MAIN_TASK->HANDLE_REQUEST and add (something like)

data: lv_response type string.

if wdr_task=>client_window->client->application_name cs 'ZWD'.

lv_response = server->response->get_cdata( ).

replace all occurences of '<textarea class=' in lv_response with '<textarea style="font-family:monospace" class='.

if sy-subrc = 0.

server->response->set_cdata( data = lv_response ).

endif.

endif.

Works a treat for me

Reg

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you for the workaround. Though its quite a dirty way, it fixes the current issue. The actual problem that there is no possibility to indeed fix the col width is still not solved, however.

Former Member
0 Kudos

Thank you for the workaround. Though its quite a dirty way, it fixes the current issue. The actual problem that there is no possibility to indeed fix the col width is still not solved, however.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Interesting. The online help does say that he cols should be working off the number of characters:

cols

Width of the TextEdit UI element as a number of characters.

However I just tested it and it does work as you describe. There is no simple way to change just the font for the text edit. It would require customizing the theme and applying this custom theme to your application. I suppose you could open a support ticket since the system doesn't act as described in the help document. It may turn out to be a limitation that can't be overcome - but at the least the documentation can be adjusted to reflect that situtation.