ABAP Header Text Operation

1. For example, find the header text of the purchase order, etc.

2. First query the STXH table according to the purchase voucher or user, and the sales order search is the same.

3. Read the text according to the function READ_TEXT for splicing

CLIENT: client

ID: Identification

LANGUAGE: Language

NAME: text name

OBJECT: Object

4. Splice the returned tables to get long text

5. Create text

  DATA:LT_TLINE TYPE STANDARD TABLE OF TLINE,
       LS_TLINE LIKE TLINE,
       LV_11 TYPE tdobname.

CALL FUNCTION 'CREATE_TEXT'
        EXPORTING
          FID         = 'XX'   "在STXH代表标识
          FLANGUAGE   = sy-langu
          FNAME       = LV_11  "文本名 正常抬头放凭证,行项目放凭证+行项目号
          FOBJECT     = 'XX'   "对象 销售订单抬头 VBAK 行项目 VBBP
          SAVE_DIRECT = 'X'
*          FFORMAT     = '*'
        TABLES
          FLINES      = LT_TLINE    "文本内容
        EXCEPTIONS
          NO_INIT     = 1
          NO_SAVE     = 2
          OTHERS      = 3.
      IF SY-SUBRC <> 0.
      ENDIF.

6. Modify the text

Use SAVE_TEXT

Guess you like

Origin blog.csdn.net/wx774891/article/details/112221651