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

problem with FM SAVE_TEXT

Former Member
0 Likes
1,460

Hi experts,

i'm using FM SAVE_TEXT to create a text but it does not save the text.

here is the code:


table1-tdobject = 'KNB1'.
table1-tdname = '0000010003RTAM'.
table1-tdid = '0001'.
table1-tdspras = 'EN'.

APPEND table1.


CALL FUNCTION 'SAVE_TEXT'
  EXPORTING
   client                = sy-mandt
    header                = table1
    insert                = 'X'
*    savemode_direct       = 'X'
*   OWNER_SPECIFIED       = ' '
*   LOCAL_CAT             = ' '
  IMPORTING
    function              = function
    newheader             = table3
  TABLES
    lines                 = table2
* EXCEPTIONS
*   ID                    = 1
*   LANGUAGE              = 2
*   NAME                  = 3
*   OBJECT                = 4
*   OTHERS                = 5
          .


CALL FUNCTION 'COMMIT_TEXT'
  EXPORTING
    object                = 'KNB1'
    name                  = '0000010003RTAM'
    id                    = '0001'
    language              = '1'
    savemode_direct       = 'X'
*   KEEP                  = ' '
*   LOCAL_CAT             = ' '
  IMPORTING
    commit_count          = count
  TABLES
    t_object              = t_object
    t_name                = t_name
    t_id                  = t_id
    t_language            = t_language
          .

Parameter count take value 0 and parameter function take value '' (empty string).

What should i do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
748

>

> Hi experts,

> 
> 
> i'm using FM SAVE_TEXT to create a text but it does not save the text.
> here is the code:
> 

> table1-tdobject = 'KNB1'.

> table1-tdname = '0000010003RTAM'.

> table1-tdid = '0001'.

> table1-tdspras = 'EN'. <-- Use SY-LANGU instead>

> APPEND table1. <-- No Need for this

>

>

> CALL FUNCTION 'SAVE_TEXT'

> EXPORTING

> client = sy-mandt

> header = table1

> insert = 'X'

> * savemode_direct = 'X' <-- Uncomment this one.

> * OWNER_SPECIFIED = ' '

> * LOCAL_CAT = ' '

> IMPORTING

> function = function

> newheader = table3

> TABLES

> lines = table2 <-- Is this table filled up with the text you need?

> * EXCEPTIONS <-- Uncomment these exceptions and handle them, you will know if there is an error.

> * ID = 1

> * LANGUAGE = 2

> * NAME = 3

> * OBJECT = 4

> * OTHERS = 5

> .

>

>

> CALL FUNCTION 'COMMIT_TEXT' <-- You Don't need this SAVE_TEXT will commit the text also.

> EXPORTING

> object = 'KNB1'

> name = '0000010003RTAM'

> id = '0001'

> language = '1'

> savemode_direct = 'X'

> * KEEP = ' '

> * LOCAL_CAT = ' '

> IMPORTING

> commit_count = count

> TABLES

> t_object = t_object

> t_name = t_name

> t_id = t_id

> t_language = t_language

> .

>

>


> 
> Parameter count take value 0 and parameter function take value '' (empty string).
> 
> What should i do?{quote}

2 REPLIES 2
Read only

Former Member
0 Likes
748

Hi

Try to use the parameter SAVEMODE_DIRECT (= 'X')

table1-tdobject = 'KNB1'.
table1-tdname = '0000010003RTAM'.
table1-tdid = '0001'.
table1-tdspras = 'EN'.
 
*APPEND table1. "<--- it's flat structure, it's useless 
 
 
CALL FUNCTION 'SAVE_TEXT'
  EXPORTING
   client                = sy-mandt
    header                = table1
    insert                = 'X'
*    savemode_direct       = 'X'
*   OWNER_SPECIFIED       = ' '
*   LOCAL_CAT             = ' '
  IMPORTING
    function              = function
    newheader             = table3
  TABLES
    lines                 = table2
* EXCEPTIONS
*   ID                    = 1
*   LANGUAGE              = 2
*   NAME                  = 3
*   OBJECT                = 4
*   OTHERS                = 5

table2: where is the text?

Max

Read only

Former Member
0 Likes
749

>

> Hi experts,

> 
> 
> i'm using FM SAVE_TEXT to create a text but it does not save the text.
> here is the code:
> 

> table1-tdobject = 'KNB1'.

> table1-tdname = '0000010003RTAM'.

> table1-tdid = '0001'.

> table1-tdspras = 'EN'. <-- Use SY-LANGU instead>

> APPEND table1. <-- No Need for this

>

>

> CALL FUNCTION 'SAVE_TEXT'

> EXPORTING

> client = sy-mandt

> header = table1

> insert = 'X'

> * savemode_direct = 'X' <-- Uncomment this one.

> * OWNER_SPECIFIED = ' '

> * LOCAL_CAT = ' '

> IMPORTING

> function = function

> newheader = table3

> TABLES

> lines = table2 <-- Is this table filled up with the text you need?

> * EXCEPTIONS <-- Uncomment these exceptions and handle them, you will know if there is an error.

> * ID = 1

> * LANGUAGE = 2

> * NAME = 3

> * OBJECT = 4

> * OTHERS = 5

> .

>

>

> CALL FUNCTION 'COMMIT_TEXT' <-- You Don't need this SAVE_TEXT will commit the text also.

> EXPORTING

> object = 'KNB1'

> name = '0000010003RTAM'

> id = '0001'

> language = '1'

> savemode_direct = 'X'

> * KEEP = ' '

> * LOCAL_CAT = ' '

> IMPORTING

> commit_count = count

> TABLES

> t_object = t_object

> t_name = t_name

> t_id = t_id

> t_language = t_language

> .

>

>


> 
> Parameter count take value 0 and parameter function take value '' (empty string).
> 
> What should i do?{quote}