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

Problem viewing text in long text field

Former Member
0 Likes
587

Hi,

I have a long text in the screen and it takes 65 characters per line in the long text field. iam able to populate data in the long text field but the text in the long text field is truncating in between the words as shown below.

SAP Business One users can access and ru

n reports by using the UI API provided as

part of the SAP Business One SDK and the

Crystal Reports .Net Winform viewer. Rea

d the new ---

Could any one suggest how to rectify this, my requirement is to end the lines at spaces like

SAP Business One users can access and run

reports by using the UI API provided as

part of the SAP Business One SDK and the

Crystal Reports .Net Winform viewer. Read

the new ---

Appriciate your time.

Reward points for useful answer.

Thanks,

Sreeni.

1 ACCEPTED SOLUTION
Read only

franois_henrotte
Active Contributor
0 Likes
549

here is how I would do it:

1) convert the input (short text) table to string

2) apply this code to the string:


DATA: lv_text TYPE text40,
          lv_length TYPE i.

WHILE lv_string IS NOT INITIAL.
  lv_length = 39.
  lv_text = lv_string.

  WHILE lv_text+lv_length(1) NE space AND lv_length GE 0.
       lv_text = lv_text(lv_length).
       lv_length = lv_length - 1.
  ENDWHILE.

  IF lv_length GE 0.
     APPEND lv_text TO lt_short_text.
  ENDIF.

   lv_length = lv_length + 1.
   SHIFT lv_string LEFT BY lv_length PLACES.

ENDWHILE.

Hi,

I have a long text in the screen and it takes 65 characters per line in the long text field. iam able to populate data in the long text field but the text in the long text field is truncating in between the words as shown below.

SAP Business One users can access and ru

n reports by using the UI API provided as

part of the SAP Business One SDK and the

Crystal Reports .Net Winform viewer. Rea

d the new ---

Could any one suggest how to rectify this, my requirement is to end the lines at spaces like

SAP Business One users can access and run

reports by using the UI API provided as

part of the SAP Business One SDK and the

Crystal Reports .Net Winform viewer. Read

the new ---

Appriciate your time.

Reward points for useful answer.

Thanks,

Sreeni.

3 REPLIES 3
Read only

Former Member
0 Likes
549

Hi,

try this FM:

CONVERT_STREAM_TO_ITF_TEXT

Read only

franois_henrotte
Active Contributor
0 Likes
550

here is how I would do it:

1) convert the input (short text) table to string

2) apply this code to the string:


DATA: lv_text TYPE text40,
          lv_length TYPE i.

WHILE lv_string IS NOT INITIAL.
  lv_length = 39.
  lv_text = lv_string.

  WHILE lv_text+lv_length(1) NE space AND lv_length GE 0.
       lv_text = lv_text(lv_length).
       lv_length = lv_length - 1.
  ENDWHILE.

  IF lv_length GE 0.
     APPEND lv_text TO lt_short_text.
  ENDIF.

   lv_length = lv_length + 1.
   SHIFT lv_string LEFT BY lv_length PLACES.

ENDWHILE.

Read only

Former Member
0 Likes
549

Thanks Franco...

Full points awarded.

Again thanks for the help.

Sreeni.