REPORT Y10028. DATA IT_DATA TYPE STANDARD TABLE OF TLINE . DATA W_DATA TYPE TLINE. DATA ID LIKE THEAD-TDID. DATA LANGUAGE LIKE THEAD-TDSPRAS. DATA NAME LIKE THEAD-TDNAME. DATA OBJECT LIKE THEAD-TDOBJECT. START-OF-SELECTION. ID = '0001'. LANGUAGE = 'EN'. NAME = '0080000023000010'. OBJECT = 'VBBP'. CALL FUNCTION 'READ_TEXT' EXPORTING * CLIENT = SY-MANDT ID = ID LANGUAGE = LANGUAGE NAME = NAME OBJECT = OBJECT * ARCHIVE_HANDLE = 0 * LOCAL_CAT = ' ' * IMPORTING * HEADER = TABLES LINES = IT_DATA * 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_DATA INTO W_DATA. WRITE:/ W_DATA-TDLINE. ENDLOOP. 1.1.1.3. 显示结果
1.1.2. 写入长文本 有时需要将其他的系统的资料Upload到长文本字段中,或者将资料从文字档、Excel档Upload到长文本字段中,使用BDC比较麻烦,这个时候可以使用SAVE_TEXT Function来写入长文本。查找Text ID,Text Object的方法在上一个章节已经说明,这里不再重复。 REPORT Y10028. DATA HEADER LIKE THEAD. DATA LINES TYPE STANDARD TABLE OF TLINE . DATA W_LINE TYPE TLINE.