on 05-13-2005 4:28 PM
If the user hits carriage return in a <textarea>, i.e. to create a new line of text, everything after the carriage return is ignored by R/3 when retrieving the text.
Is there a way to avoid this loss of text.
Thanks
Karen
Try with this.
On the html:
<textarea name="ztdline1[]" cols="100" rows="3">`if (ztdline1.dim > 0)` `repeat with r from 1 to 3; if ( ztdline1[r] != "*" ) ;write (strSub (ztdline1[r], 3, 132), "\r\n"); end; end` `end`</textarea>
On the PBO dynpro:
loop at ztdline1 cursor top_line.
endloop.
On the PAI dynpro:
module get_text1.
loop.
endloop.
where module get_text1 is:
clear ztdline1.
refresh ztdline1.
do.
field-get 'ZTDLINE1' sy-index message_line datalen.
if sy-subrc <> 0.
exit.
endif.
read table message_line index 1.
if sy-subrc eq 0.
ztdline1-tdline = message_line.
append ztdline1.
else.
clear ztdline1-tdline.
append ztdline1.
endif.
enddo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karen,
could you let us know what ITS it is you are using (integrated or stand-alone 6.20)? Also, what is the Patch level.
I assume the problem occurs in the SAPGui for HTML - have you tried searching SAPNet notes for this in the support forums?
Does the problem only occur when the textarea is submitted to the ITS or when the CR is pressed when navigating inside the textarea.
Regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The text is only lost when you send the form back to SAP. However, the ABAP editor works through SAPGUI for HTML, which seems to use a <textarea>.
I'm using the following code to access the data in the textarea when it gets back to SAP. The field-get only returns the text upto the carraige return, however long or short the text is.
FIELD-GET 'nameoftextfield' 1 ITS_VAR LEN.
if sy-subrc = 0.
loop at its_var.
i_tab-notes = its_var-value.
i_tab-line = sy-tabix.
append itab.
endloop.
endif.
Is this the wrong way to do this? Can you tell me a better way?
We are using ITS 6.20 up to patch 9. Version 6200.1016.50133.0, Build 713534
Thank-you for your help
Karen
Hi Karen,
the FIELD-GET is a good option if your textarea field is quite long. Otherwise I'd use Step-Loop or a simple text string field on the ABAP screen to retrieve the content. Disadvantage with Step-Loop are the memory limitations - again, it depends how big your textarea is. Maybe worth a shot.
Another thought: have you checked you LEN variable? Is it set to the max-length of the textarea field?
Regards,
Michael
Thank-you for your suggestion, but the text is cut off wherever the carriage return is, not after a number of characters. Therefore its not a sizing issue. The size of the textarea will vary, but could be quite long.
I dont think I can use a step loop because we need to put more than one textarea in the form.
Anyone else got any ideas why I'm getting this problem.
Thanks
Karen
I've re-done the textarea as a step loop, but it still loses text after a carraige return.
I've looked in the help for step loops in the ITS, but I can't see any information on retrieving information from a textarea.
The help does say to use field-get for large amounts of data and step loop for smaller amounts. However, both have the problem of not returning data after a carriage return.
Does anyone have any more advice.
Thanks for your help
Karen
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.