‎2008 Oct 01 9:33 AM
Hi All,
I have a small requirement. I need to store long text data (maybe 5000 characters) in the SAP. And also I need to retrieve the data whenever I need it.
Please guide me how can I achieve the same technically.
Just for your information, I have designed a z-table with the following fields -
1. MANDT
2. KEY FIELD
3. A field whose data type is SMO_LNGTXT (Attachment Pointer - long text data)
But I do not know how to make use of attachment pointer in order to store and retrieve long text data.
Please guide me how to achieve this, either by following the approach I have taken up or any new approach which u suggest.
Thanks in advance,
Pradipta Paul.
‎2008 Oct 01 9:36 AM
use fm
READ_TEXT
to read the long text,
EDIT_TEXT to edit long Text
Regards,
Alpesh
‎2008 Oct 01 9:39 AM
But how do i do the same using these two FMs. I also need a reference to the data which I shall be storing, so that I can retrieve the sam in the future.
‎2008 Oct 01 9:37 AM
You can create a standard text for each key field using FM 'SAVE_TEXT'.
Regards,
Aparna
‎2008 Oct 01 9:45 AM
Use
TDOBJECT = 'TEXT'
TDNAME = ur key field
TDID = 'ST'
TDSPRAS = sy-langu
Create standard text using FM 'SAVE_TEXT' which will create standard text. Enter long text in 'lines' of this FM.
This will create long text which is stored in standard text for each key field.
Read standard text using FM' READ_TEXT'.
I hope this will work.
Regards,
Aparna
‎2008 Oct 02 5:53 PM
Hi All,
Thanks for the answers. But I could see that the FM cuts the text at 132 characters only. The rest of the text is missed out. Pls help me in this regard.
Regards,
Pradipta Paul.
‎2008 Oct 02 10:13 PM
Hi Pradipta,
Use the Read, Save, Delete text FMs in conjunction with these FMs:
- CONVERT_STREAM_TO_ITF_TEXT, to save text
- CONVERT_ITF_TO_STREAM_TEXT, to read and display text.
You will be using a container object cl_gui_textedit, this is the text box that will display your data.
So, to display your data, you create your object. Call READ_TEXT to get the data into an internal table and then call CONVERT_ITF_TO_STREAM_TEXT which creates another internal table which you pass to display on your screen.
After editing data from the screen, you call CONVERT_ITF_TO_STREAM_TEXT and then call SAVE_TEXT to save your data.
Hope this helps.
Filler
‎2008 Oct 01 10:09 AM
you should be carefull about the datatype
you may use lchr or rawstring
for this case
‎2008 Oct 23 5:45 AM