2006 Oct 12 2:17 PM
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
2006 Oct 12 2:35 PM
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.
2006 Oct 12 3:20 PM
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
2006 Oct 12 2:37 PM
Check out the function group documentation for the group that contains READ_TEXT. It's actually quite helpful.
2006 Oct 12 2:48 PM
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
2006 Oct 12 3:18 PM
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
2007 Jan 30 11:51 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |