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: 

SAVE_TEXT

Former Member
0 Kudos

Hi Experts,

Can any body tell me what is the purpose of fm SAVE_TEXT?

how to pass parameters with example?

see the follwong code:

DATA: BASICTEXT TYPE TLINE OCCURS 0 WITH HEADER LINE.

DATA: BASIC_TEXT LIKE THEAD OCCURS 0 WITH HEADER LINE.

BASIC_TEXT-TDOBJECT = 'PRODUCT'.

BASIC_TEXT-TDNAME = proguid.

BASIC_TEXT-TDID = 'BASE'.

BASIC_TEXT-TDSPRAS = 'EN'.

APPEND BASIC_TEXT.

here proguid has value.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = BASIC_TEXT

  • INSERT = ' '

  • SAVEMODE_DIRECT = ' '

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • FUNCTION =

  • NEWHEADER =

TABLES

LINES = BASICTEXT

  • 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.

So nothing is coming in BASICTEXT..

any suggessions on this?

Regards

6 REPLIES 6

Former Member
0 Kudos

Hello Ravi,

The Purpose of save_text is The function module writes a text module to the text file or text

memory, depending on the specific text object.

The module can be used to change existing texts and to create new texts.

If it is clear that it is a new text, this can be specified via the

parameter INSERT. The result is better performance as a test read is not

performed.

U have to use the FM like this.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

header = po_head

INSERT = ' '

savemode_direct = 'X'

OWNER_SPECIFIED = ' '

IMPORTING

FUNCTION =

newheader = po_head

TABLES

lines = pt_lines

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5.

If useful reward points.

Vasanth

andreas_mann3
Active Contributor
0 Kudos

hi,

use fm INIT_TEXT 1st

->

A.

Former Member
0 Kudos

Hey,

You need to pass the text object details in BASIC_TEXT and the text lines in BASICTEXT. In your code BASICTEXT has no values.

Add some lines to BASICTEXT table and execute your code. You should be able to see the text.

Sample code.

DATA: wa_line LIKE tline.

wa_line-tdline = 'line1'.

APPEND wa_line TO basictext.

APPEND wa_line TO basictext.

-Kiran

0 Kudos

Hello experts,

I have gone through the chain of mails. I have a related query. We are trying to implementing the PCRs(Personnel change Requests) for Adobe Inc. Does PCRs use the Save_text function modules to store the Form data and retrieve it at each level of approval through Read_data?

If yes, do the same FMs are also used to store the Application data that is pulled into the form when the PCR (PDF form) is first time rendered onto Portal by any initiator.

Thanks

Narasimha

0 Kudos

narashima,

save text is basically to input text in SAp..for example Material text, Sales Text..

you have to pass the Object ID , ID and other parameters to it,...

Former Member
0 Kudos

Hi Binoo,

I see many replies but i thought may be my answer may also help you in some way.Save_text is a FM use to save the text object mentioned with its entries given.This FM may be used if we need to update or create the text that we had entered .

To create the text we may use the save_text to save the text that had been appended to the object.

When we call the function save_text we have following to be given,

header:<i>a structure to provide the details of the text object</i>

Now,

Tables:<i>internal table that can store the texts.After creatin a sub structure i use ,

APPEND <sub-struct> TO <internal table>.

where the sub-struct is TYPE tline.

The internal table is type <table-type of Tline> also.</i>

All the exceptions need to be given in a real case.

Award point if useful also close the query.

Thank you.

<i></i>