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

Long text

Former Member
0 Likes
1,042

Is there a function to save a long text in a table and which return some key to access this text in the future?

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
770

Yes, you can use the SAVE_TEXT and READ_TEXT function modules. All long text in the system is stored this way. You can create custom Text Object/ids via transaction SE75.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
770

long text does not gt stored in table..instead use function module WRITE_TEXT supplying all necessary fields and it gets stored in SAP...Now when one wants to access this text use function module READ_TEXT supplying all neccessary fields and it comes in an output field.

Read only

Former Member
0 Likes
770

text will be stored in STXH & STXL tables.

to identify any standard text , you need the below fields

1.TEXT NAME

2. ID

3. OBJECT

4. LANGUAGE

normally we use READ_TEXT to fetch the text & SAVE_TEXT to save the text.

for these function modules, we have to pass the above field values.

to create a standard text we use S010 transaction.

for further help, go thru the link

regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

Former Member
0 Likes
770

hi

good

INIT_TEXT To load long text into SAP

READ_TEXT To load long text into SAP

thanks

mrutyun

Read only

Former Member
0 Likes
770

Hai

Go through the following F.M you will get the Long Test

DATA: BEGIN OF XTHEAD.

INCLUDE STRUCTURE THEAD.

DATA: END OF XTHEAD.

DATA: BEGIN OF ZZTLINE OCCURS 10.

INCLUDE STRUCTURE TLINE.

DATA: END OF ZZTLINE.

XTHEAD-TDID = 'ZPPM'. "TEXT-ID

XTHEAD-TDSPRAS = SY-LANGU. "Language

XTHEAD-TDNAME = 'ZTKF'. "identification

CONCATENATE SY-TCODE(5) ITAB0300POS-AUFNR

INTO XTHEAD-TDNAME.

XTHEAD-TDOBJECT = 'TEXT'. "Object type top/position

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = XTHEAD-TDID

LANGUAGE = XTHEAD-TDSPRAS

NAME = XTHEAD-TDNAME

OBJECT = XTHEAD-TDOBJECT

IMPORTING

HEADER = XTHEAD

TABLES

LINES = ZZTLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

IF SY-SUBRC = 0.

REFRESH ZZTLINE.

ZZTLINE-TDLINE = ITAB0300POS-BEM.

APPEND ZZTLINE.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = XTHEAD

IMPORTING

FUNCTION = ZFUNCTION

NEWHEADER = XTHEAD

TABLES

LINES = ZZTLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

ELSE.

XTHEAD-TDID = 'ZPPM'. "TEXT-ID

XTHEAD-TDSPRAS = SY-LANGU. "Language

XTHEAD-TDNAME = 'ZTKF'. "identification

CONCATENATE SY-TCODE(5) ITAB0300POS-AUFNR

INTO XTHEAD-TDNAME.

XTHEAD-TDOBJECT = 'TEXT'. "Object type top/position

REFRESH ZZTLINE.

ZZTLINE-TDLINE = ITAB0300POS-BEM.

APPEND ZZTLINE.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = XTHEAD-TDID

FLANGUAGE = XTHEAD-TDSPRAS

FNAME = XTHEAD-TDNAME

FOBJECT = XTHEAD-TDOBJECT

TABLES

FLINES = ZZTLINE

EXCEPTIONS

NO_INIT = 01

NO_SAVE = 02.

ENDIF.

Regards

Sreeni