cancel
Showing results for 
Search instead for 
Did you mean: 

Handlinng long text display for text field - Multiline Issue

Former Member
0 Kudos

Hi all,

I have an issue with an interactive text field in which user enters data in multiple lines without hitting enter key(for new line).

So the text field contains text in multiple lines so we are unable to split text for each line separately. If the user doesn't hit enter key there is no new line or any other separator stored in the text and hence we are unable to split the text into multiple line to store at the back end using SAVE_TEXT.

So could you please suggest any solution to handle this issue.

Regards

Pramod

0 Kudos

Hello Team,

Have you got any solution for this same? Because, I am facing same challenges.

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

Hello,

maybe you can explain the scenario you´re working on?

What I would do (anyway) is to read the text, check the formatting (TDLINE part of the line) and based on the formatting from there (like * is very useful, right?) I would change the format of the text coming into the Adobe form.

Regards Otto

Former Member
0 Kudos

Hello,

The scenario is as below.

We have adobe form in which long text field is available. Now whatever enter by user in this text field need to be stored with the help of SAVE_TEXT function module. so we have to store entries in SAVE_TEXT as it is entered in Adobe form text field. We have to take care of new line. here SAVE_TEXT table TLINE contains TDFORMAT & TDLINE, But now problem is that from Adobe we get all values in string. TDLINE can contain only 132 character so for remaining text we have to pass that to table TLINE as next line, but to pass to text how we will differentiate next line & paragraph change.

We need to retrieve same text using READ_TEXT to display user in Adobe form as it is entered at the time of creation.

Thanks & regards,

Pramod

Former Member
0 Kudos

Hi,

You can handle this by ABAP coding . Provide a offset of 132 to the string and append it to the table TLINE till you have the entire string taken.

Logic would be something like :


lv_length = STRLEN( lv_string ).
lv_pos = 132.

do 10 times.

ls_tline = lv_string+lv_off(lv_pos).
append ls_tline to lt_tline .

lv_off = lv_off + lv_pos.

if lv_off > lv_length.
exit.
endif.

clear ls_tline.

enddo.

OttoGold
Active Contributor
0 Kudos

How does your code handle the linebreaks? That is what we talk about here. I guess Mr. Pramod can like "divide" a string into a table... How would you recognize the "*" (star for a new paragraph) to place it into a TDLINE?

Otto

Former Member
0 Kudos

Hello Otto/Pramod,

Apologies for a late reply.

Next line in the string is identified by character '#'.

You can approach a ABAPer in your team and he can get the code ready in no time.

You can use code like :


data : begin of lt_para occurs 0,
            para type string,
          end of lt_para.

data : ls_para like line of lt_para.

SPLIT  lv_string AT '#' INTO TABLE lt_para .

loop at lt_para into ls_para.

You have your one whole para in a single string field i.e. ls_para-para.
Check for the limit of 132 characters by my previous given logic.

endloop.

Thanks & Regards,

Omkar Mirvankar.

Former Member
0 Kudos

A small correction :

It wont recognise the new Line character '#' from the string ...

You have to use New Line character from class CL_ABAP_CHAR_UTILITIES

darren_bambrick2
Active Participant
0 Kudos

Function Module CONV_TEXTSTRING_TO_ITF

jlsim
Explorer
0 Kudos

Hi Omkar,

Thanks for providing this solution. But i tried both '#' and cl_abap_char_utilities=>newline, but split just can't recognize them.

Anything i need to set at the form? i uses "Plain text only" for Field format, Rich Text can't even pass the value back to the program when i upload the form.

Any idea? thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi check this FM's:

SOTR_SERV_STRING_TO_TABLE

CONVERT_STRING_TO_TABLE

HR_EFI_CONVERT_STRING_TO_TABLE