Quantcast
Channel: SCN : Popular Discussions - ABAP和Java开发 (ABAP & Java Development)
Viewing all articles
Browse latest Browse all 4604

DOI输出数据到Word不能用Insert_table and Insert_table METHOD

$
0
0

我用下面的方法去insert数据到Word,"Word template是只有一个test字符的空白Word"

*Get the area

  CALL METHOD ref_word_document->search

    EXPORTING

      search_string = 'test'

      pos           = '0'

      flag          = space

    IMPORTING

      retcode       = g_retcode.

 

    lw_info-colindex = 0.

    APPEND lw_info TO lt_info.

 

*Insert tabel to current area.

    TYPES:BEGIN OF ty_data,

         lv_char  TYPE char20,

         END OF ty_data.

 

    DATA: lw_data TYPE ty_data.

    DATA: lt_data TYPE TABLE OF ty_data.

    lw_data-lv_char = 'test the insert data to word'.

    APPEND lw_data TO lt_data.

 

  CALL METHOD ref_word_document->insert_table

    EXPORTING

      data_table      = p_lt_data[]

      info_table      = p_lt_info[]

      lowerbound      = 0

      upperbound      = 0

      doctable_number = 1

      clearoption     = 1

      startrow        = 1

      varsize         = 'X'

      no_flush        = space

    IMPORTING

      retcode         = g_retcode

      error           = g_error.

 

但是运行程序出现了g_retcode显示了"CONTROL_INTERNAL_ERROR"。

而且p_lt_data的数据没有插入到Word中去。

我要怎么解决这个问题啊?谢谢~

能不能给一些例子关于怎么用这个Method的。我看SAP Help但那里只有一些参数的解释。


Viewing all articles
Browse latest Browse all 4604

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>