‎2014 Jul 15 8:23 AM
Hi all
I define a structure(not build in database) in program and create a inner table with this structure.
now, i want to assign a pointer to the inner table and a pointer to a work area.How?
for example
data: begin of ty_test1 occur,
fname type char10,
fid type char10,
.....
end of ty_test1.
data: begin of ty_test2,
fname2 type char10,
fid2 type char10,
.....
end of ty_test2.
I need to define a pointer <fs_table> and assign to the inner table(ty_test1 or ty_test2) according customer select.And process data....
Thanks
Kical
‎2014 Jul 15 8:37 AM
Hi Kical,
Please check the code below:
DATA: BEGIN OF ty_test1 OCCURS 0,
fname TYPE char10,
fid TYPE char10,
END OF ty_test1.
DATA: BEGIN OF ty_test2,
fname2 TYPE char10,
fid2 TYPE char10,
END OF ty_test2.
FIELD-SYMBOLS:<fs1> TYPE ANY TABLE,
<fs2> LIKE ty_test2.
ASSIGN:ty_test1[] TO <fs1>,
ty_test2 TO <fs2>.
Sam
‎2014 Jul 15 8:32 AM
Hi,
Field-symbols: <fs_table> type table of (ur structure name).
Regards:
‎2014 Jul 15 9:00 AM
Hi Somendra,
I'm afraid this is a wrong statement to define a field-symbol for table.
You can type a table type or a generic type but not this statement.
Thanks,
Sam
‎2014 Jul 15 8:37 AM
Hi Kical,
Please check the code below:
DATA: BEGIN OF ty_test1 OCCURS 0,
fname TYPE char10,
fid TYPE char10,
END OF ty_test1.
DATA: BEGIN OF ty_test2,
fname2 TYPE char10,
fid2 TYPE char10,
END OF ty_test2.
FIELD-SYMBOLS:<fs1> TYPE ANY TABLE,
<fs2> LIKE ty_test2.
ASSIGN:ty_test1[] TO <fs1>,
ty_test2 TO <fs2>.
Sam
‎2014 Jul 15 8:52 AM