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: 

Reading Texts longer than 132 Characters

former_member229034
Participant
0 Kudos

Hello Seniors,

I am working on Reading Texts more that 132 characters long.Texts should include Symbols also.I want to <b>Create and Save</b>the texts and then <b>read</b> them wherever I want from ABAP functions.

I want to know the Transports information relating to this.

Could there be any function modules (with relevant parameter passing)to create long texts and then read them where ever I need.

Thank You,

cnc.

4 REPLIES 4

Former Member
0 Kudos

HI

Check the fun module <b>READ_TEXT</b>, CREATE_TEXT and SAVE_TEXT and EDIT_TEXT etc related to the Std texts

Have to pass the parameters like OBJECT,ID, OBJECTNAME,LANGUAGE

You can transport these texts using the program <b>RSTXTRAN</b>

see the doc

READ_TEXT

READ_TEXT provides a text for the application program in the specified work areas.

The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.

After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.

If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.

Function call:

CALL FUNCTION 'READ_TEXT'

EXPORTING CLIENT = SY-MANDT

OBJECT = ?...

NAME = ?...

ID = ?...

LANGUAGE = ?...

ARCHIVE_HANDLE = 0

IMPORTING HEADER =

TABLES LINES = ?...

EXCEPTIONS ID =

LANGUAGE =

NAME =

NOT_FOUND =

OBJECT =

REFERENCE_CHECK =

WRONG_ACCESS_TO_ARCHIVE =

Export parameters:

CLIENT

Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.

Reference field: SY-MANDT

Default value: SY-MANDT

OBJECT

Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.

Reference field: THEAD-TDOBJECT

NAME

Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.

Reference field: THEAD-TDNAME

ID

Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.

Reference field: THEAD-TDID

LANGUAGE

Enter the language key of the text module. The system accepts only languages that are defined in table T002.

Reference field: THEAD-TDSPRAS

ARCHIVE_HANDLE

If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.

The value '0' indicates that you do not want to read the text from the archive.

Reference field: SY-TABIX

Default value: 0

Import parameters:

HEADER

If the system finds the desired text, it returns the text header in this parameter.

Structure: THEAD

Table parameters:

LINES

The table contains all text lines that belong to the text read.

Structure: TLINE

Exceptions:

ID

The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.

LANGUAGE

The parameter LANGUAGE contains a language key that does not exist in table T002.

NAME

The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.

Possible errors:

The field contains only blanks.

The field contains the invalid characters ‘*’ or ‘,’.

OBJECT

The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.

NOT_FOUND

The system did not find the specified text module.

REFERENCE_CHECK

The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.

WRONG_ACCESS_ TO_ARCHIVE

The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

Hello Sir Anji,

Thank you for the reply.

Could you please give me some information about the Purpose of the following Function Modules also?

'SOTR_STRING_CREATE_CONCEPT'

'LXE_OBJ_TEXT_PAIR_READ_SOTR'

'SOTR_STRING_READ_TEXT_WITH_KEY'

I was able to create a concept by using the Function module 'SOTR_STRING_CREATE_CONCEPT'. Now, I need to create a text for the concept and then read the text(the text can be longer than 132 characters and also may contain special characters) from abap functions as per my requirement.

  • my requirement is not based only on SAP Scripts.

Thank you,

cnc.

0 Kudos

Hello Sir Anji,

I was able to read the long texts using the function module READ_TEXT. my requirement is that I should be able to read the texts which are even longer than 132 characters in size. I tried to create a text programatically using the function module CREATE_TEXT.I have passed the text value by hard coding. It creates only 132 characters long text.The datatype of the line is of 132 characters. could you please advice me on this.

Thank you,

cnc.

Former Member
0 Kudos

crate text

transcation s010.

funcatio module 1. create_text

2. save_text

3 delete_text

4 save_text.