SAP 文本相关表格及读写

REPORT zmm000071 NO STANDARD PAGE HEADING
                     MESSAGE-ID zpc.

TABLES: konp.
DATA:   BEGIN OF tline OCCURS 2.
        INCLUDE STRUCTURE tline.
DATA:   END OF tline.
DATA: bline LIKE TABLE OF tline WITH HEADER LINE.
DATA: BEGIN OF itab OCCURS 0,
      knumh LIKE konp-knumh,
      kopos LIKE konp-kopos,
      END OF itab.
DATA: utname LIKE thead-tdname.
DATA: BEGIN OF header OCCURS 0.
        INCLUDE STRUCTURE thead.
DATA: END OF header.

START-OF-SELECTION.
  PERFORM read_text.
  PERFORM change_text.
*&---------------------------------------------------------------------*
*&      Form  read_text
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM read_text.
  itab-knumh = '0000059145'.  "兵ン癘魁腹
  itab-kopos = '01'.          "兵ン癘魁腹
  APPEND itab.
  LOOP AT itab.
    CLEAR utname.
    CONCATENATE itab-knumh itab-kopos INTO utname.
    CLEAR tline.
    CALL FUNCTION 'READ_TEXT'
         EXPORTING
              client         = sy-mandt
              id             = '1002'
              language       = 'M'
              object         = 'KONP'
              name           = utname
              archive_handle = 0
         IMPORTING
              header         = header
         TABLES
              lines          = tline
         EXCEPTIONS
              not_found      = 4.
    IF sy-subrc = 0.
*      LOOP AT tline.
*        WRITE:/ tline-tdline.
*      ENDLOOP.
      bline[] = tline[].
*      tline-tdline = '發祇布癘魁1'.
*      APPEND tline.
*      tline-tdline = '發祇布癘魁2'.
*      APPEND tline.

**  CALL FUNCTION 'EDIT_TEXT'
**       EXPORTING
**            editor_title = '絪胯ずゅ家舱'
**            header       = header
**            save         = 'X'
**       TABLES
**            lines        = tline
**       EXCEPTIONS
**            id           = 01
**            language     = 02
**            linesize     = 03
**            name         = 04
**            object       = 05.
**  WRITE :/ 'edit_text',sy-subrc .

      LOOP AT tline.
        IF sy-tabix <> 1.
          DELETE tline.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'SAVE_TEXT'
           EXPORTING
                client          = sy-mandt
                header          = header
                savemode_direct = 'X'
           TABLES
                lines           = tline
           EXCEPTIONS
                id              = 1
                language        = 2
                name            = 3
                object          = 4
                OTHERS          = 5.
      IF sy-subrc = 0.
        MESSAGE s999 WITH 'Θ發ずゅ癘魁'.
        LOOP AT bline.
          WRITE:/ bline-tdline.
        ENDLOOP.
        SKIP.
        LOOP AT tline.
          WRITE:/ tline-tdline.
        ENDLOOP.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " read_text
*&---------------------------------------------------------------------*
*&      Form  change_text
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM change_text.

ENDFORM.                    " change_text 

 

 

相关表格   ttxid ,stxh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值