Saving long text - problem
Hi,
I am having a long text which has 10lines.. i need to save that long text from a file using migration.
first i need to store that text in a field for of an internal table & then save it in a long text ..
can any one help me out in providing the soln/alternatives to fix this..
Pls. do the needful.
thanks
john
Hi John,
From what I know about long text in SAP is that they are stored based on ID, Object and Language. First you probabaly need to set them using tcode SE75(Change / Add New Object and ID)
Then in your program you can use several FM that process long text.
My favorite is
CALL FUNCTION 'LANGTEXT_ONLY'
EXPORTING
object = *Object
object_nr = *Object_no
spras = *language
txtid = *ID
x_xaktyp = *aktyp
save_mode = 'X'
text_history = 'x'
text_property = 'x'
IMPORTING
ind_inv = *line
inv_exist = *exist
TABLES
t_inlines = t_linetab.
This FM will call longtext editor and also set the mode
aktyp = H => create new,
aktyp = V => change
aktyp = A => read only
Another useful FM is READ_TEXT and SAVE_TEXT. Try to experiment with it and see any documentation for detail.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = *ID
language = *Language
name = *Name
object = *Object
IMPORTING
header = t_headltx
TABLES
lines = t_linetab
EXCEPTIONS
not_found = 1.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = t_headltx
savemode_direct = 'X'
TABLES
lines = t_linetab.
Hope it helps
Regards
Hadi
Similar Messages
-
Hello
We are using SRM7 Extended classic scenario.
We don't use shopping carts, rather create POs directly in SRM which will be transferred to ECC as per the standard.
Error:
I am getting an error "Error while saving Long Texts" during my PO creation. I get this message in a small pop-up screen. As soon as i click ok or close the pop up screen it kicks me out of the PO creation screen back into the main SRM screen.
When:
During the PO Creation
Any specific situation:
Yes, only for Material POs
This is happening when I am creating the PO with a Material code. I can create free text PO without any issues.
This is a standard message and the message number is 022.
Thaks for the help guys.Hi,
To confirm can you check commeting "getOADBTransaction().commit();" gives any error message?
If yes then you can try the following option:
Have you checked whether the "/" is changed to "\" in the dbc file?
In the following two entries the slash has to be made as shown below:
APPS_JDBC_URL=jdbc\:oracle\:thin\:@(DESCRIPTION\=(ADDRESS_LIST\=(LOAD_BALANCE\=YES)(FAILOVER\=YES)(ADDRESS\=(PROTOCOL\=tcp)(HOST\=10.100.503.6)(PORT\=1521)))(CONNECT_DATA\=(SERVICE_NAME\=VIS)))
JDBC\:processEscapes=true
Thanks and Regards,
Lacman -
Problem in Saving long texts from IC Webclient
Hi,
I have a little problem with BP long text transfert.
In IC Webclient, I identify a account and I create a long text (for exemple a Accounting Note).
I can find this text in CRM (t-code BP->long text) but, it is not transfert to ECC (XD03->Extra->text).
If I create a accounting note directly in CRM, it is transfert to ECC !!
The transaction PITX is customized in ECC.
I work with CRM5.0 and ECC6.
What I missed ?
GaétanHi Gaétan,
Maybe the BDOC BUPA_MAIN responsible to export the change to ECC is not being created when you make the change in IC Webclient.
Can you confirm it in SMW01? Try to make a change in a partner long text in IC webclient, and check if the bdoc was sent to R3.
Then try it in BP t-code, and check it again.
If this is the problem, maybe you should contact OSS suport.
Kind regards,
Garcia -
Hi Everyone,
I am implementing BADI "WORKORDER_UPDATE". The requirement is there should be no changes made on the IW32 transaction. I have successfully implemented the BADI and it is now giving an error when we try to change anything on the order in IW32.
The problem is with the longtext. There is a field TXCHG which I used to see if there are any changes being made to the long text. When someone changes the lontext and tries to save it, it gives an error but still retains the changed longtext. The code works fine with all other changes(I mean it gives an error when they try to change anything in IW32 and will not retain the changes). But this does not happen in the case of long text. It gives an error but still has the changed long text as part of the order.
Any suggestions on how to proceeed? I am using instance Before_Update in this BADI.
Thanks
Kumar.Do u mean after giving the Error message, even if u come out without saving it is keeping the changes?
If the answer to the above question is no then try the following procedure:
Read the long text using READ_TEXT (function module) by passing the TDID, TDOBJECT, TDSPRAS, TDNAME (u can get these details by going through the menu edit-> go to header).
Store that in an internal table and then append all the lines of this internal table into a string Variable and assign this variable's text to the field in which long text is being displayed.
This should work bcoz , in the database only the original Long text is stored and we are retrieving it and displaying back in the relevant field.
Please reply if it works..... -
ECC5.0 Long text Problem in QM02
Hi friends,
when i am create Item long text in Qm01 when i am reading the text in from FM read_text in tlines my structure is
tdofrmat ,tdline
text1(72)
= text1(72)
text2(59)
after saving the long text and when i am trying to read in QM02 mode ,with same FM i am getting as.
tdofrmat ,tdline
X> * text1(72)
X> * text1(72)
X> * text2(59)
Hope u under stand my problem.
How to Indentify which line is continous to which one,where the word was splitted.i searched FM's but i didn't get.i tried with "Newline" by refering Class No result.Gurus kindly Provide the solution......
In Advance Thanks...Hi,
Did you try this:
text1(72)
text1+72(72)
text2(59)
Regards. -
Hi experts,
Iam working on dialog programing and i have requirement to save two long texts at a time.
I put the long texts(custom controls) in tab strip control(container1,container2).
My problem is while saving....
1)if i enter data only in first container the data is getting saved.
2)If i enter data in second container it is getting saved.
3)But if i enter data in both the containers, <b>only second container data is getting saved.</b>
What might be the reason? What iam doing wrong?
(commit text written after the save_text.)
Reward guaraneed
thanks
kakiHi Kaki,
Include the logic to save data from TAB1 under SAVE of Tab2.
CASE ok_code.
WHEN 'SAVE'.
t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.
ENDCASE.
<b>This is tab2 container2 code</b>
CASE ok_code.
WHEN 'SAVE'.
CALL METHOD notes->get_text_as_stream
IMPORTING
text = notes_tab[].
IF flag_cont2 = 1.
LOOP AT notes_tab.
t_notes-tdformat = '/'.
t_notes-tdline = notes_tab.
APPEND t_notes.
ENDLOOP.
ENDIF.
t_nhead-tdname = ag_no.
t_nhead-tdid = 'Z002'.
t_nhead-tdspras = sy-langu.
t_nhead-tdobject = 'ZAGREEMENT'.
PERFORM save_text.
CALL FUNCTION 'COMMIT_TEXT'.
<i><b>* To updated Tab1, when SAVE is clicked on TAB2</b></i>
<b> t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.</b>
ENDCASE.
Best regards,
Prashant
Message was edited by: Prashant Patil -
Long text problem while uploading Inspection plan through BDC.
Hi,
I am facing some problem while uploading the inspection plan. There are few MICs for which we are having long text, while uploading the inspection plan through BDC - some other long text is getting copied into the MIC's long text. After checking I came to know that in function module, read_text - some text which is stored in ABAP memory is getting copied into the inspection plan.
I am working in SAP release 4.7. I have checked with SAP notes: 97419, but it is also not satisfying.
Waiting for quick solution.
Thanks in advance.
FahiéHi a®s,
Thanks a lot for your kind reply.
My requirement is I want to maintain long text for few MICs (which are not having long texts at MIC level) in inspection plan (QP01).
When I am trying to manually assign the MIC's to inspection plan (QP01), long text is copied whereas I am not clicking the long text icon in (QP01). Long text is not maintained in MIC level, still some long text is copied to this MIC. This was also happening while uploading the inspection plan thro' BDC.
I believe what you have mentioned about function module SAVE_TEXT cannot be used here since long text is already copied before we pass the long text. Also if we pass some long text, still apart from the long text what we have passed there is some other long text copied (extra long text).
Waiting for quick solution.
Thanks in advance.
Fahié -
Long Text problem in Process order header
Hi All,
I am using SAVE_TEXT FM to update the header long text in process order.
Also, I am updating the field AUFK-LTEXT = 'E'.
But when i display the order and click on long text, it does not display any thing as the text is not saved.
When I update the text directly in the order using COR2, it gets saved.
Does anyone know why the text is not being saved through FM SAVE_TEXT?
Also tried COMMIT WORK but was not successful.
The paramters I am passing to the FM are
TDOBJECT = 'AUFK'
TDID = 'KOPF'
TDSPRAS = SY-LANGU
TDNAME = sy-mandt+order number with leading zeros.
and the text lines in internal table.
Am I missing anything else here?
Thanks,
SandeepHi Sandeep,
First check table STXH for the order which you saved manually, in order to verify that the values you are passing to the FM SAVE_TEXT are correct.
Also check the documentation which is supplied with this function to determine the INSERT and SAVEMODE_DIRECT values.
Also maybe check function COMMIT_TEXT and its documentation.
Regards,
Robert
PS. also test the scenario in which text s/b added to already existing text. The SAVE_TEXT function wipes out everything and therefore you first should read the existing text (READ_TEXT) to retrieve the current text and save this together with the new text using SAVE_TEXT. (check function group STXD for possible related functions to use).
PPS. Thinking about my comments under PS., I recall now that this was the symptom of the long text passed on through BAPI_SALESORDER_CHANGE and therefore maybe this is not the case for SAVE_TEXT.
Edited by: RJ. Schamhart on Feb 3, 2011 4:53 PM -
Hi ,
I have to do a data upload for IA05 transaction.
I have done the recording for BDC.
But i am facing problem in Long text upload (SAVE_TEXT), because the TEXT NAME logic requires Group number. This group number is created when the transaction is executed.
Do by any means i can get the group number at runtime because will executing the transaction i can see the group number which is created.
Else does anybody have some other way to do this. Please suggest.
Thanks & Regards
KapilHi,
<b>This is the only way you can do this.</b>
And you are not hardcoding anything. If BDC is successful and you get the 'Group numer" just create a text using SAVE_TEXT FM.
Let me know if you have something else on your mind.
Regards,
RS -
Long text problem in sap script
Hi Experts,
I have craeted sap script for payment print progrem.. in my sap script one window is text window... client want more then 300 char for that window. for that i use read_text function module... its working fine... but problem is it retrive only one line from long text editor. only 70 char i got.
below is my coding......
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = '0001'
LANGUAGE = sy-langu
NAME = NAME
OBJECT = 'DOC_ITEM'
TABLES
LINES = 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.
LOOP AT LINES.
n = 0.
l = 132.
text+n(l) = lines-tdline.
n = n + 132.
l = l + 132.
ENDLOOP.
in sap script i have direct pass lines-tdline
*&lines-tdline&
Please suggest me which point i missing?
Thanks
JigarHi All,
The standard text will be stored in Name = ORDCONF_TEXT_(sales org)_(distributionchannel)_(division)
Text ID = ZSD
Examples: ORDCONF_TEXT_4000_01_01 , ORDCONF_TEXT_4000_01_80 , ORDCONF_TEXT_1000_01_01.
Requirement :
The print program /form will need to pick up the appropriate standard text based on the Sales Area (combination of Sales Org / Distribution Center / Division) of the sales order [VBAK-VKORG / VTWEG / SPART], provided a standard text has been created for that Sales Area. Itu2019s not required that every sales area have a standard text, so if one is not found, this step should be skipped and the rest of the print program executed.
The new text should print after 2 blank lines after the Printable Notes text (which is after the line items and the Total Net Price prints).
The font should be the same size as the Printable Notes, but bolded rather than italicized.
The text should print in the same columns as the Printable Notes currently print in (Material Description / Scheduled Ship Date / Quantity) .
So the logic i have used is this below code:
I used a subroutine in the layout of the main window becoz i need to print it in the main window below after 2 blank lines of line items.
This is logic in the layout:
/:PERFORM GET_OBJECT IN PROGRAM ZSDRP001_ORD_CONF_IRE
/:USING &VBDKA-VBELN&
/:CHANGING &ORDCONF_TEXT&
/:ENDFORM
/:INCLUDE &ORDCONF_TEXT& OBJECT TEXT ID ZSD PARAGRAPH A1
I called this subroutine in the print program:
Logic in the print program:
FORM GET_OBJECT TABLES INPUT_TAB STRUCTURE ITCSY
OUTPUT_TAB STRUCTURE ITCSY.
DATA : TMP_VBELN LIKE vbdka-VBELN,
TMP_VKORG LIKE VBAK-VKORG,
TMP_VTWEG LIKE VBAK-VTWEG,
TMP_SPART LIKE VBAK-SPART,
TMP_TXNAM1(40) TYPE C VALUE 'ORDCONF_TEXT',
TMP_TXNAM2(100) TYPE C.
DATA: v_text LIKE tline-tdline.
DATA : P_V_TEXT LIKE tline-tdline.
CLEAR : TMP_TXNAM1, TMP_TXNAM2, TMP_VBELN, TMP_VKORG, TMP_VTWEG, TMP_SPART.
READ TABLE INPUT_TAB WITH KEY NAME = 'vbdka-VBELN'.
IF SY-SUBRC = 0.
tmp_vbeln = input_tab-value.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING INPUT = TMP_VBELN
I
MPORTING OUTPUT = TMP_VBELN .
CLEAR VBAK.
SELECT SINGLE VKORG VTWEG SPART INTO (TMP_VKORG, TMP_VTWEG, TMP_SPART)
FROM VBAK WHERE VBELN EQ TMP_VBELN.
IF NOT TMP_VKORG IS INITIAL
AND NOT TMP_VTWEG IS INITIAL
AND NOT TMP_SPART IS INITIAL.
CONCATENATE TMP_TXNAM1 TMP_VKORG tmp_vtweg tmp_spart into TMP_TXNAM2 SEPARATED BY '_'.
endif.
CONDENSE TMP_TXNAM2 NO-GAPS.
PERFORM read_order_text USING TMP_TXNAM2 CHANGING v_text.
READ TABLE output_tab WITH KEY NAME = 'ORDCONF_TEXT'.
IF SY-SUBRC = 0.
output_tab-value = P_V_TEXT.
MODIFY output_tab index sy-tabix.
endif.
endform.
FORM READ_ORDER_TEXT USING P_TMP_TXNAM2 CHANGING P_V_TEXT LIKE tline-tdline.
DATA: ztdid LIKE thead-tdid,
zlang LIKE thead-tdspras,
zobj LIKE thead-tdobject,
zname LIKE thead-tdname.
DATA: tlines TYPE STANDARD TABLE OF tline WITH HEADER LINE
thead LIKE thead.
CLEAR P_V_TEXT.
ztdid = 'ZSD'.
zlang = 'E'.
zobj = 'TEXT'.
zname = P_TMP_TXNAM2.
CLEAR tlines.
REFRESH tlines.
CALL FUNCTION 'READ_TEXT'
EXPORTING
object = zobj
name = zname
id = ztdid
language = zlang
IMPORTING
header = thead
TABLES
lines = tlines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT tlines WHERE NOT tdline IS INITIAL.
MOVE tlines-tdline TO P_V_TEXT.
ENDLOOP.
ENDFORM.
But still its not getting printed .Plz tell me where i am going wrong.
Thanks,
Suman -
Issue while saving long text through MS Word Editor in SAP
Hi All,
I am facing some issue while saving text through Word editor in SAP(like Notes in Installation or Long Text in device location).
After entering the text, when I am pressing the Back button, it says text transferred successfully, but when I try to see the text again, its not in the proper format.
Every time I go to the word editor, some text is deleted.
Thanks in advance for your help.
Manoj VatwaniHi Manoj,
Can you share some screenshot for the formatting issue that you are facing.
Thanks,
Amlan -
Hi,
I have assigned long text in ABC PRT. After that I assigned this ABC prt to material (XYZ) routing to operation no 100. But surprisingly long text of ABC prt has not transferred to routing and I am unable to see it in XYZ routing 100 operation.
Does anybody have any idea about this issue?
Your valuble input is highly appericiated.
Regards,
AlexHi,
We should not get such type of error.
Please check once.
Select the operation no 100-> PRT Overview-> Select the PRT BAsic Data- > Long text.
In case you didn't find it there please give some more details of the problem.
Regards
JB -
Problem in saving long text data from custom
Hi Expert,
I am working on a screen exit in QM01. I have created a editor box(like the description box under Description tab in QM01) using class cl_gui_custom_container and cl_gui_textedit. I am able to create and display the text I type in the box alongwith other standard changes but if I try to change and save the text only in the custom text box, it is not getting saved. I debugged and found out that the standard does not recognize any change in the custom controller box.
Please suggest.
Thanks in advance,
Sangeeta.
Edited by: Sangeeta on Oct 1, 2009 7:01 AMSolved on my own. Consider all the scenarios by Using read_text in PBO and edit_text FM in PAI. At last save_text in the PAI.
-
Long text problem in BW query and Key figure name
Hello
We're using SAP BO 4.0 (IDT) and SAP BW as a datasource. Maybe someone knows:
1. How to change the name of keyfigure, which now appears as Formula 1, Formula 2 etc. In BW every single key figure has it's own name Sales, Purchases etc. What I'm missing here?
2.As you well might know every single char infoobject has it's own Long\Short\medium which now appears as an attribute. When I choose multiple Long definitions then the execution of a BEx query fails with 'Inconsistent answers'. In Universe Designer we can change the objects name, but how to proceed here. Do I need to change something on a Bex query level?
I'm well familiar with SAP BO, but due to lack of experience in SAP I'' ve hit astumbling block with these 2 things> Any assistance would be more than welcome
Thanks in advaceHi,
for (1) - that doesn't sound right... i think your KF are calculated KF (CKF) possibly with a formulae variable .. or something, which is supposed to populate the name, based on a user response ?
Or maybe you've got non-unique KF descriptions, and this is some system imposed nomenclature?
for (2) i'm not so sure, but you may have to change the infoobject text setting, globally, in RSA1. webi won't like non-unique labels if the keys are different.. How does it look with the default 'key and text' (medium) setting?
yes you can change the characteristic display properties in Bex query designer, but i have a funny feeling that it doesn't get consumed by webi over that API. (it's native OLAP stuff for BEx really...)
Good luck
H -
Best practice for saving long text messages?
I'm writing a cook book type program and for the instructions I expect that some of the steps can get quite lengthy. Is it acceptable to store a paragraph in a single string object or is there a better method?
Thanks in advance.If there's no further structure to it, String sounds fine.
Maybe you are looking for
-
hi ! i want to create an xml file frim hierarchical data (n depth) . please advise me how to create xml file using dom and how to write dom elements to disk...
-
Share FCPX with Blu-ray USB3 LaCie writer boot error
Hi I've been around the bush and back looking at how to burn a blu-ray movie to a disc from FCPX and a slim Blu-ray LaCie drive. I was able to burn a 5 minute movie from FCPX without any trouble but as soon as I try and burn something larger (like a
-
Is it possible to add weather to my drop down menu on ios7?
Is it possible to add weather to my drop down menu on ios7?
-
Multiple Divs (one static, one scrolling)
Ok, So I am working on a project in which i have a dreamweaver website that includes lots of flash and lots of text. However, some pages do not contain flash, and will need all text. In a nutshell, I have a center content div that will eventually con
-
Hi, I have an iMac, and I'm running OS X 10.6.5. I'm trying to use an Audio Technica USB turntable to convert LPs to MP3. I used this turntable on my old PC, it connected fine, and I had no issues. However I recently switched to Mac, and my iMac is n