How to get longtext via function read_text into my business object?

Trant, David David.Trant at andrew.com
Tue Feb 17 14:51:11 EST 2004


Here's code for a virtual multiline attribute we created using reference fi=
eld TLINE-TDLINE for quality notifications (business object BUS2078).
 
Enjoy,
David
 
* get multi-line attribute SubjectText by reading the passing the
* notification number to 'READ_TEXT' and assigning the resulting table
* to the property
GET_PROPERTY SUBJECTTEXT CHANGING CONTAINER.
data:  id like THEAD-TDID value 'LTQM',
       name like THEAD-TDNAME,
       text_object like THEAD-TDOBJECT value 'QMEL',
       lines like tline occurs 0,
       line like tline.
  name =3D object-key-number.
  refresh lines.
  refresh object-subjecttext.
 
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
*     CLIENT                        =3D SY-MANDT
      ID                            =3D id
      LANGUAGE                      =3D sy-langu
      NAME                          =3D name
      OBJECT                        =3D text_object
*     ARCHIVE_HANDLE                =3D 0
*     LOCAL_CAT                     =3D ' '                =20
*   IMPORTING                                              =20
*     HEADER                        =3D                      =20
    TABLES                                                 =20
      LINES                         =3D lines                =20
    EXCEPTIONS                                             =20
*     ID                            =3D 1                    =20
*     LANGUAGE                      =3D 2                    =20
*     NAME                          =3D 3                    =20
*     NOT_FOUND                     =3D 4                    =20
*     OBJECT                        =3D 5                    =20
*     REFERENCE_CHECK               =3D 6                    =20
*     WRONG_ACCESS_TO_ARCHIVE       =3D 7                    =20
      OTHERS                        =3D 8                    =20
          .                                                =20
  IF SY-SUBRC <> 0.                                        =20
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO      =20
*           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.      =20
    exit.                                                  =20
  ENDIF.                                                   =20
  loop at lines into line.                                 =20
    append line-tdline to object-subjecttext.              =20
  endloop.                                                 =20
  SWC_SET_TABLE CONTAINER 'SubjectText' OBJECT-SUBJECTTEXT.=20
END_PROPERTY.
 
 -----Original Message-----
From:   SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU]  On Behalf Of Wiz=
 David
Sent:   Tuesday, February 17, 2004 4:01 AM
To:     SAP-WUG at MITVMA.MIT.EDU
Subject:        How to get longtext via function read_text into my business object=
?
 
Hi all,
 
I need to create a virtual attribute (multi line) that will contain the lon=
g text that I will get from table stxh via function read_text. How can I do=
 that in my business object?
 
 
 
TIA
 
 
 
Wiz
 
 
 
 
---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
 
---------------------------------------------------------------------------=
---------------------
This message is for the designated recipient only and may
contain privileged, proprietary, or otherwise private information. =20
If you have received it in error, please notify the sender
immediately and delete the original.  Any unauthorized use of
this email is prohibited.
---------------------------------------------------------------------------=
---------------------
[mf2]
 


More information about the SAP-WUG mailing list