SAP通过函数READ_TEXT读取长文本

1.查看文本表头信息

事务码VF02, Goto->Item->Item Texts
SAP通过函数READ_TEXT读取长文本_第1张图片
双击空白文本
SAP通过函数READ_TEXT读取长文本_第2张图片
Goto -> Header
SAP通过函数READ_TEXT读取长文本_第3张图片
然后我们就可以得到文本的表头信息

SAP通过函数READ_TEXT读取长文本_第4张图片
已有文本读文本

 IF is_xvbrp-vbeln IS INITIAL.
      lv_source_tdname = 'XXXXXXXXXX'.
    ELSE.
      lv_source_tdname = is_xvbrp-vbeln && is_xvbrp-posnr.
    ENDIF.
*    CALL FUNCTION 'READ_TEXT'
*      EXPORTING
*        id                      = mc_source_tdid        "Y831
*        language                = is_language           "ES
*        name                    = lv_source_tdname      "9026049901001000
*        object                  = mc_source_tdobject    "VBBP
*      IMPORTING
*        header                  = es_thead
*      TABLES
*        lines                   = ct_tlinetab
*      EXCEPTIONS
*        id                      = 1
*        language                = 2
*        name                    = 3
*        not_found               = 4
*        object                  = 5
*        reference_check         = 6
*        wrong_access_to_archive = 7
*        OTHERS                  = 8.
loop at ct_tlinetab in to ls_tlinetab.

''''''''''''''''''''''''''''''''''''''''
endloop.
"保存文本

 CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        header    = es_thead
      IMPORTING
        newheader = ls_thead
      TABLES
        lines     = ct_tlinetab
      EXCEPTIONS
        id        = 1
        language  = 2
        name      = 3
        object    = 4
        OTHERS    = 5.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

创建填充文本

*full the header
    es_thead-tdid         = mc_tdid.
    es_thead-tdform       = 'SYSTEM'.
    es_thead-tdlinesize   = 72.
    es_thead-mandt        = sy-mandt.
    es_thead-tdobject     = mc_tdobject.
    es_thead-tdname       = lv_source_tdname.
    es_thead-tdspras      = is_language.
'''''''''''''''''''''''''''''''''''''''
ls_tlinetab = '''''''''''''''''''''.
append ls_tlinetab to ct_tlinetab.

"保存文本

 CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        header    = es_thead
      IMPORTING
        newheader = ls_thead
      TABLES
        lines     = ct_tlinetab
      EXCEPTIONS
        id        = 1
        language  = 2
        name      = 3
        object    = 4
        OTHERS    = 5.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

你可能感兴趣的:(android)