2007 Dec 12 8:16 PM
Hi Friends,
I have to Upload the long text in the Operations of Functional Location Task lists.
I tried using the FM SAVE_TEXT, It returns sy-subrc as 0, but no text is being saved.
I found similar problems in the forum, but nothing was useful.
Appricitiate your help. Thanks in advance
Thanks,
Satish
2007 Dec 12 8:24 PM
Have you tried using the parameter SAVEMODE_DIRECT = 'X'.?
Regards,
Naimesh Patel
2007 Dec 12 8:26 PM
Hi Naimesh,
Thanks for the reply.
Yes, I tried it is not working.
Regards,
Satish
2007 Dec 12 8:27 PM
In the forum i found below answer and it has been answered, But i couldn't understand what he says
<i>I prefer to do a recording to register the LT in LSMW.
I would navigate in the transaction to get the LT editor (Line editor) and enter a * in the tag of second line & save the transaction where the LT gets registered and later update the LT by SAVE_TEXT FM.</i>
Regards,
Satish
2007 Dec 12 8:34 PM
Check are you passing proper Header information.
Set break point at SAVE_TEXT FM .
Now go to IA12 and try to insert text in your text id and save it.
When system stops at the breakpoint, check all the import parameter.
You need to pass in the same fashion what you get in the debugging.
Regards,
Naimesh Patel
2007 Dec 12 8:29 PM
2007 Dec 12 8:33 PM
Rob,
This is my code, i am filling the header
SORT git_tapl.
SORT git_plpo.
LOOP AT git_data INTO wa_data.
IF wa_data-text1 IS NOT INITIAL.
CALL FUNCTION 'TR_SPLIT_TEXT'
EXPORTING
iv_text = wa_data-text1
iv_len = 40
IMPORTING
et_lines = git_et_lines.
READ TABLE git_tapl INTO wa_tapl
WITH KEY tplnr = wa_data-tplnr
plnal = wa_data-plnal BINARY SEARCH.
IF sy-subrc = 0.
READ TABLE git_plpo INTO wa_plpo
WITH KEY plnty = wa_tapl-plnty
plnnr = wa_tapl-plnnr
vornr = wa_data-vornr
BINARY SEARCH.
IF sy-subrc = 0.
CONCATENATE wa_plpo-mandt
wa_plpo-plnty
wa_plpo-plnnr
wa_plpo-plnkn
wa_plpo-zaehl
INTO gv_name.
ENDIF.
ENDIF.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
id = 'PLPO'
language = 'E'
name = gv_name
object = 'ROUTING'
IMPORTING
header = gv_header
TABLES
lines = git_lines.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR : wa_et_lines.
*** Structure mapping
LOOP AT git_et_lines INTO wa_et_lines.
wa_lines-tdformat = '*'.
wa_lines-tdline = wa_et_lines.
APPEND wa_lines TO git_lines.
CLEAR wa_lines.
ENDLOOP.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = gv_header
insert = ' '
savemode_direct = 'X'
TABLES
lines = git_lines.
IF sy-subrc = 0.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = 'ROUTING'
NAME = gv_name
ID = 'PLPO'
LANGUAGE = 'E'
SAVEMODE_DIRECT = 'X'
KEEP = 'X'
* LOCAL_CAT = ' '
* IMPORTING
* COMMIT_COUNT =
* TABLES
* T_OBJECT =
* T_NAME =
* T_ID =
* T_LANGUAGE =
.
ENDIF.
ENDIF.
It is populating the header with correct details. GIT_LINES is also having text, SAVE_TEXT is also returning sy-subrc = 0. But text is not there....
Regards,
Satish
2007 Dec 12 8:39 PM
Try to create the GV_NAME like this:
gv_name+0(3) = sy-mandt.
gv_name+3(1) = wa_plpo-plnty.
gv_name+4(8) = wa_plpo-plnnr.
gv_name+12(8) = wa_plpo-plnkn.
gv_name+20(8) = wa_plpo-zaehl.
If you have any space in the PLNNR, concatenate will remove those space and key will no loger effective.
Regards,
Naimesh Patel
2007 Dec 12 8:42 PM
Hi Naimesh,
That is not the problem. GV_NAME is getting properly.
Regards,
Satish
2007 Dec 12 9:04 PM
2007 Dec 12 9:29 PM
Guys,
It is working if i do like this before using SAVE_TEXT function module. Is it safe to use?
UPDATE plpo SET txtsp = 'E'
WHERE plnty = wa_plpo-plnty
AND plnnr = wa_plpo-plnnr
AND vornr = wa_plpo-vornr.
Regards,
Satish
2007 Dec 12 9:34 PM
2007 Dec 12 11:07 PM
Sorry guys, it is not working even after adding UPDATE Statement. It worked for the first time, Again giving problem.
Anybody can help....
I am stuckup with this guys, Nobody has answer for this? Nobody faced this problem?
Thanks,
Satish
Message was edited by:
Satish Panakala
2007 Dec 13 10:03 PM
Satish,
There are some long texts like this one (BOM item texts are one more example), where you have to set the table language field to 'E' before you can see them in the screen. The reason for this is that in the SAP code, it does READ_TEXT to read the long text only if this field is not initial. You have to update it, there is no other way other than may be trying to find a BAPI that also does the texts.
See why your update is failing. Also go directly to STXH and STXL tables to see if there are any entries. If they are there and if you are following the logic for forming the object key correctly and if your direct update is successful, it will work.
2007 Dec 13 5:27 AM