‎2006 Aug 02 3:38 PM
Is there a function to save a long text in a table and which return some key to access this text in the future?
‎2006 Aug 02 3:41 PM
‎2006 Aug 02 3:42 PM
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.
‎2006 Aug 02 3:42 PM
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
‎2006 Aug 02 4:03 PM
hi
good
INIT_TEXT To load long text into SAP
READ_TEXT To load long text into SAP
thanks
mrutyun
‎2006 Aug 02 4:12 PM
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