04-05-2006 5:46 PM
Hello,
Is there a way I can save a standard text using a custom table as a reference? Is the function SAVE_TEXT the one to be used? What are the parameters needed?
Thanks,
Ricky
04-05-2006 5:50 PM
Yes the function module SAVE_TEXT is used to save texts into STXH and STXL tables.
YOu need to pass the object number and the lines of text that are to be saved as the parameters.
Regards,
Ravi
04-05-2006 5:50 PM
Yes the function module SAVE_TEXT is used to save texts into STXH and STXL tables.
YOu need to pass the object number and the lines of text that are to be saved as the parameters.
Regards,
Ravi
04-05-2006 6:00 PM
Hi,
Thanks for the reply, but I have not seen a sample that the save_text function was used for a custom table, can you show what parameters are needed.
04-05-2006 6:04 PM
Hi,
Pl take a look at the following code & mdify it to suit your needs.. Firstoff you must load your custom table into an itab & pass it to t_lines..
w_thead-tdobject = 'ANLA'.
w_thead-tdname = w_assetcreated.
w_thead-tdid = 'XLTX'.
w_thead-tdspras = sy-langu.
clear: w_nochars, t_tline.
refresh: t_tline.
w_length = strlen( t_assets-longtext ) - 1.
if t_assets-longtext+w_length(1) = '"'.
t_assets-longtext+w_length(1) = space.
endif.
shift t_assets-longtext left deleting leading ' "'.
while w_nochars < w_length.
t_tline-tdline = t_assets-longtext+w_nochars(132).
append t_tline.
w_nochars = w_nochars + 132.
endwhile.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
* CLIENT = SY-MANDT
HEADER = w_thead
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
LINES = t_tline
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Suresh Datti
04-05-2006 6:06 PM
You can use SAVE_TEXT for saving custom test object/ids. Create you custom text Object and ID via SE75, then you can use this in the SAVE_TEXT function module. You will have to come up with a naming convention. For example, we have a custom it request system, each request has a number, we have associated text object/ids the requests. The name that is used for the SAVE_TEXT function module is the request number that the text is to be tied to.
Regards,
Rich Heilman
04-05-2006 7:03 PM
04-06-2006 5:17 PM
Hi Rich,
Is there a funtion module that is used to delete the records in STXH and STXL that were saved by the FM SAVE_TEXT?
Thanks,
Ricky
04-06-2006 5:19 PM
04-06-2006 5:19 PM
04-07-2006 11:49 AM
Hi,
Is it standard text (or) dynamic text?
If it is dynamic text then u need to use these function modules to read the data dyanamically and also to save and delete.
read_text, save_text ,delete_text.
If it is standard text then u need to include that text using include text statement.
Hope this helps.
vasantha gutta.
05-03-2007 5:03 AM