04-23-2006 9:38 AM
REPORT ZDW_LOC_MSTR .
tables : t001l.
data : begin of itab occurs 0.
include structure zloc.
data: end of itab.
field-symbols: <ls_itab> type zloc.
SELECT werks lgort lgobe
FROM T001L
into (t001l-werks , t001l-lgort , t001l-lgobe ).
MOVE: T001L-WERKS TO ITAB-zsite,
T001L-LGORT TO ITAB-zloc,
T001L-LGOBE(8) TO ITAB-zdesc.
append itab.
endselect.
loop at itab assigning <ls_itab>.
<ls_itab>-ztable_name = 'loc'.
endloop.
<b>INSERT zloc_mstr FROM itab .</b>
<b>i tried FROM TABLE itab too.
and i get only 1 record and in debug i see 20 rows why?</b>
04-23-2006 9:54 AM
Hi,
When you say itab, you are referring to the header line which will have only one row. When you say table itab, you are referring to entire table.
In the debug mode, you are looking at the table, which has 20 rows. If you use the FROM TABLE ITAB, you should see 20 rows in the database table.
Regards,
Ravi
04-23-2006 9:57 AM
04-23-2006 10:00 AM
Is that an already existing record in the table?
Put a commit work statement at end.
Regards,
Ravi
04-23-2006 10:05 AM
i add this
INSERT zloc_mstr FROM TABLE itab ACCEPTING DUPLICATE KEYS .
commit work.
and delete all the record and still i get 1 row
04-23-2006 10:08 AM
Can you tell us what are the keys in the table and show us the sample data you are passing, including the duplicates if any?
Regards,
Ravi
04-23-2006 10:10 AM
after using
INSERT zloc_mstr FROM TABLE itab ACCEPTING DUPLICATE KEYS .
statement if only one record is updated in the table (from 25 entries of itab) it means all of them are duplicate records .(same value for key fields)
Regards
Raja
04-23-2006 10:11 AM
the key i mandt only?
the data is mosttly the same always except of site that is change to 800 900 ext....
04-23-2006 10:13 AM
raja hi
if all of them are duplicate ( they not)
so i need to have all the records insert right?
04-23-2006 10:13 AM
That's exactly is the problem, if MANDT is the only key you will NOT be able to enter more than one row. Have a column as a key that will different values. As MANDT will be same across all the rows, it will a duplicate key.
Have a column that will have seq. number.
Regards,
Ravi
04-23-2006 10:19 AM
thanks
i want to give you points but i see that it was answered and i did not mark it?
04-23-2006 10:23 AM
The thread is NOT closed yet, please close the thread and mark all the helpful answers.
Regards,
Ravi