ITeye博客

如何从类方法中返回动态内表。

pentium100 · 2014-11-06 11:20 · SAP R/3 · 编程语言 · Markdown

如何从类方法中返回动态内表。

class-methods aggregation importing value(i_table) type table exporting value(o_table) type table value(o_table2) type ref to data .

types: begin of t_line, col1 type i , col2 type i , col3 type i , end of t_line.

data: l_line type t_line. data: lt_line type table of t_line.

field-symbols: <fs_table> type table.

"一定要通过create data创建,不能直接用lt_line, "因为lt_line会在方法执行完后,被释放掉。 create data o_table2 like lt_line.
assign o_table2->* to <fs_table>.

loop at i_table assigning <dyn_wa>. l_line-col1 = 1111. append l_line to <fs_table> . endloop.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。