READ_TEXT - ooxxvv/MySAPnotes GitHub Wiki

PageOutline {{{#!comment -------------------- 以上的部份是固定的,不要變動 ----- --------------------------------------- 在建立連結時,請標明連結的頁面類型,例如:wiki:WikiStart,而不要只用 WikiStart ----- }}}

READ_TEXT

  • 用來讀取 Text 欄位的資料

找出某個 Text 的 ID, Name, Object

Image(READ_TEXT001.png)

EXPORTING

IMPORTING

TABLES

EXCEPTIONS

Attributes

Methods

Code

{{{#!abap DATA: l_id LIKE thead-tdid, l_language LIKE thead-tdspras, l_name LIKE thead-tdname, l_object LIKE thead-tdobject. DATA: lt_lines LIKE tline OCCURS 0 WITH HEADER LINE.

*-Get SD header text l_id = 'Z603'. l_language = sy-langu. l_name = lw_vbak-vbeln. l_object = 'VBBK'.

CALL FUNCTION 'READ_TEXT' EXPORTING id = l_id language = l_language name = l_name object = l_object TABLES lines = lt_lines 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 NE 0. f_ktext = space. ELSE. LOOP AT lt_lines. f_ktext = lt_lines-tdline. ENDLOOP. ENDIF. }}}

{{{#!comment -------------------- 以下的部份是固定的,不要變動 ----- }}}