Google Search - Blog...........

Use Of Field Symbols In Methods(Program type).

report zfieldsymbols_methods_tables .

field-symbols: type table.

*---------------------------------------------------------------------*
* CLASS lclapp DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class lclapp definition.

public section.

data: itabb type table of i.
data: xtabb type i.


methods: constructor,
get_table importing im_table type string
exporting ex_table type any table.

endclass.


*---------------------------------------------------------------------*
* CLASS lclapp IMPLEMENTATION
*---------------------------------------------------------------------*
class lclapp implementation.

method constructor.

xtabb = 10. append xtabb to itabb.
xtabb = 20. append xtabb to itabb.
xtabb = 30. append xtabb to itabb.

endmethod.

method get_table.

data: internaltable(30) type c.
concatenate im_table '[]' into internaltable.
assign (internaltable) to .
ex_table = .

endmethod.

endclass.

data: myapp type ref to lclapp.
data: imytab type table of i.
data: xmytab type i.

start-of-selection.

create object myapp.


call method myapp->get_table
exporting
im_table = 'ITABB'
importing
ex_table = imytab.


loop at imytab into xmytab.
write:/ xmytab.
endloop.

No comments:

Post a Comment