‎2006 Sep 07 8:24 AM
Hi!
I have an structure with a lot of fields and I have a database table with less field. Some of the fields of the structure match the database table fields.
is there a way of doing an "INSERT INTO dtbase CORRESPONDING FIELDS FROM struct"??
Or do I have to move each field by:
dbase_table-field1 = struct-field1
dbase_table-field2 = struct-field2
dbase_table-field6 = struct-field6
and so on??
regards
baran
‎2006 Sep 07 8:28 AM
I think the structure of datase table and internal table should be same while inserting , INTO CORRESPONDING will not work,
you have to go for ur second option
‎2006 Sep 07 8:28 AM
HI Baran,
u can directly move the fields by writing
move : struct_field1 to dbtable_field1,
struct_field2 to dbtable_field2.
also u can use move-corresponding .
Regards,
Nagaraj
‎2006 Sep 07 8:28 AM
I think the structure of datase table and internal table should be same while inserting , INTO CORRESPONDING will not work,
you have to go for ur second option
‎2006 Sep 07 10:16 AM
hi baran,
there is an easier way.
code like this.
______________________________________________
data : struct like database_structure.
*suppose there are 3 fields and we want to fill 2 *fields. ie field1 and field3.
struct-field1 = 'val1';
struct-field3= 'val3';
MODIFY data_base_table FROM struct.
_________________________________
this will work.
kindly award points, if u r comfortable with this.
for any clarification just mail me.
Regards,
Anversha.
anversha.shahul@wipro.com
mob 0984 66 77 531