‎2006 Jun 12 2:05 PM
Hello all,
I am required to delete a desired field from a table dyanmically through a program.
dynamically it has to delete content of that field and then it should dynamically delete that field from that table
‎2006 Jun 12 2:33 PM
Hi,
for deletion of field you can do some thing like this..
data: wa type dd03l.
data: field like dd03l-fieldname,
itab like ztest_sav occurs 0 with header line.
wa_tab like ztest_table.
select single * from ZTEST_TABLE into wa_tab where FIELD = 'TEST'.
clear wa_tab-field.
modify ZTEST_TABLE FROM WA.
if sy-subrc = 0.
commit work.
endif.
select single * from dd03l
into wa
where tabname = 'ZTEST_TABLE'
and fieldname = 'FIELD'.
DELETE DD03L FROM wa. "deletion fo field
if sy-subrc = 0.
COMMIT WORK.
endif.i don't think this is the Proper way to delete the field from table.
But check it.
Regards
vijay
‎2006 Jun 12 2:33 PM
Hi,
for deletion of field you can do some thing like this..
data: wa type dd03l.
data: field like dd03l-fieldname,
itab like ztest_sav occurs 0 with header line.
wa_tab like ztest_table.
select single * from ZTEST_TABLE into wa_tab where FIELD = 'TEST'.
clear wa_tab-field.
modify ZTEST_TABLE FROM WA.
if sy-subrc = 0.
commit work.
endif.
select single * from dd03l
into wa
where tabname = 'ZTEST_TABLE'
and fieldname = 'FIELD'.
DELETE DD03L FROM wa. "deletion fo field
if sy-subrc = 0.
COMMIT WORK.
endif.i don't think this is the Proper way to delete the field from table.
But check it.
Regards
vijay
‎2006 Jun 12 4:14 PM
Vijay,
is it requried to delete only from dd30l ...? coz if you look in to dd03m view table we have 3 table...!is it not requierd to delete from those tables also???
‎2006 Jun 12 4:19 PM