‎2009 Sep 04 3:18 PM
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?
‎2009 Sep 04 5:52 PM
>
> 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}
‎2009 Sep 04 3:54 PM
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 = 5table2: where is the text?
Max
‎2009 Sep 04 5:52 PM
>
> 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}