10-18-2007 12:17 PM
Hi,
I have a requirement where i have to upload data from excel file to ztable.I have used the fm 'ALSM_EXCEL_TO_INTERNAL_TABLE' for reading the excel file.After reading the excel file i have used INSERT zrb_hdr from table t_zrb_hdr for updating the ztable with data .
here it is giving error as the data base table zrb_hdr and the internal table t_zrb_hdr should be declared of same type .
I got this error b'coz i have changed the date and time fields in t_zrb_hdr table to char type.so the structure of zrb_hdr and t_zrb_hdr are not same.If i don't change the date and time fields,in the o/p i am not getting proper date and time formats.
now how can i upload data into ztable?
10-18-2007 12:35 PM
create one more itab with same structure as that of your z table...
in the existing table change date and time acc. to your need...then move entire data from this itab to new itab..
pass this itab to 'ALSM_EXCEL_TO_INTERNAL_TABLE'
10-18-2007 1:30 PM
hi,
How can i move the entire data from old internal table to new internal table?
10-18-2007 12:42 PM
Hi,
Data : itab type standard table of ZTABLE.
INSERT INTO ZTABLE from table ITAB.
Itab here is declared as ZTABLE.
10-18-2007 12:53 PM
Hi hema,
declare t_zrb_hdr of the type of your Ztable.
loop at values read from xls and populate t_zrb_hdr .
10-18-2007 1:36 PM
loop at itab_old.
MOVE-CORRESPONDING itab_old to itab_new.
append itab_new.
endloop.
10-18-2007 1:43 PM
hi,
for copying internal table use.
append lines of itab_old to utab_new.
Regards
Gagan
10-18-2007 1:55 PM
Hi,
Try this.
Data: itab type standard table of ztable,
wa_itab type ztable.
loop at t_zrb_hdr into wa_t_zrb_hdr.
wa_itab-date = wa_t_zrb_hdr-date.
wa_itab-time = wa_t_zrb_hdr-time.
like move all the fiedl to wa_itab...........
append itab with wa_itab.
Endloop.
now insert the records from itab to the database table ztable.
Thanks,
Muthu.