Application Development 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_TEXT problem with amount of characters

Rodrigo-Giner
Active Contributor
0 Kudos

The problem is that the function only works when the text is bigger than 40 characters, if the text is less than 40 characters the READ_TEXT FM doesnt return me anything.

Anyone know why this happens and how could be fixed.

8 REPLIES 8

Former Member
0 Kudos

Hi

? This fm works if the std text exits

Max

0 Kudos

what do u mean with what ?

When I put a text less than 40 characters, I go to the info of the header, and it has no autor, and the FM doesnt work.

But when I write more than 40 characters, in the header appears the autor and the FM works fine.

So how can I get that text no matter the length ?

0 Kudos

Hi Rodrigo,

The read_text FM will not consider the length of character when processing the text.

The main thing that you need to make sure is you save your text, make sure you pass textname, textID and language value to the FM.

The FM will work no matter how long is the text.

Former Member
0 Kudos

Hello,

I did not get u.

I have used read_text in many cases when the text is longer than 40 characters.

Paste ur code we can analyze it.

Regards

0 Kudos

Hi, ravi. My problem is when the text is lesser than 40 characters.

I will try to explain a little more.

Im working with the iw32 tx

en Component tab, I have an icon to extend the text of a component.

What I need is this text, I write a text bigger than 40 characters the text is saved. I run se37 READ_TEXT function using the name, id, obj and bring me the text. There is no problem at all.

The problem comes when the text is lesser than 40 characters, I save the text. If I re-enter I see it fine my problem keep intact, the problem is that I run se37 READ_TEXT FM using again name, id, obj and bring me nothing, and I dont know why.

0 Kudos

b/c this is the forum of ABAP i will put the code, but I dont know how to fix this.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'MATK'

language = 'S'

name = l_compo ->Here I have the name

object = 'AUFK'

tables

lines = it_desc_compo

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

OTHERS = 7 .

So when that text (with that ID, OBJ, NAME, LANG) is bigger than 40 characters. works fine and it_desc_compo is filled.

IF the text with sames parameters is lesser than 40, return my sy-subrc = 4. I tested using the se37 tx, and is true. dont bring me nothing altought the text (<40 char) still exist.

0 Kudos

Hi Rodrigo,

dat maybe because if its less than 40 characters, the text gets stored only in the field for which u ahve the long text extension( not in the Text box ).. just chk the table where this 40 character field maybe ther n u may find the text in this field...

so wat u can do is, if text is not ther via READ_TEXT, then read this field from the table...

hope it helps..

Former Member
0 Kudos

Hi,

Why don't you write a small program for this READ_TEXT and test, this will give you clear idea, because you can debug this ....

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = <ID>

LANGUAGE = 'E'

NAME = <Nmae>

OBJECT = <Object>

  • ARCHIVE_HANDLE = 0

IMPORTING

HEADER = HTEXT

TABLES

LINES = LTEXT

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

Regards

Sudheer