‎2009 Feb 02 10:15 AM
Hello experts,
I would like to ask for your help in solving a problem, i'm currently stuck at this and can't proceed with the requirement.
I would like to declare a deep structure in a table and was able to come up with this in procedural programming:
****************************************************
tables: zsd_output_net.
data: begin of t_table_structure occurs 0.
include structure zsd_output_net.
data end of t_table_structure.
types: begin of t_output_all,
bukrs type anla-bukrs,
out_table like t_table_structure occurs 0,
end of t_output_all.
data: gt_output_all type standard table of t_output_all with header line,
wa_out_table like line of t_table_structure.
**************************************************
This worked and I was able to append entries to table out_table. However, I'm having trouble translating this to OOP since OOP does not support declaration with "OCCURS".
Here's what I came up in OOP:
**************************************************
data: begin of t_table_structure.
include structure zsd_output_net.
data end of t_table_structure.
types: begin of t_inner_table,
in_table like t_table_structure,
end of t_inner_table.
types: begin of t_output_all,
bukrs type anla-bukrs,
out_table type t_inner_table initial size 1,
end of t_output_all.
data: gt_output_all type standard table of t_output_all,
wa_output_all type t_output_all,
gt_inner_table type standard table of t_inner_table,
wa_inner_table type t_inner_table,
wa_out_table like t_table_structure.
**************************************************************
This did not work because out_table just became a structure and not a table in a table. What should I do so that I would get the same effect as with structural programming?
‎2009 Feb 02 10:21 AM
what I came up in OOP:
**************************************************
data: begin of t_table_structure.
include structure zsd_output_net.
data end of t_table_structure.
types: begin of t_inner_table,
in_table like t_table_structure,
end of t_inner_table.
data :gt_inner_table type standard table of t_inner_table,
wa_inner_table type t_inner_table.
types: begin of t_output_all,
bukrs type anla-bukrs,
out_table type gt_inner_table ,
end of t_output_all.
data: gt_output_all type standard table of t_output_all,
wa_output_all type t_output_all,
wa_out_table like t_table_structure.
‎2009 Feb 02 10:21 AM
what I came up in OOP:
**************************************************
data: begin of t_table_structure.
include structure zsd_output_net.
data end of t_table_structure.
types: begin of t_inner_table,
in_table like t_table_structure,
end of t_inner_table.
data :gt_inner_table type standard table of t_inner_table,
wa_inner_table type t_inner_table.
types: begin of t_output_all,
bukrs type anla-bukrs,
out_table type gt_inner_table ,
end of t_output_all.
data: gt_output_all type standard table of t_output_all,
wa_output_all type t_output_all,
wa_out_table like t_table_structure.
‎2009 Feb 03 1:30 AM