2006 Dec 13 10:38 PM
Hi all,
I am trying to upload confirmation text (long text) for Order confirmation (IW41) using SAVE_TEXT function module.
The problem is that if there are 3 lines of text which are to be uploaded, only the last line gets saved in the text area. Here is the code which I have used for testing -
DATA: l_thead LIKE thead,
l_tline LIKE tline occurs 0 with header line.
*l_thead-TDOBJECT = 'AUFK'.
*l_thead-TDNAME = '213000080000160'.
*l_thead-TDID = 'KOPF'.
*l_thead-TDSPRAS = 'EN'.
*l_thead-tdtxtlines = 1.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
id = 'RMEL'
language = 'E'
name = '213000000330900000001'
object = 'AUFK'
IMPORTING
header = l_thead
TABLES
lines = l_tline
EXCEPTIONS
error_message = 1
OTHERS = 2.
l_tline-tdformat = '*'.
l_tline-tdline = 'PSHO 123'.
APPEND l_tline.
l_tline-tdformat = '*'.
l_tline-tdline = 'PSHO 358'.
APPEND l_tline.
clear l_tline.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
header = l_thead
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
tables
lines = l_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.
commit work.
As seen from the code, the last text line ie PSHO 358 is seen in the order confirmation text. Please if anyone can provide any solution for this.
Shoma
Hi all,
I am trying to upload confirmation text (long text) for Order confirmation (IW41) using SAVE_TEXT function module.
The problem is that if there are 3 lines of text which are to be uploaded, only the last line gets saved in the text area. Here is the code which I have used for testing -
DATA: l_thead LIKE thead,
l_tline LIKE tline occurs 0 with header line.
*l_thead-TDOBJECT = 'AUFK'.
*l_thead-TDNAME = '213000080000160'.
*l_thead-TDID = 'KOPF'.
*l_thead-TDSPRAS = 'EN'.
*l_thead-tdtxtlines = 1.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
id = 'RMEL'
language = 'E'
name = '213000000330900000001'
object = 'AUFK'
IMPORTING
header = l_thead
TABLES
lines = l_tline
EXCEPTIONS
error_message = 1
OTHERS = 2.
l_tline-tdformat = '*'.
l_tline-tdline = 'PSHO 123'.
APPEND l_tline.
l_tline-tdformat = '*'.
l_tline-tdline = 'PSHO 358'.
APPEND l_tline.
clear l_tline.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
header = l_thead
INSERT = 'X'
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
tables
lines = l_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.
commit work.
As seen from the code, the last text line ie PSHO 358 is seen in the order confirmation text. Please if anyone can provide any solution for this.
Shoma
2006 Dec 16 10:47 AM
Hi
Check what you are passing in the Header while calling SAVE_TEXT.
Regards,
Raj
2006 Dec 16 11:56 AM
Hi,
commit work is not enough because text is buffered in special areas. First use Function Module COMMIT_TEXT.
regards,
Clemens
2006 Dec 16 1:11 PM
Hi,
Can you please try by passing the body of the internal table to the function module.
Thanks,
Rashmi
2006 Dec 16 2:25 PM
Rashmi,
please!
The function is defined with a TABLES parameter - you can't transfer anything except the body.
Regards,
Clemens
You can write a small test program to proove your (and my) assumption.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |