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

READ_TEXT - Restrict 72charact

Former Member
0 Likes
3,967

Hi, everyone!

I use "READ-TEXT" function read long text.

but result is at 72width, automatic change line.

I know that max 132 width in line.

but i don't know how to setting it.

Please help me!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,634

I have build an additional logic by looping the return table of the READ_TEXT and checking the TDFORMAT values to solved.

Thanks everyone!

Hi, everyone!

I use "READ-TEXT" function read long text.

but result is at 72width, automatic change line.

I know that max 132 width in line.

but i don't know how to setting it.

Please help me!

9 REPLIES 9
Read only

Former Member
0 Likes
2,634

Hi,

Maybe the text was saved as 73 char. long.

Regards,

Ernesto.

Read only

Former Member
0 Likes
2,634

Hi friend you need to set the table to type TLINE_T.

Example code :

DATA: lt_lines TYPE tline_t.

CALL FUNCTION 'READ_TEXT'

TABLES

lines = lt_lines

After that you can loop the contents into the table which you want.

LOOP AT lt_lines INTO <work_area> WHERE tdformat NE '/*'.

APPEND <work_are>-tdline TO <internal_tab>.

ENDLOOP.

Thanks and Regards,

Sri Hari Anand Kumar

Read only

0 Likes
2,634

TDFORMAT = '*', means new line started in text

TDFORMAT = '=' means the text is in continuation with the previous line.

you can build an additional logic by looping the return table of the READ_TEXT and checking the TDFORMAT values.

Hope this will solve your purpose.

Read only

0 Likes
2,634

TDFORMAT = '*', means new line started in text

TDFORMAT = '=' means the text is in continuation with the previous line.

you can build an additional logic by looping the return table of the READ_TEXT and checking the TDFORMAT values.

Hope this will solve your purpose.

Read only

Former Member
0 Likes
2,634

you can define like this


DATA itab LIKE tline OCCURS 0 WITH HEADER LINE.


 CALL FUNCTION 'READ_TEXT'
    EXPORTING

      id                            = '0001'
      language                      = 'E'
      name                          = name
      object                        = 'VBBK'
    TABLES
      lines                         = itab
   EXCEPTIONS
     id                            = 1
     language                      = 2
     name                          = 3
     not_found                     = 4
     object                        = 5
     reference_check               = 6
     wrong_access_to_archive       = 7
     OTHERS                        = 8.

Read only

0 Likes
2,634

Krupaji, that BS post deserves a comment, but since I can't make mine polite enough, I'll hope for moderator comment.

Read only

Former Member
0 Likes
2,634

Perhaps it is older text, stored in earlier SAP versions? One thing that I have done is to concatenate all the appropriate lines into a string separated by a space, then call function module RKD_WORD_WRAP, specifying the length I want the text parsed into a table or set of up to three lines of text....This will give me the length I want with a "natural" break on word boundaries. So regardless of how text was stored, I can put the text into any desired length.

Read only

Former Member
0 Likes
2,635

I have build an additional logic by looping the return table of the READ_TEXT and checking the TDFORMAT values to solved.

Thanks everyone!

Read only

0 Likes
2,634

You should check the TTXOB table. It contains the settings for the long text objects.

Text object VBBK

Backup mode V

Editor application TN

Line width 72

Style

Form SYSTEM

Text format

Include object

Description Sales Header texts

You can use the 'FORMAT_TEXTLINES' function to change the text length, e.g.:

call function 'FORMAT_TEXTLINES'

exporting

formatwidth = 132

linewidth = 132

startline = 1

tables

lines = it_text "the text you got with READ_TEXT function

exceptions

others = 0.

Edited by: Adorjan Cser on Aug 19, 2011 12:54 AM