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: 

Short text-How to get it

Former Member
0 Kudos

Hi,

does anyone know which table can i extract short text from,or is there some FM that can be used to extract short text.

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Hi,

it depends , what is that short text related to. what is it exactly...

you can use read_text to read the long text. but let me know what text you are talking about...

Regards

Vijay

rainer_hbenthal
Active Contributor
0 Kudos

Short text from which object?

Former Member
0 Kudos

its a short text for transaction tx01 and tx02

theres a field on memo tab called "Notes of confirmation".

I need the short text for that.

thanx in advance

0 Kudos

Hi Chirantan,

Please find few tables which stores text:

Hope this will help you:

DDPRTXT | R/3 DD: Log texts |

DD15T | R/3 DD: texts on SAP objects |

DD03T | DD: Texts for fields (language dependent) |

Morever you can use Read_text Function module:

Sample code for the same:

TABLES: TTXID, ITCPO.

DATA: LANGUAGE LIKE T002-SPRAS VALUE 'E',

ACTION LIKE TTXCT-FUNCTION,

TEXTTITLE LIKE TTXIT-TDTEXT.

DATA BEGIN OF TEXTHEADER.

INCLUDE STRUCTURE THEAD.

DATA END OF TEXTHEADER.

DATA BEGIN OF TEXTLINES OCCURS 0.

INCLUDE STRUCTURE TLINE.

DATA END OF TEXTLINES.

  • CREATE A ONE-LINE TEXT ELEMENT

PARAMETERS: P_OBJ LIKE TTXID-TDOBJECT DEFAULT 'DOKU' OBLIGATORY,

P_ID LIKE TTXID-TDID DEFAULT 'TB' OBLIGATORY,

P_NAME LIKE STXH-TDNAME DEFAULT 'MARA' OBLIGATORY.

PARAMETERS: P_LINE LIKE TLINE-TDLINE,

P_PRNFMT LIKE THEAD-TDTEXTTYPE,

P_DEL AS CHECKBOX.

CLEAR: TEXTLINES, TEXTLINES[].

TEXTLINES-TDLINE = P_LINE.

APPEND TEXTLINES.

SELECT SINGLE * FROM TTXID WHERE TDOBJECT EQ P_OBJ

AND TDID EQ P_ID.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = P_ID

LANGUAGE = LANGUAGE

NAME = P_NAME

OBJECT = P_OBJ

IMPORTING

HEADER = TEXTHEADER

TABLES

LINES = TEXTLINES

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC = 0.

MOVE 'LOCL' TO ITCPO-TDDEST.

MOVE 1 TO ITCPO-TDCOPIES.

IF P_PRNFMT = 'ITF'.

CALL FUNCTION 'PRINT_TEXT_ITF'

EXPORTING

HEADER = TEXTHEADER

OPTIONS = ITCPO

TABLES

LINES = TEXTLINES.

ELSE.

CALL FUNCTION 'PRINT_TEXT'

EXPORTING

HEADER = TEXTHEADER

OPTIONS = ITCPO

TABLES

LINES = TEXTLINES

EXCEPTIONS

OTHERS = 1.

ENDIF.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'INIT_TEXT'

EXPORTING

ID = P_ID

LANGUAGE = LANGUAGE

NAME = P_NAME

OBJECT = P_OBJ

IMPORTING

HEADER = TEXTHEADER

TABLES

LINES = TEXTLINES.

CALL FUNCTION 'EDIT_TEXT'

EXPORTING

EDITOR_TITLE = TEXTTITLE

HEADER = TEXTHEADER

SAVE = SPACE

IMPORTING

FUNCTION = ACTION

NEWHEADER = TEXTHEADER

TABLES

LINES = TEXTLINES.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = P_ID

FLANGUAGE = LANGUAGE

FNAME = P_NAME

FOBJECT = P_OBJ

TABLES

FLINES = TEXTLINES

EXCEPTIONS

NO_INIT = 1

NO_SAVE = 2

OTHERS = 3.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = TEXTHEADER

IMPORTING

NEWHEADER = TEXTHEADER

TABLES

LINES = TEXTLINES.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

OBJECT = P_OBJ

NAME = P_NAME

ID = P_ID

LANGUAGE = LANGUAGE.

ELSE.

IF P_DEL EQ 'X'.

CALL FUNCTION 'DELETE_TEXT'

EXPORTING

OBJECT = P_OBJ

ID = P_ID

NAME = P_NAME

LANGUAGE = LANGUAGE.

WRITE:/ P_OBJ, 'DELETED'.

ELSE.

WRITE:/ P_OBJ, 'EXISTS'.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

Just copy paste the above code and see whether it works for you or not.

Cheers

Sunny

rewrd points, if found helpful

Former Member
0 Kudos

Hello Chirantan,

It is derived from TTIXT.

TDSPRAS: E

TDOBJECT: TB_FHA