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

Saving text editor

Former Member
0 Likes
1,105

I learnt that I will need to use SAVE_TEXT module to save what is inside my text editor with the codes as follows:

-


CALL FUNCTION 'SAVE_TEXT'

EXPORTING CLIENT = SY-MANDT

HEADER = ?...

INSERT = SPACE

SAVEMODE_DIRECT = SPACE

OWNER_SPECIFIED = SPACE

IMPORTING FUNCTION =

NEWHEADER =

TABLES LINES = ?...

EXCEPTIONS ID =

LANGUAGE =

NAME =

OBJECT =

check this link

http://help.sap.com/saphelp_40b/helpdata/en/d6/0db8ef494511d182b70000e829fbfe/content.htm

-


For the line of code TABLE LINES = ?, what should I put for the ? to store the value of what is in the text editor?

May I ask if someone can give me examples of SAVE_TEXT for text editor?

Points will be given to any answer that can somehow answer my questions.

12 REPLIES 12
Read only

Former Member
0 Likes
1,066

Hi,

To determine the values for HEADER, Use menupath: Goto->Header in editor.

Over here, you will find details like Name, Object, Language and ID.

Observe the pattern for Name, it depends on the object. ( for sales order item it can be: <sales order number + item number).

Pass these information to the structure of type THEAD and use the same for FM: SAVE_TEXT.

Regards

Eswar

Read only

0 Likes
1,066

Then how about my TABLE LINES = ? code? What should I put at ? to store my text editor?

Read only

0 Likes
1,066

TABLE_LINES will store the text content of your editor.

Field TDLINE will have the content and TDFORMAT is to store paragraph format if any.

Regards

Eswar

Read only

0 Likes
1,066

So TDLINE and TDFORMAT is the default field names of my text editor?

Read only

Former Member
0 Likes
1,066

This is the Bare minimum required parameters for SAVE_TEXT

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

HEADER = XTHEAD

SAVEMODE_DIRECT = 'X'

TABLES

LINES = TLINES.

Now going back to your question.

You have to pass the Internal table TLINES with the Text that needs to be saved inTables Parameter LINES

Hope this Helps

Vinodh Balakrishnan

Read only

Former Member
0 Likes
1,066

Here is a sample with reference to my example in my first post

XTHEAD-tdobject = 'VBBK'.

XTHEAD-tdname = delivery number.

XTHEAD-tdspras = language.

XTHEAD-tdid = text id. "for example: Z022

Tlines-tdformat = '*'.

Tlines-tdline = your text that you want to write .

Hope this helps

Vinodh Balakrishnan

Read only

0 Likes
1,066

How am I going to save my text editor? From what I see your codes, you used non-text editor to save.

Read only

0 Likes
1,066

Yes JuzMe

TDFORMAT and TDLINE are from editor.

Regards

Eswar

Read only

0 Likes
1,066

So I tried my codes in the SAVE-TEXT FM as:

-


TABLES

LINES = TDLINE

-


But i need to declare TDLINE first? Any example of declaration for me to refer?

Read only

0 Likes
1,066

Check below example:


DATA: st_head TYPE thead,
      i_tline TYPE STANDARD TABLE OF tline,
      wa_tline TYPE tline.

CALL FUNCTION 'SAVE_TEXT'
  EXPORTING
    header          = st_head
    savemode_direct = 'X'
  TABLES
    lines           = i_tline.

Regards

Eswar

Read only

0 Likes
1,066

I tried the codes provided. But I could not really save it to my database. How am i suppose to do that?

My table name is ZPROGRAM_TABLE and I want to save what is in the text editor into the column name called PROGRAM_CODE. How am I suppose to modify the save text accordingly to be able to save to my table?

Read only

Former Member
0 Likes
1,066

Declare

DATA: XTHEAD LIKE THEAD .

DATA: TLINES LIKE TLINE OCCURS 0 WITH HEADER LINE.

Vinodh Balakrishnan