‎2010 Nov 26 7:23 AM
hi all,
Is there a way to modify database table dynamically from work area using dynamic sql.
regards
ramesh
Moderator message: please search for available information/documentation before asking.
Edited by: Thomas Zloch on Nov 26, 2010 1:31 PM
‎2010 Nov 26 10:32 AM
tables: mara.
data: tablename type tabname,
fname type fieldname,
fieldnames type fieldname occurs 0.
field-symbols : <fs_tableline> type any,
<fs_fieldval> type any.
initialization.
tablename = 'MARA'.
assign (tablename) to <fs_tableline> .
fname = 'MATNR'.
append fname to fieldnames.
fname = 'MTART'.
append fname to fieldnames.
select (fieldnames)
from (tablename)
up to 20 rows
into corresponding fields of <fs_tableline>.
loop at fieldnames into fname.
assign component fname of structure <fs_tableline> to <fs_fieldval>.
write : <fs_fieldval>.
endloop.
new-line.
endselect.
Also Refer http://www.abapcode.info/2007/12/how-to-use-dynamic-sql-in-abap-report.html
Edited by: Rahul Babukuttan on Nov 26, 2010 11:33 AM
‎2010 Nov 26 10:34 AM
‎2010 Nov 26 11:34 AM
I do hope it's not on standard SAP tables.
If it is: looking forward to your next threads...
‎2010 Nov 26 11:40 AM