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

Import and Export Parameters READ_TEXT

Hi ALL 😊

I have to read Standard Text through this Function Module and populate that Standard Text into an Internal Table. Kindly let me know about the Import and Export parameterto do this. Also pls let me know a way to accomplish this

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 10:48 AM

    Check out this one

      CALL FUNCTION 'READ_TEXT'
           EXPORTING
                CLIENT                  = SY-MANDT
                ID                      = ITAB_THEAD-TDID
                LANGUAGE                = CNS_SPRAS
                NAME                    = ITAB_THEAD-TDNAME
                OBJECT                  = ITAB_THEAD-TDOBJECT
                ARCHIVE_HANDLE          = 0
    *           LOCAL_CAT               = ' '
    *      IMPORTING
    *           HEADER                  =
           TABLES
                LINES                   = ITAB_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.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 10:50 AM

    chk this thread

    func-module-'readtext'

    Add a comment
    10|10000 characters needed characters exceeded

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

    Example of READ_TEXT functions reading tables PBIM - Independent requirements for material.

    REPORT ZTEXT .

    TABLES: PBIM.

    • stxh, stxl, stxb - trans tables for text

    • ttxit - text on text-ids

    • ttxot - Short texts on text objects

    • Transaction MD63

    SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,

    S_WERKS FOR PBIM-WERKS.

    DATA: BEGIN OF HTEXT.

    INCLUDE STRUCTURE THEAD.

    DATA: END OF HTEXT.

    DATA: BEGIN OF LTEXT OCCURS 50.

    INCLUDE STRUCTURE TLINE.

    DATA: END OF LTEXT.

    DATA: BEGIN OF DTEXT OCCURS 50.

    DATA: MATNR LIKE PBIM-MATNR.

    INCLUDE STRUCTURE TLINE.

    DATA: END OF DTEXT.

    DATA: TNAME LIKE THEAD-TDNAME.

    SELECT * FROM PBIM WHERE WERKS IN S_WERKS.

    MOVE PBIM-BDZEI TO TNAME.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    • CLIENT = SY-MANDT

    ID = 'PB'

    LANGUAGE = 'E'

    NAME = TNAME

    OBJECT = 'PBPT'

    • ARCHIVE_HANDLE = 0

    IMPORTING

    HEADER = HTEXT

    TABLES

    LINES = LTEXT

    EXCEPTIONS

    ID = 1

    LANGUAGE = 2

    NAME = 3

    NOT_FOUND = 4

    OBJECT = 5

    REFERENCE_CHECK = 6

    WRONG_ACCESS_TO_ARCHIVE = 7

    OTHERS = 8.

    LOOP AT LTEXT.

    IF LTEXT-TDLINE NE ''.

    MOVE LTEXT-TDLINE TO DTEXT-TDLINE.

    MOVE PBIM-MATNR TO DTEXT-MATNR.

    APPEND DTEXT.

    ENDIF.

    ENDLOOP.

    ENDSELECT.

    LOOP AT DTEXT.

    WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.

    ENDLOOP.

    I hope it helps.

    Best Regards,

    Vibha

    *Please mark all the helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 11:15 AM

    Hi,

    try this example:

    REPORT ZGRO_TEST.

    *

    DATA: BEGIN OF TEXT OCCURS 10.

    INCLUDE STRUCTURE TLINE.

    DATA: END OF TEXT.

    *

    START-OF-SELECTION.

    *

    • Look at table STXH to the Parameters!!

    • Standard-Text (SO10) have the OBJECT 'TEXT'

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    ID = 'PALT'

    LANGUAGE = SY-LANGU

    NAME = 'INVITATION'

    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.

    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 11:33 AM

    What text are u reading and from which transaction.

    The following are the main parameters,

    ID:

    this is text id(U can find it in ur transaction,generally it will start with z)

    LANGUAGE:

    This depends on the language in which the text is maintained.For example En(english)

    NAME:

    No for which the text id is maintained,it may be deliver no or transport no.Depends on ur case.

    OBJECT:

    This represents mostly wether it is header data or item data respectively.so u can check this in ur transaction.

    A short example as follows,

    FORM read_text1 TABLES g_t_lines STRUCTURE tline

    USING p_var TYPE c

    p_obj TYPE c.

    READ TABLE xvttp INDEX 1.

    g_f_tdname1 = xvttp-vbeln.

    g_f_obj1 = p_obj.

    g_f_langu1 = 'DE'.

    REFRESH g_t_lines.

    CLEAR g_t_lines.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = p_var

    language = g_f_langu1

    name = g_f_tdname1

    object = g_f_obj1

    TABLES

    lines = g_t_lines

    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.

    endform.

    Check this and let me know if u face any problenm.

    Regards

    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.