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: 

Standard Text

former_member184386
Active Participant
0 Kudos

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

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

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

10 REPLIES 10

former_member181962
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

Thanks Rich! This is just what I needed to know!

0 Kudos

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

0 Kudos

DELETE_TEXT

0 Kudos

Yes sir, try DELETE_TEXT.

call function 'DELETE_TEXT'
  exporting
    id                    = 'ZID'
    language              = sy-langu
    name                  = the_name
    object                = 'ZOBJECT'.

Regards,

Rich Heilman

Former Member
0 Kudos

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.

Former Member
0 Kudos

HI