系统:S4 1909。Tocde:MM03,物料的附加数据——>基本数据文本中的长文本写入
查看写入文本的参数
点击如下图所示的编辑按钮
然后点击转到——>表头
然后就可以看到表头数据了
测试代码如下:
DATA:ls_theader TYPE thead, "长文本的head
lt_lines TYPE TABLE OF tline,
ls_lines TYPE tline.
ls_theader-tdobject = 'MATERIAL'."固定值
ls_theader-tdname = ls_head-matnr."物料编码(如果有前导零的话,一定要补上)
ls_theader-tdid = 'GRUN'."固定值
ls_theader-tdspras = sy-langu.
ls_lines-tdformat = '*'.
ls_lines-tdline = ls_head-tdrefname.
APPEND ls_lines TO lt_lines.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = ls_theader
* INSERT = ' '
savemode_direct = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* KEEP_LAST_CHANGED = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
lines = lt_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CLEAR:ls_theader,
ls_lines,lt_lines.