07-14-2011 12:07 PM
I have a Z database table in which I would like to store a long text as a field ( a string with length 2000 for example) .
I have copied stxh table into zmm_stxh table and I wass wondering about using read_text in order to read the stored text.
Now, the problem is.., how could I save text? Which type of field should I show to the user for her/him to insert text? Which function should I use to store this long text in my zmm_stxh database table?
Does someone know another way to get this out?
Thanks in advance.
07-14-2011 12:37 PM
Hello,
You can use READ_TEXT and then save the text in the SAP text database with function ..... SAVE_TEXT. In that case you would utilize standard SAP text repository. For that purpose you need to define your own text ID - transaction SE75.
For displaying the long text to the user you can use SAP's Text Edit Control being called on any event (depending on the context in your app) - URL, HotSpot field in ALV table with say first 128 characters of the text, and so on, and after clicking on that editor will be called (you can preload the text to editor window after you read it with READ_TEXT).
Text Edit Control:
[url]http://help.sap.com/saphelp_sm32/helpdata/en/7d/fe9f6f8af411d3805e00c04f99fbf0/content.htm
Good luck,
Marcin
07-14-2011 12:37 PM
Hello,
You can use READ_TEXT and then save the text in the SAP text database with function ..... SAVE_TEXT. In that case you would utilize standard SAP text repository. For that purpose you need to define your own text ID - transaction SE75.
For displaying the long text to the user you can use SAP's Text Edit Control being called on any event (depending on the context in your app) - URL, HotSpot field in ALV table with say first 128 characters of the text, and so on, and after clicking on that editor will be called (you can preload the text to editor window after you read it with READ_TEXT).
Text Edit Control:
[url]http://help.sap.com/saphelp_sm32/helpdata/en/7d/fe9f6f8af411d3805e00c04f99fbf0/content.htm
Good luck,
Marcin
07-14-2011 12:53 PM
If you just want to store a long string, SAP provides us ways (data types) to do that in a standard transparent table. Do a little research first....you do NOT want to replicate STXH and STXL, and there is, of course, absolutely no need to do that in SAP.
07-14-2011 2:16 PM
you can store the standard text name in the ztable.
you can user read_text and save_text to read and write the long text.
input to the user will be a text field. (where the user enters the long text).
once the user click on save, create a GUID, a FM will be availble to generate a GUID.
This GUID will be used as a standard text name.
using the above guid create the standard text( save the long text)
and finally push the regular data along with GUID to save the data in the ztable
07-14-2011 9:31 PM
Hi Jarizkuren, there is no need and no use to create copies of STXH and STXL. If you want to handle sap script long texts, you may create your own text ID and TEXT object (look at STXH header key fields) and maintain very efficient using SAP standard functions READ_TEXT and SAVE_TEXT.
If you just want to store not formatted text, create a table with a useful key field (i.e. numeric from number range) and one field of type STRING. Then you can store any length of text sing just as much storage as required.
Regards,
Clemens