<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014442#M411525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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, &amp;lt;-moving MATNR to store data 
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 &amp;lt;&amp;gt; 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. &amp;lt;- reading data using key field(MATNR) 
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 &amp;lt;&amp;gt; 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2007 09:45:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-27T09:45:17Z</dc:date>
    <item>
      <title>How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014439#M411522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to use the FM 'READ_TEXT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 09:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014439#M411522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T09:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014440#M411523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ_TEXT  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ_TEXT provides a text for the application program in the specified work areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function call:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'READ_TEXT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING CLIENT = SY-MANDT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJECT = ?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NAME = ?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID = ?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LANGUAGE = ?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARCHIVE_HANDLE = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING HEADER =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES LINES = ?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS ID =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LANGUAGE =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NAME =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOT_FOUND =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OBJECT =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFERENCE_CHECK =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRONG_ACCESS_TO_ARCHIVE =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Export parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLIENT&lt;/P&gt;&lt;P&gt; Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference field: SY-MANDT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Default value: SY-MANDT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;OBJECT&lt;/P&gt;&lt;P&gt; Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference field: THEAD-TDOBJECT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NAME&lt;/P&gt;&lt;P&gt; 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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference field: THEAD-TDNAME&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt; Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference field: THEAD-TDID&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LANGUAGE&lt;/P&gt;&lt;P&gt; Enter the language key of the text module. The system accepts only languages that are defined in table T002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference field: THEAD-TDSPRAS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ARCHIVE_HANDLE&lt;/P&gt;&lt;P&gt; 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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value '0' indicates that you do not want to read the text from the archive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference field: SY-TABIX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Default value: 0&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HEADER&lt;/P&gt;&lt;P&gt; If the system finds the desired text, it returns the text header in this parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure: THEAD&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LINES&lt;/P&gt;&lt;P&gt; The table contains all text lines that belong to the text read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure: TLINE &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt; 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. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LANGUAGE&lt;/P&gt;&lt;P&gt; The parameter LANGUAGE contains a language key that does not exist in table T002.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NAME&lt;/P&gt;&lt;P&gt; The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possible errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field contains only blanks.&lt;/P&gt;&lt;P&gt;The field contains the invalid characters &amp;#145;*&amp;#146; or &amp;#145;,&amp;#146;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;OBJECT&lt;/P&gt;&lt;P&gt; The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NOT_FOUND&lt;/P&gt;&lt;P&gt; The system did not find the specified text module. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REFERENCE_CHECK&lt;/P&gt;&lt;P&gt; 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. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;WRONG_ACCESS_ TO_ARCHIVE&lt;/P&gt;&lt;P&gt; 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).&lt;/P&gt;&lt;P&gt;Short Text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SAPscript: Read text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    In order to process text modules in application programs, all&lt;/P&gt;&lt;P&gt;    information about a text module must be transferred to internal work&lt;/P&gt;&lt;P&gt;    areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    A text is read from the text file or text memory with this function&lt;/P&gt;&lt;P&gt;    module. It must be described fully by specifying OBJECT, NAME, ID, and&lt;/P&gt;&lt;P&gt;    LANGUAGE. Generic entries in these parameters are not valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    When header information and text lines have been read successfully, they&lt;/P&gt;&lt;P&gt;    are transferred to the work areas HEADER and LINES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; BEGIN OF FS_TABLE,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CHAR TYPE TLINE,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; END OF FS_TABLE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA T_TABLE LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA FS_TABLE LIKE LINE OF T_TABLE.&lt;/P&gt;&lt;P&gt;DATA W_HEADER TYPE TLINE-TDLINE.&lt;/P&gt;&lt;P&gt;*DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; T_TABLE LIKE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;STANDARD TABLE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      OF FS_TABLE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'READ_TEXT'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CLIENT                        = SY-MANDT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ID                            = 'ST'&lt;/P&gt;&lt;P&gt;    LANGUAGE                      = 'E'&lt;/P&gt;&lt;P&gt;    NAME                          = 'YH627_ST1'&lt;/P&gt;&lt;P&gt;    OBJECT                        = 'TEXT'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ARCHIVE_HANDLE                = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LOCAL_CAT                     = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER                        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    LINES                         = T_TABLE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ID                            = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LANGUAGE                      = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NAME                          = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NOT_FOUND                     = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJECT                        = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  REFERENCE_CHECK               = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  WRONG_ACCESS_TO_ARCHIVE       = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                        = 8&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE 'dfhdhdgj'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SAVE_TEXT'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CLIENT                = SY-MANDT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    HEADER                = FS_TABLE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INSERT                = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SAVEMODE_DIRECT       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OWNER_SPECIFIED       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LOCAL_CAT             = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FUNCTION              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NEWHEADER             =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    LINES                 = T_TABLE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ID                    = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LANGUAGE              = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NAME                  = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJECT                = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                = 5&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        sunil kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 09:43:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014440#M411523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T09:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014441#M411524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chinna.. See the example  below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: PBIM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;stxh, stxl, stxb - trans tables for text &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ttxit - text on text-ids &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ttxot - Short texts on text objects &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Transaction MD63 &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR, &lt;/P&gt;&lt;P&gt;                S_WERKS FOR PBIM-WERKS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF HTEXT. &lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE THEAD. &lt;/P&gt;&lt;P&gt;DATA: END OF HTEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LTEXT OCCURS 50. &lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE TLINE. &lt;/P&gt;&lt;P&gt;DATA: END OF LTEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DTEXT OCCURS 50. &lt;/P&gt;&lt;P&gt;DATA:   MATNR LIKE PBIM-MATNR. &lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE TLINE. &lt;/P&gt;&lt;P&gt;DATA: END OF DTEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: TNAME LIKE THEAD-TDNAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM PBIM WHERE WERKS IN S_WERKS. &lt;/P&gt;&lt;P&gt;  MOVE PBIM-BDZEI TO TNAME. &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'READ_TEXT' &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          CLIENT                  = SY-MANDT &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          ID                      = 'PB' &lt;/P&gt;&lt;P&gt;          LANGUAGE                = 'E' &lt;/P&gt;&lt;P&gt;          NAME                    = TNAME &lt;/P&gt;&lt;P&gt;          OBJECT                  = 'PBPT' &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        ARCHIVE_HANDLE          = 0 &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     IMPORTING &lt;/P&gt;&lt;P&gt;          HEADER                  = HTEXT &lt;/P&gt;&lt;P&gt;     TABLES &lt;/P&gt;&lt;P&gt;          LINES                   = LTEXT &lt;/P&gt;&lt;P&gt;     EXCEPTIONS &lt;/P&gt;&lt;P&gt;          ID                      = 1 &lt;/P&gt;&lt;P&gt;          LANGUAGE                = 2 &lt;/P&gt;&lt;P&gt;          NAME                    = 3 &lt;/P&gt;&lt;P&gt;          NOT_FOUND               = 4 &lt;/P&gt;&lt;P&gt;          OBJECT                  = 5 &lt;/P&gt;&lt;P&gt;          REFERENCE_CHECK         = 6 &lt;/P&gt;&lt;P&gt;          WRONG_ACCESS_TO_ARCHIVE = 7 &lt;/P&gt;&lt;P&gt;          OTHERS                  = 8. &lt;/P&gt;&lt;P&gt;  LOOP AT LTEXT. &lt;/P&gt;&lt;P&gt;    IF LTEXT-TDLINE NE ''. &lt;/P&gt;&lt;P&gt;      MOVE LTEXT-TDLINE TO DTEXT-TDLINE. &lt;/P&gt;&lt;P&gt;      MOVE PBIM-MATNR TO DTEXT-MATNR. &lt;/P&gt;&lt;P&gt;      APPEND DTEXT. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;LOOP AT DTEXT. &lt;/P&gt;&lt;P&gt;  WRITE:/ DTEXT-MATNR, DTEXT-TDLINE. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Britto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 09:45:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014441#M411524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T09:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014442#M411525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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, &amp;lt;-moving MATNR to store data 
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 &amp;lt;&amp;gt; 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. &amp;lt;- reading data using key field(MATNR) 
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 &amp;lt;&amp;gt; 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 09:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014442#M411525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T09:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014443#M411526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u need to pass parameters for READ_TEXT....values should be like&lt;/P&gt;&lt;P&gt;ID, Languagae, Name, Object....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say, u have the t-code...and text...goto text header and u will find the above details...u need to pass the values and u will get the text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 09:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014443#M411526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T09:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014444#M411527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this...&lt;/P&gt;&lt;P&gt;ABAP READ_TEXT functions to read the SAP Long Text &lt;/P&gt;&lt;P&gt;All the long text can be retrieve using this method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to used the READ_TEXT functions to read the SAP long text.  e.g. Sales Order, Purchase Order Item text etc. &lt;/P&gt;&lt;P&gt;To check your long text header, go into the long text.  Click Goto -&amp;gt; Header &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of READ_TEXT functions reading tables PBIM - Independent requirements for material. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTEXT . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: PBIM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;stxh, stxl, stxb - trans tables for text &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ttxit - text on text-ids &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ttxot - Short texts on text objects &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Transaction MD63 &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR, &lt;/P&gt;&lt;P&gt;                S_WERKS FOR PBIM-WERKS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF HTEXT. &lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE THEAD. &lt;/P&gt;&lt;P&gt;DATA: END OF HTEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LTEXT OCCURS 50. &lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE TLINE. &lt;/P&gt;&lt;P&gt;DATA: END OF LTEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DTEXT OCCURS 50. &lt;/P&gt;&lt;P&gt;DATA:   MATNR LIKE PBIM-MATNR. &lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE TLINE. &lt;/P&gt;&lt;P&gt;DATA: END OF DTEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: TNAME LIKE THEAD-TDNAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM PBIM WHERE WERKS IN S_WERKS. &lt;/P&gt;&lt;P&gt;  MOVE PBIM-BDZEI TO TNAME. &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'READ_TEXT' &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          CLIENT                  = SY-MANDT &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          ID                      = 'PB' &lt;/P&gt;&lt;P&gt;          LANGUAGE                = 'E' &lt;/P&gt;&lt;P&gt;          NAME                    = TNAME &lt;/P&gt;&lt;P&gt;          OBJECT                  = 'PBPT' &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        ARCHIVE_HANDLE          = 0 &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     IMPORTING &lt;/P&gt;&lt;P&gt;          HEADER                  = HTEXT &lt;/P&gt;&lt;P&gt;     TABLES &lt;/P&gt;&lt;P&gt;          LINES                   = LTEXT &lt;/P&gt;&lt;P&gt;     EXCEPTIONS &lt;/P&gt;&lt;P&gt;          ID                      = 1 &lt;/P&gt;&lt;P&gt;          LANGUAGE                = 2 &lt;/P&gt;&lt;P&gt;          NAME                    = 3 &lt;/P&gt;&lt;P&gt;          NOT_FOUND               = 4 &lt;/P&gt;&lt;P&gt;          OBJECT                  = 5 &lt;/P&gt;&lt;P&gt;          REFERENCE_CHECK         = 6 &lt;/P&gt;&lt;P&gt;          WRONG_ACCESS_TO_ARCHIVE = 7 &lt;/P&gt;&lt;P&gt;          OTHERS                  = 8. &lt;/P&gt;&lt;P&gt;  LOOP AT LTEXT. &lt;/P&gt;&lt;P&gt;    IF LTEXT-TDLINE NE ''. &lt;/P&gt;&lt;P&gt;      MOVE LTEXT-TDLINE TO DTEXT-TDLINE. &lt;/P&gt;&lt;P&gt;      MOVE PBIM-MATNR TO DTEXT-MATNR. &lt;/P&gt;&lt;P&gt;      APPEND DTEXT. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;LOOP AT DTEXT. &lt;/P&gt;&lt;P&gt;  WRITE:/ DTEXT-MATNR, DTEXT-TDLINE. &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 09:47:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014444#M411527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T09:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014445#M411528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank u all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 10:17:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-function-module/m-p/2014445#M411528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T10:17:09Z</dc:date>
    </item>
  </channel>
</rss>

