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

Issue regarding read_text

Hi all,

I had a doubt regarding read_text FM. Suppose I am executing read_text FM and giving textname ADRS_SENDER and ID as ADRS and OBJECT as TEXT but after executing it is returning one line in the LINES table.

My query is that I want to edit this line text according to my requirement. Actually where this text gets stored. I want to edit this. I cannot do it in se37.

Pls help me in solving this.

I will reward points.

With regards,

Abir.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2006 at 10:34 AM

    then you have to use SAVE_TEXT function module to modify the existing text

    here is the small piece of code, where i am getting the lines already there in the TEXT OBJECT. and then adding my new lines to that IT_LINES internal table and then finally calling SAVE_TEXT to save the changes.

    replace NAME,ID,OBJECT with your values.

      LV_NAME  = P_DELV_NO .
      X_HEADER-TDOBJECT = 'VBBK'.
      X_HEADER-TDNAME   = LV_NAME . "P_DELV_NO.
      X_HEADER-TDID     = 'ZMAN'.
      X_HEADER-TDSPRAS  = 'E'.
    
    
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          CLIENT                        = SY-MANDT
          ID                            = X_HEADER-TDID
          LANGUAGE                      = X_HEADER-TDSPRAS
          NAME                          = X_HEADER-TDNAME
          OBJECT                        = X_HEADER-TDOBJECT
    *     ARCHIVE_HANDLE                = 0
    *     LOCAL_CAT                     = ' '
    *   IMPORTING
    *     HEADER                        =
        TABLES
          LINES                         = IT_TLINES
       EXCEPTIONS
         ID                            = 1
         LANGUAGE                      = 2
         NAME                          = 3
         NOT_FOUND                     = 4
         OBJECT                        = 5
         REFERENCE_CHECK               = 6
         WRONG_ACCESS_TO_ARCHIVE       = 7
         OTHERS                        = 8
                .
      IF SY-SUBRC <> 0 AND SY-SUBRC  <> 4 .
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    
      IT_TLINES-TDFORMAT = '*'.
      LOOP AT IT_TEXT .
        it_lines-tdline  = it_text-line.
       append it_lines.
      endloop.
    
      CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
          CLIENT                = SY-MANDT
          HEADER                = X_HEADER
    *       INSERT                = ' '
          SAVEMODE_DIRECT       = 'X'
    *       OWNER_SPECIFIED       = ' '
    *       LOCAL_CAT             = ' '
    *     IMPORTING
    *       FUNCTION              =
    *       NEWHEADER             =
        TABLES
          LINES                 = IT_TLINES
         EXCEPTIONS
           ID                    = 1
           LANGUAGE              = 2
           NAME                  = 3
           OBJECT                = 4
           OTHERS                = 5
                .
      IF SY-SUBRC <> 0.
    *--save_text error.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.

    Regards

    srikanth

    Message was edited by: Srikanth Kidambi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 28, 2006 at 10:39 AM

    Hi,

    once data comes into <b>LINES</b> table, then do modifications to this table data, and then use FM : SAVE_TEXT to save text after changes(data will be stored into STXH table).

    sample code :

    DATA: ws_thead LIKE thead,

    i_tline LIKE TABLE OF tline WITH HEADER LINE.

    data : x_matnr like mara-matnr.

    c_mara(4) type c value 'MARA',

    c_zid(4) type c value 'Z001'.

    MOVE : x_matnr TO ws_thead-tdname, <b><-moving MATNR to store data</b>

    c_mara TO ws_thead-tdobject,

    sy-langu TO ws_thead-tdspras,

    c_zid TO ws_thead-tdid.

    CALL FUNCTION 'SAVE_TEXT'

    EXPORTING

    client = sy-mandt

    header = ws_thead

    savemode_direct = 'X'

    TABLES

    lines = i_tline

    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.

    DATA: lws_id LIKE thead-tdid,

    lws_name LIKE thead-tdname,

    lws_object LIKE thead-tdobject.

    lws_id = c_zid.

    lws_name = x_matnr. <b><- reading data using key field(MATNR)</b>

    lws_object = c_mara.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    client = sy-mandt

    id = lws_id

    language = sy-langu

    name = lws_name

    object = lws_object

    TABLES

    lines = li_tline

    EXCEPTIONS

    id = 1

    language = 2

    name = 3

    not_found = 4

    object = 5

    reference_check = 6

    wrong_access_to_archive = 7

    OTHERS = 8.

    IF sy-subrc <> 0.

    • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    Regards

    Appana

    *Reward points for useful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2006 at 10:42 AM

    HI

    I HAVE ONE PROGRAM CREATED BY MYSELF FOR TEXT EDITOR USING READ_TEXT FM.gIVE YOUR MAIL ID I WILL SEND IT TO YOU.ONLY I HAVENT INCLUDED THE SAVING OPTION THERE..TRY TO MODIFY IT .

    REGARDS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2006 at 10:57 AM

    hi

    good

    lines is a structure like TLINE

    if you go to TLINE you ll find two fields TDFORMAT and TDLINE.

    This TDLINE store the value for the particular line.

    you can check these tables

    EFG_TAB_TLINE->Table Type TLINE

    EXPD_LINES_T->Table Type for TLINE

    thanks

    mrutyun

    thanks

    mrutyun

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2006 at 04:43 AM

    Hello,

    According to what I understood, U want edit the line from output u got from Read_text.

    U can do that by passing the text line into a internal table and modify it.

    Let me know if I am not clear.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2006 at 05:43 AM

    hi,

    as i mentioned earlier, you first use READ_TEXT then your existing text comes into IT_LINES.

    then use,

    LOOP IT_LINES.

    Each IT_LINES-TDLINE will contain the actual text. so do your editing here.

    MODIFY IT_LINES. "to update the changes in the body

    ENDLOOP.

    then finally call SAVE_TEXT and send this modified IT_LINES to this function module,it will be saved.

    Regards

    Srikanth

    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.