cancel
Showing results for 
Search instead for 
Did you mean: 

Item text -break up.

Former Member
0 Kudos

Dear all,

im displaying free item texts and header texts in my script.i have taken a variable g_fim(1000) of type c,and passing the free text from READ_TEXT FM to this variable G_FIM. and iam able to display.

But my concern is i want to display it line by line,i mean the user enters the text in four lines,but im getting it displayed in a single line. i want the text to b displayed as the user enters.

Accepted Solutions (0)

Answers (3)

Answers (3)

asik_shameem
Active Contributor
0 Kudos

Hello,

While concatenating from READ_TEXT -> LINES, just check the field LINES-TDFORMAT.

If it is NOT INITIAL concatenate a newline ( CL_ABAP_CHAR_UTILITIES=>NEWLINE ) in G_FIM.

Former Member
0 Kudos

thanks for your reply shameem and all.

im getting '*' in TDFORMAT field ..........can anyone brief me on how shud i go with.

Former Member
0 Kudos

STOP it!

There is no READ_TEXT needed to print a text on a form.

If you are in SAP-SCRIPT make use of the INCLUDE statement as mentioned above, or in SMARTFORMS create a INCLUDE Text node.

No need to care about paragraph formats then.

Former Member
0 Kudos

Thanks for your reply,

i am unable to display the free text as the user enters............the text gets displayed horizontally...not as the way user enters.

i have used the include statement,but this doesn t work becoz i have two line items and for each line item how do i display.

i have used like this.

INCLUDE &L_TEXT& OBJECT 'VBBP' ID 'ZH01' LANGUAGE 'EN'.

here l_text is a concatenation of billing document + line item.

former_member418469
Participant
0 Kudos

hi,

Use include statement in SapScript - INCLUDE 'Z_TEST' OBJECT 'TEXT' ID 'ST' PARAGRAPH A4 LANGUAGE wa_spras

Former Member
0 Kudos

There are probably several ways to accomplish, but I recently utilized the following to break up a string of unknown length (I imposed a max length of 65,535 characters, as you can see in the code).


types: begin of gtyp_txt,
          line(132),
        end of gtyp_txt.
. . .
lv_text_length = 76.  "type I this is the length utilized in SAP editor in the screen
perform text_word_break  using lv_longtext  "string field
                                                     lv_text_length.
. . .
form text_word_break using in_string type string
                           out_len   type i.

data: lt_text_tab    type table of gtyp_txt,
        lv_len         type i,
        lv_copy(65535) type c.

  lv_len = strlen( in_string ).

  if lv_len > 65535.
    lv_copy = in_string(65535).
  else.
    lv_copy = in_string(lv_len).
  endif.

  call function 'RKD_WORD_WRAP'
    exporting
      textline  = lv_copy
      delimiter = space
      outputlen = out_len
    tables
      out_lines = lt_text_tab
    exceptions
      others    = 0.
  if lines( lt_text_tab ) gt 0.
    append lines of lt_text_tab to gt_text_tab.  
  endif.
endform.