Skip to Content
1
Former Member
Aug 04, 2008 at 06:37 AM

Read_Text item text in Smartforms

739 Views

Hi all,

i need to display the item text of VL02N in Smartforms.

i have retreived data using READ_TEXT into a internal table IT_TEXT1. i am looping at IT_LINES to populate the internal table IT_TEXT1.

it carries all the data. But while displaying it is displaying the last record only.

In the Smartform also i am looping at the table IT_TEXT1 to display IT_TEXT1-TDLINE.

But the last record is only displayed.

 
DATA: IT_LINE    LIKE STANDARD TABLE OF TLINE INITIAL SIZE 0 WITH HEADER LINE,
       IT_TEXT1   LIKE STANDARD TABLE OF TLINE INITIAL SIZE 0 WITH HEADER LINE.


LOOP AT IT_LIPS.
 CONCATENATE: IT_LIPS-VBELN  IT_LIPS-POSNR INTO IT_THEAD1-TDNAME.
      IT_THEAD1-TDOBJECT = 'VBBP'.
      IT_THEAD1-TDID = '0002'.
      IT_THEAD1-TDSPRAS = 'EN'. " V_LANG .
      APPEND IT_THEAD1.


       CALL FUNCTION 'READ_TEXT'
        EXPORTING
          CLIENT                        = SY-MANDT
          ID                            = IT_THEAD1-TDID
          LANGUAGE                      = V_LANG
          NAME                          = IT_THEAD1-TDNAME
          OBJECT                        = IT_THEAD1-TDOBJECT
        TABLES
          LINES                         = IT_LINE
       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.
      LOOP AT IT_LINE INTO W_LINE.
       APPEND W_LINE TO IT_TEXT1.
      ENDLOOP.
      CLEAR:  IT_LINE, W_LINE.

 ENDLOOP .  

KINDLY LET ME KNOW how to display all the Item texts.

kindly point out where i am going wrong.

Thanks.

Suki.