‎2009 Aug 12 10:54 AM
hi
I am trying to insert values from a deep structure into a database table.
if I have a structure xixi_stvalues which has
id which is of type char7
type of type char20
results of type xixi_ttresults <- this is a table, implying that the xixi_stvalues is a deep structure
Now...I want to save both id and type into xixi_dbvalues
I tried this:
Insert into xixi_dbvalues values xixi_stvalues-id xixi_stvalues-type.
this tells me thatexpects a '.' after
I HAVE ALREADY TRIED USING HELP.
Thanks
‎2009 Aug 12 11:06 AM
Hi charla6,
For example there is a 3D internal table (it_tab) like this....
Name
Age
Address --> houseno, street1, street2. (type table field)
vehicle
now create a data like this
DATA: it_add like line of it_tab-address.
loop at it_tab-address into it_add.
"this will give u all the field values like it_add-houseno, it_add-street1, it_add-street2.
endloop.
like this u can read all the 3D internal tables
Do reply if still problem persist.
Thanks
Rohit G
Edited by: Rohit Gaharwar on Aug 12, 2009 12:06 PM
‎2009 Aug 12 11:24 AM
Please try not to use the same subject for your various posts - it makes it look like you're posting duplicates.
If you read the help for INSERT again, you'll see that VALUES expects a work area - not a list of values. There's even an example.
You need to create a work area with the same structure as your database table, move id and type into that, and then use INSERT ... VALUES wa.
matt
‎2009 Aug 12 11:30 AM
read the data from the deep structure
then pass to a variable and from that variable do the operation .
‎2009 Aug 12 12:21 PM
Hi ,
try this....
Insert into dbtab values <workarea>.
or
insert dbtab from <workarea>
Insert into xixi_dbvalues values xixi_stvalues.
or
Insert xixi_dbvalues from xixi_stvalues.
Regards.
‎2009 Aug 12 12:29 PM