Skip to Content
author's profile photo Former Member
Former Member

Text Object - urgent

HI,

i have an internal table with text and i want to save this text as text object or standard text so i can later use it in sapscript.

how can i save this internal table at runtime...

i used save_text fm... but i got error like Text Object is not Available.

regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 03:17 PM

    Hi Giri,

    here a short example:

    REPORT ZGRO_TEST.

    *

    DATA: BEGIN OF TEXT OCCURS 0.

    INCLUDE STRUCTURE TLINE.

    DATA: END OF TEXT.

    *

    DATA: HEADER LIKE THEAD.

    *

    START-OF-SELECTION.

    *

    HEADER-TDOBJECT = 'TEXT'.

    HEADER-TDNAME = 'Z_MUSTER'.

    HEADER-TDID = 'ST'.

    HEADER-TDSPRAS = SY-LANGU.

    *

    TEXT-TDFORMAT = '*'.

    TEXT-TDLINE = '1. Zeile'. APPEND TEXT.

    TEXT-TDLINE = '2. Zeile'. APPEND TEXT.

    TEXT-TDLINE = '3. Zeile'. APPEND TEXT.

    *

    CALL FUNCTION 'SAVE_TEXT'

    EXPORTING

    HEADER = HEADER

    TABLES

    LINES = TEXT.

    *

    CLEAR TEXT. REFRESH TEXT.

    *

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    ID = 'ST'

    LANGUAGE = SY-LANGU

    NAME = 'Z_MUSTER'

    OBJECT = 'TEXT'

    TABLES

    LINES = TEXT

    EXCEPTIONS

    NOT_FOUND = 1.

    *

    IF SY-SUBRC = 0.

    LOOP AT TEXT. WRITE: / TEXT-TDLINE. ENDLOOP.

    ELSE.

    WRITE: / SY-SUBRC.

    ENDIF.

    *

    END-OF-SELECTION.

    Hope it helps.

    Regards, Dieter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 03:06 PM

    u need to pass ZTEXT to tdname.

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 17, 2006 at 02:58 PM

    You must first create the object/id using transaction SE75

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Lets say you create an object called ZTEST and an ID under this object called Z001. Here is how you would use this in your code.

      
      <b>xhearer-tdobject = 'ZTEST'.
      xheader-tdid = 'Z001'.
      xheader-TDNAME = <some_unique_value>.
      xheader-spras  = sy-langu.</b>
      
      loop at gl_textlines into wa_gl.
      textlines-tdformat = '*'.
      textlines-tdline = wa_gl.
      append textlines.
      endloop.
      
      CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
      CLIENT = SY-MANDT
      header = xheader
      * INSERT = ' '
      SAVEMODE_DIRECT = 'X'
      
      tables
      lines = textlines
      
      
      

      Regards,

      Rich Heilman

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 02:56 PM

    Hi

    Please check the following blog for the same

    /people/igor.barbaric/blog/2005/06/06/the-standard-text-editor-oo-abap-cfw-class

    Help on uploading long text for task operation in PM modul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 03:02 PM

    U need to create the Text object first using transaction 'SO10'.

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 02:58 PM

    HI Giri,

    Use SAVE_TEXT to save the data in SAP.

    Go to SE75 to create Object and ID.

    READ_TEXT to read the text (in case u want to retrieve the data).

    Reward points if this helps.

    Manish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 03:21 PM

    Hi Giri,

    go and create the object using SO10 transaction.

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 04:26 PM

    is it anyway that u write ur code in one server and test it another server??

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.