Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

read_text

Former Member
0 Kudos

from the table i get from read_test i can only contatenate the values and display but how do i display line by line

6 REPLIES 6

Former Member
0 Kudos

Hi,

Do as below..

DATA: BEGIN OF i_tline OCCURS 0.

INCLUDE STRUCTURE tline. "SAPscript: Text Lines

DATA: END OF i_tline.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'LTXT'

language = sy-langu

name = v_name

object = 'IFLOT'

TABLES

lines = i_tline

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

LOOP AT i_tline.

MOVE .... TO .......

MOVE .... TO .......

APPEND installation_text.

ENDLOOP.

Regards,

Ram

Pls reward points if helpful.

Former Member
0 Kudos

hi ,

loop at that table(which read_txt returns)into a wa

read the wa line by line

Former Member
0 Kudos

Once you have the internal table returned successfully from the FM, loop at the internal table and write output line by line:

call function 'READ_TEXT'

exporting

client = sy-mandt

id = id

language = sy-langu

name = name

object = object

tables

lines = xtext

exceptions

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

others = 8.

Loop at xtext.

WRITE: / xtext-TDLINE.

Endloop.

Thanks

Former Member
0 Kudos

Refer this code

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. 

http://www.sapdevelopment.co.uk/fmodules/fms_readtext.htm

Former Member
0 Kudos

after read_text you are taking it in itab like tline.

just loop at itab.

itab1-tdline = itab-tdline.

append itab1.

endloop.

regards

shiba dutta

Former Member
0 Kudos

Hi,

loop the table and diaplay line by line.

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = W_ID

LANGUAGE = 'E'

NAME = W_NAME

OBJECT = W_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.

loop at lines.

write:/ lines.

endloop.