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

Create, Edit and Display Longtexts

Former Member
0 Likes
896

Hi All,

I have a question about creating, editing, displaying and deleting longtexts (like sapscript longtexts).

I am creating a custom transaction (Module pool program) for BUDGET DISTRIBUTION REQUEST where in i need to give the user a provision to enter longtexts for PROJECT OBJECTIVE and JUSTIFICATION.

What i know is we can save and read the texts using SAVE_TEXT AND READ_TEXT FM's but it needs object id/object name. As we are storing all the data for this transaction in custom tables i dont know how to have this OBJECT NAME/ID.

How do you do this?

Please help me out...

Thanks in advance,

Vijay

Hi All,

I have a question about creating, editing, displaying and deleting longtexts (like sapscript longtexts).

I am creating a custom transaction (Module pool program) for BUDGET DISTRIBUTION REQUEST where in i need to give the user a provision to enter longtexts for PROJECT OBJECTIVE and JUSTIFICATION.

What i know is we can save and read the texts using SAVE_TEXT AND READ_TEXT FM's but it needs object id/object name. As we are storing all the data for this transaction in custom tables i dont know how to have this OBJECT NAME/ID.

How do you do this?

Please help me out...

Thanks in advance,

Vijay

6 REPLIES 6
Read only

Former Member
0 Likes
862

You can create your own custom ID. If you're retrieving an existing text, go to the text itself in the SapScript editor (like you're going to add or modify an entry), then choose the menu option Goto Header. It will give you the object name and ID.

Read only

0 Likes
862

Hi Lisa,

I have created the TEXT OBJECT and TEXT ID using SE75, but i dont know how to attach the TD NAME(key) to it so that i can read/save the text into the SAP.

To read any longtexts we need to pass TEXTOBJECT, TEXT ID & TDNAME along with language for READ_TEXT.

EX: PURCHASE ORDER NO will be the TDNAME for getting the longtexts related to RFQ related to PO (Text object = EKKO, TDID = XXX)

Please guide me how do we link that the TDNAME will be this for this TEXT OBJECT.

Thank you in advance,

Vijay

Read only

Former Member
0 Likes
862

Check out the function group documentation for the group that contains READ_TEXT. It's actually quite helpful.

Read only

0 Likes
862

hi,

look in tables TTXOB for object

and TTXID for ID

set a break-point in FORM check_key in fm read_text and

create a text per standard dialog

Message was edited by: Andreas Mann

Read only

Former Member
0 Likes
862

HI,

use below code

REPORT ZTEST102.

DATA IT_LINES LIKE TLINE OCCURS 0 WITH HEADER LINE.

IT_LINES-TDFORMAT = '*'.

IT_LINES-TDLINE = 'text'.

APPEND IT_LINES.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = 'ST'

FLANGUAGE = SY-LANGU

FNAME = '09999'

FOBJECT = 'TEXT'

  • SAVE_DIRECT = 'X'

  • FFORMAT = '*'

TABLES

FLINES = IT_LINES

EXCEPTIONS

NO_INIT = 1

NO_SAVE = 2

OTHERS = 3.

FREE IT_LINES.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'ST'

LANGUAGE = SY-LANGU

NAME = '09999'

OBJECT = 'TEXT'

  • ARCHIVE_HANDLE = 0

  • IMPORTING

  • HEADER =

TABLES

LINES = IT_LINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

LOOP AT IT_LINES.

WRITE:/ IT_LINES.

ENDLOOP.

<b>text will be stored in table stxh,stxl.</b>

Regards

amole

Read only

Former Member
0 Likes
862

try to use transaction SO10.