Use SQL to get long text

Hi,
  Is it possible to retrieve the long text in STXH and STXL by SQL instead of READ_TEXT FM??  How can i covert the HEX text back to normal text??
Regards,
Kit

Hi,
1. Only the way to Read long text is use the function module ‘READ_TEXT’ for which u need to pass TEXTOBJECT, TEXTID, TEXTLANGUAGE AND ONEMORE(I FORGET).
Because the STXL and STXH these tables are cluster tables in which data stored in ‘LRAW’ field which is in RAW format which u can not understand and our normal SQL can also.
2. so u can read most of cluster tables by Function modules only.
3. u can modify or saved by ‘save_text’

Similar Messages

  • How to get Long text in report from FBL3N

    Hi,
    I need to get Long Text from FBL3N (G/L Account Line Item Display) in my report.Can anyone tell me in which table it is stored?

    Hi
    These long texts are not stored completely in any tables
    where as the parameters of these texts like OBJECT,OBJECTNAME and ID, LANGUAGE are stored in STXH table
    You have to pass these 4 parameters to the fun module READ_TEXT and to fetch the text.
    Double click on the long text will goes to text editor
    from menu GOTO-> HEADER  you will see the above 4 paramters
    see the doc of READ_TEXT fun module
    READ_TEXT
    READ_TEXT provides a text for the application program in the specified work areas.
    The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
    After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
    If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
    Function call:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING CLIENT = SY-MANDT
    OBJECT = ?...
    NAME = ?...
    ID = ?...
    LANGUAGE = ?...
    ARCHIVE_HANDLE = 0
    IMPORTING HEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    NOT_FOUND =
    OBJECT =
    REFERENCE_CHECK =
    WRONG_ACCESS_TO_ARCHIVE =
    Export parameters:
    CLIENT
    Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
    Reference field: SY-MANDT
    Default value: SY-MANDT
    OBJECT
    Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
    Reference field: THEAD-TDOBJECT
    NAME
    Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
    Reference field: THEAD-TDNAME
    ID
    Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
    Reference field: THEAD-TDID
    LANGUAGE
    Enter the language key of the text module. The system accepts only languages that are defined in table T002.
    Reference field: THEAD-TDSPRAS
    ARCHIVE_HANDLE
    If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
    The value '0' indicates that you do not want to read the text from the archive.
    Reference field: SY-TABIX
    Default value: 0
    Import parameters:
    HEADER
    If the system finds the desired text, it returns the text header in this parameter.
    Structure: THEAD
    Table parameters:
    LINES
    The table contains all text lines that belong to the text read.
    Structure: TLINE
    Exceptions:
    ID
    The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
    LANGUAGE
    The parameter LANGUAGE contains a language key that does not exist in table T002.
    NAME
    The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
    Possible errors:
    The field contains only blanks.
    The field contains the invalid characters ‘*’ or ‘,’.
    OBJECT
    The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
    NOT_FOUND
    The system did not find the specified text module.
    REFERENCE_CHECK
    The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
    WRONG_ACCESS_ TO_ARCHIVE
    The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Problem in getting long text in Cash receipt.

    Hi all,
    I want long text in my form print but as a programming i am not getting long text in description Field I am getting short text.  So can you please kindly tell me when we entered long text in transaction FBCJ this long text save in which table. And how can i fetch this data in my smartforms.
    Thanks in Advance.

    Hi Keyur,
    when you see the detail text in the transaction, use menu goto -> header. Here you see the details to use for an include staement in sapscript. Note that the text name may be a concateneation of client and document number. Prepare the details in print program, fill in variables to be used in sapscript.
    Hope these details are enough.
    Regards,
    Clemens

  • Getting Long Text of a Field Label

    Hi Friends,
    I have requirement in which , based on the filed I  need get the Long text of the data element.by default I am able to access the medium text of the data element. is there any function-module for getting Long text?
    Regards,
    Xavier.P

    Hi Xavier,
    check this
    Storing long text data
    hope it helps you.
    Regards!

  • Using variables in message long text ( SE91)

    Hi everyone,
    Does anyone know how we insert the variables passed in the message can also be used to be printed in the long text as well.
    Suppose , say
    message e000 with a b c d.
    where a ,b , c and  d are the variables...
    How do i use these inside the long text.

    message e000 with 'text' '&variable&'.
    To create a message long text in SE91:
    Select to switch to change mode.
    Place the cursor on the corresponding message.
    Click the Long text pushbutton.
    This starts the SAPscript editor.
    Enter the long text.
    Carry out a check in SAPscript editor.
    Save your data.
    eg: create a msg like this.
    Please enter another value. The value may be &.
    then in pgm do this.
    MESSAGE i014(msg_class_name)  WITH variable_value.

  • Problem in Getting Long Text After uploading LT using CREATE_TEXT in CORS

    Hi Gurus,
    i am uploading long text for Reason for cancellation in CORS Transaction through CREATE_TEXT.
    after uploading this text by using this FM CREATE_TEXT i am seeing the long text what ever i uploaded through CREATE_TEXT , i am unable to see first 40 characters of that long text.
    if anybody faced this problem earlier please guide me to resolve this problem.
    Thanks & Regards
    Venkata Ramesh J

    Hi,
    can you please check this link
    Replacing the text created in create_text
    Thanks
    durga.K

  • How to get Long text in CJ20n

    Hi,
       I need to get the long text that we maintained in CJ20n tcode under long text at project level. I need to display the same in Script layout or report. I didnot find any table or functional module to get it. please help me out.
    regards,
    Chandra

    Hi
    Double click on the Long text, it will take you to Text editor
    from the Menu GOTO-> HEADER
    you will find the OBJECT,ID,OBJECTNAME and LANGUAGE parameters for that lang text which are to be passed to the READ_TEXT fun module
    for displaying it on report use the above fun module and fetch the text in IT_LINES internal table and write it on report output
    You can also see the doc of the read_text
    READ_TEXT
    READ_TEXT provides a text for the application program in the specified work areas.
    The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
    After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
    If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
    Function call:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING CLIENT = SY-MANDT
    OBJECT = ?...
    NAME = ?...
    ID = ?...
    LANGUAGE = ?...
    ARCHIVE_HANDLE = 0
    IMPORTING HEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    NOT_FOUND =
    OBJECT =
    REFERENCE_CHECK =
    WRONG_ACCESS_TO_ARCHIVE =
    Export parameters:
    CLIENT
    Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
    Reference field: SY-MANDT
    Default value: SY-MANDT
    OBJECT
    Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
    Reference field: THEAD-TDOBJECT
    NAME
    Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
    Reference field: THEAD-TDNAME
    ID
    Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
    Reference field: THEAD-TDID
    LANGUAGE
    Enter the language key of the text module. The system accepts only languages that are defined in table T002.
    Reference field: THEAD-TDSPRAS
    ARCHIVE_HANDLE
    If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
    The value '0' indicates that you do not want to read the text from the archive.
    Reference field: SY-TABIX
    Default value: 0
    Import parameters:
    HEADER
    If the system finds the desired text, it returns the text header in this parameter.
    Structure: THEAD
    Table parameters:
    LINES
    The table contains all text lines that belong to the text read.
    Structure: TLINE
    Exceptions:
    ID
    The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
    LANGUAGE
    The parameter LANGUAGE contains a language key that does not exist in table T002.
    NAME
    The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
    Possible errors:
    The field contains only blanks.
    The field contains the invalid characters ‘*’ or ‘,’.
    OBJECT
    The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
    NOT_FOUND
    The system did not find the specified text module.
    REFERENCE_CHECK
    The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
    WRONG_ACCESS_ TO_ARCHIVE
    The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
    IN SCRIPTS you can use the INCLUDE statement to print the Long texts
    /: INCLUDE TEXT<name> ID <id>  Lang <en> paragraph <za>
    Regards
    Anji

  • Get long text of a message

    I have created message class in tran. se91 and i want to get the long text of a particular message
    in these message class.
    how can i get the long text of the message dynamiclly in the program code?
    thanks in advance,
    Noa

    Hi,
    you can use Function Module MESSAGE_TEXT_BUILD  as:
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
        EXPORTING
          msgid               = g_msgid
          msgnr               = g_msgno
          msgv1               = g_msgv1
        IMPORTING
          message_text_output = g_message.
    Message text will be in g_message.
    regards,
    Neha

  • Using CATT to update Long Text in Info Records

    I am in a 4.7 environment, and trying to use CATT to update Purchasing Info Records (PIR) to include Long Text.  Does anyone know how I can get the script to work with long text that changes for each PIR?  I have tried several times, but can only get it to work with a single text entry.  Any help would be greatly appreciated.
    Cathy

    Hello Cathy,
    I use tcode OMQ3 to transfer texts. It took me awhile to figure out the easiest way to use and find it very simple now. Read the program documentation on how to use.
    Hope this helps.
    Cheers !

  • When my phone is locked, and I get a text message, it isn't making any sounds. When the phone is in use and I get a text, it makes the alert sound.

    When I get a text while the phone is locked it doesn't make the designated alert sound, but it does if the phone is unlocked and in use.

    I think you have the 'do not disturb' function enabled. If there is a moon icon in the top right of the home screen that will be the problem. Go to settings,  do not disturb, and make sure manual slider is off. I had the same problem and took me a day to figure out.
    Good luck

  • How to get Long text in IW33

    Hi Everyone,
    I have a requirement where I need to display the Longtext that is displayed in transaction IW33.
    Its is not the KTEXT feild pf table AUFK as this feild contains data upto 40 characters.
    My requirement is to fetch all the characters that are in Longtext.
    There must be a table where the long text is saved.
    Please let me the table ???
    Regards,
    Raj

    Press Display Text button in front of long text.You will go to editor.Then from the munubar select Go to->Header.Use these header details:
    Text Name   <Order no.>
    Language        EN
    Text ID         KOPF Order header text
    Text Object     AUFK       Order text
    Pass this to FM READ_TEXT.You can also refer the tables STXH and STXL but i guess FM will solve your problem.

  • Using save_text to change long text of sales

    Hi All,
    I am trying edit the long text on sales order header using FM save_text , But it does not work ,
    the fm is returning subrc  value 0 but the long text does nnot change i have also used commit_text .
    data td1 type thead .
    data : tdlin1 type table of tline.
    data : wa_tdlin1 like line of tdlin1.
    td1-TDOBJECT = 'VBBK'.
    td1-TDname = '188238'.
    td1-tdid = '0002'.
    td1-tdspras = 'EN'.
    td1-tdtxtlines = '1'.
    wa_tdlin1-TDformat = 'U1'.
    wa_tdlin1-tdline = 'this chnaged by vinay to test'.
    append wa_tdlin1 to tdlin1.
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
       CLIENT                = SY-MANDT
        header                = td1
      INSERT                = ' '
       SAVEMODE_DIRECT       = 'X'
      OWNER_SPECIFIED       = ' '
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
      NEWHEADER             =
      tables
        lines                 = tdlin1
    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.
    CALL FUNCTION 'COMMIT_TEXT'
    EXPORTING
    object = 'VBBK'
    id = 'ZINT'
    language = sy-langu.

    Hi Guys ,
    I figured out the problem and its working now .
    Cheers
    vinay

  • Issue Using C# to Get RTF Text From Clipboard to Outlook With Formatting and Without Encoding Tags

    I have created a little application that gathers data from various text boxes and then combines the data into a formatted richTextBox.  A person using the tool asked if I could then add a button that would allow that text (with formatting) to be copied
    and pasted into an Outlook Email.  When I do this, I can get the text into an email, but I either strip out the formatting or I get all the RTF encoding tags to come along with it. 
    I have tested to see that the copy of the data from the richTextBox has indeed made it to the clipboard correctly.  This has been verified by the fact that I can manually press "ctrl" + "v" and I can past the text with proper
    formatting into the mail body.
    I do know that I can brute force things by trying to manually wrap HTML tags around my textBox fields and then pipe that into an HTMLBody property.  In fact I can get a lot of things to work with the HTMLBody property, but while it is nice that will
    work, I feel that I must be missing something really simple while trying to work with RTF.
    I currently am pasting (using the Clipboard.GetText(TestDataFormat.RTF)) the RTF data into the Body property of the mail item.  This is bringing in all the RTF encoding tags.  I have tried to paste this directly into the RTFBody of the mail item,
    yet an execption gets thrown when executed.  Oddly, though, if I change RTFBody to HTMLBody, I do not get the exception, but I still have the RTF encoding tags in it.  Though if I feed the HTMLBody property straight, HTML text with the encoding tags,
    it will render properly.
    This has me confused then why if I feed HTMLBody HTML text with the encoding tags that it will render, but if I try and do the same for RTFBody and feed it RTF text with encoding tags it still throws an exception.  Any help in the matter would be greatly
    appreciated.  I have included the code snippet below for sending the richTextBox information to the clipboard and then attempting to retrieve it and paste it into an Outlook email.
    Thanks for the help.
    Some pertinent information:
    Blend for Visual Studio 2015 CTP6 (I switched from VS2012 as intellisense was added to Blend in 2015)
    Because of this Systems.Windows.Forms is not in use
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    myNewMailIoI.To = " "; //An attempt to ensure that the focus moves down to the body field
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Pasting data into body of email
    myNewMailIoI.Body = Clipboard.GetText(TextDataFormat.Rtf); //This will past the text with encoding tags into email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This stinks!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>different font and color</p>";
    myNewMailIoI.Display(); //Allow for window to be minimized
    myNewMailIoI.Display(true);

    Ok, I found the solution.  Part of the issue was caused by the confusion of the HTML body property acting as a text encoder for HTML text when a string is passed in vs the RTF Body property needing to have a plain text file taken and encoded into a
    byte stream.  Even though the RTF text is in readable text (albeit with the RTF Encoding Tags) it needs to be reencoded into a series of bytes. 
    This is where I failed to understand the previous answers.  I knew that RTF Body needed to have a array of bytes, and the previous answers seemed to indicate that the data in the clipboard was already in this byte format (this may have just been my
    misunderstanding) and that I needed to somehow take this byte array and do something with it.  My misunderstanding was that all the methods for getting values from the clipboard returned strings and not bytes.
    after some digging last night and with the few hints that were offered before, I came across a post on CodeProject (apparently I cannot post links, so I will try and include this so that you can find the postcodeproject(DOTCOM)/Questions/766917/How-to-convert-richtextbox-output-into-bytearray). 
    This showed that I needed to take the raw, RTF text with its RTF encoding tags from the clipboard and and encode it to a byte array and then pass this into the RTF Body property.  Included below is the final code such that I hope that it helps some other
    person as there seem to be a lot of searches for this on the web, but not a lot of direct answers.
    using System.Text;
    using Outlook = Microsoft.Office.Interop.Outlook;
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    //Add Subject
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    //Set Body Format to RTF
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Converting RAW RTF data from string to bytes. THIS IS THE FIX THAT WAS NEEDED TO MAKE IT WORK
    string myNewText = Clipboard.GetText(TextDataFormat.Rtf);
    byte[] myNewRtfBytes = Encoding.UTF8.GetBytes(myNewText); //This line cost me way too many hours of lost sleep!!!
    //Inserting RTF bytes into RTFBody property
    myNewMailIoI.RTFBody = myNewRtfBytes;
    myNewMailIoI.Display(); //Displays the newlycreated email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This works for the HTMLbody property!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>this renders properly</p>";

  • Using paragraph format for long text...

    Hello,
    When I try to print the long text using include then
    it starts printing from the very first line.
    But I want to use some paragraph format for it. How can I use it because I am using
    /: INCLUDE '200007200000100' OBJECT AUFK ID KOPF
    So where do I mention the paragraph format in the tag column becaue I am already using /: controll command in font of the include ?

    Check this thread...
    SAPScript - Standard Text
    It looks like the PARAGRAPH P2 statement can do that declaration, on the subsequent line.
    This website also has some good examples:
    http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm
    Cheers,
    John

  • How to Get Long text of a material?

    Hi Friends,
    Could you please help me, in getting the Long text of a Material?
    if any sample code is available, kindly provide.
    Regards,
    Xavier.P

    here you have a working code snippet: the longtext is stored in table lines.
    tables: stxh.
      data: lines like tline occurs 0 with header line.
      data: ID            LIKE     THEAD-TDID,
            LANGUAGE     LIKE     THEAD-TDSPRAS,
            NAME            LIKE     THEAD-TDNAME,
            OBJECT            LIKE     THEAD-TDOBJECT.
      clear: lines[].
    select single * from stxh into stxh
        where tdname eq mara-matnr
        and tdid     eq 'GRUN'
        and tdobject eq 'MATERIAL'
        and tdspras  eq 'EN'.
        ID     = stxh-tdid.
        OBJECT = stxh-tdobject.
        NAME   = stxh-tdname.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            ID                      = id
            LANGUAGE                = 'EN'
            NAME                    = name
            OBJECT                  = object
          TABLES
            LINES                   = lines
          EXCEPTIONS
            ID                      = 1
            LANGUAGE                = 2
            NAME                    = 3
            NOT_FOUND               = 4
            OBJECT                  = 5
            REFERENCE_CHECK         = 6
            WRONG_ACCESS_TO_ARCHIVE = 7
            OTHERS                  = 8.
    regards tony

Maybe you are looking for