2006 Jul 03 1:54 PM
i want to insert data from ITAB into ZTABLE(SE11)
<b>how i can do it.</b>
i made this but i get dump
bestand---itab
zmb5b--table in se11
INSERT zmb5b FROM bestand.
PLS
2006 Jul 03 2:12 PM
Does ITAB have the same structure as ZMB5B? If not, they should be the same. If they are not the same, you can use another work area. Also, what does the dump say?
THis would be inserting one record at a time.
data: xzmb5b type zbm5b.
move-corresponding bestand to xzmb5b.
insert zmb5b from xzmb5b.
THis would be inserting all records of itab if the structure was the same.
insert zmb5b from table itab.
Regards,
Rich Heilman
2006 Jul 03 2:10 PM
Hi,
Check this syntax:
INSERT (dbtabname) FROM TABLE itab.
Laxman
2006 Jul 03 2:11 PM
Hi,
did you have create BESTAND like this:
data : bestand like table of ztable with header line.
??
Rgd
Frédéric
2006 Jul 03 2:12 PM
Does ITAB have the same structure as ZMB5B? If not, they should be the same. If they are not the same, you can use another work area. Also, what does the dump say?
THis would be inserting one record at a time.
data: xzmb5b type zbm5b.
move-corresponding bestand to xzmb5b.
insert zmb5b from xzmb5b.
THis would be inserting all records of itab if the structure was the same.
insert zmb5b from table itab.
Regards,
Rich Heilman
2006 Jul 03 2:19 PM
bestand it's itab form trans MB5b
i made you say rich it's not work i tried both.
2006 Jul 03 2:20 PM
2006 Jul 03 2:29 PM
Hi
You have to define ITAB as ZTABLE, so it needs the MANDT too.
DATA: ITAB LIKE TABLE OF ZTABLE WITH HEADER LINE.
2006 Jul 03 2:31 PM
Then you need to move the data to an itab where the structure is exactly the same. You can loop the BESTAND intab and move the values to an itab just like your "Z" table.
data: upd_tab type table of zmb5b with header line.
clear upd_tab. refresh upd_tab.
loop at bestand.
move-corresponding bestand to upd_tab.
append upd_tab.
endloop.
insert zmb5b from table upd_tab.
Regards,
Rich Heilman
2006 Jul 03 3:40 PM
thanks it's work
but wht e didnt take bestand from the beging
i reward point
thanks again.
2006 Jul 03 2:13 PM
Hello,
If u want to insert a record from Itab, it should satisfy these condiitons.
1. Itab should have the structure similar to ZTABLE.
2. The Key fields value should not be repeated.
Hope this will be helpful for u.
Dön't forget to award points.
Regards,
Vasanth
2006 Jul 03 2:14 PM
Hi
But what' ITAB? An internal table or field of ZMB5B?
and TABLE?
DATA: BESTAND LIKE ZMB5B.
BESTAND-ITAB = .....
INSERT zmb5b FROM bestand.
or
DATA: BESTAND LIKE TABLE OF ZMB5B WITH HEADER LINE.
BESTAND-ITAB = .....
APPEND BESTAND.
INSERT zmb5b FROM TABLE bestand.
Max
2006 Jul 03 2:43 PM
ur syntax is correct,,
but makesure...
bestand(itab) is same structure of zmb5b(table in se11)
...read this for further details.....
INSERT dbtab [CLIENT SPECIFIED] FROM TABLE itab. or INSERT (dbtabname) [CLIENT SPECIFIED] FROM TABLE itab.
Addition: ... ACCEPTING DUPLICATE KEYS
Effect
Mass insert: Inserts all lines of table itab in a single operation. The lines of itab must satisfy the same condition as the work area wa in variant 1.
After the statement has been executed, the system field SY-DBCNT contains the number of lines inserted.
The return code is set as follows:
SY-SUBRC = 0:
All lines inserted successfully. Any other situation causes a runtime error.
Note
If the internal table itab is empty, SY-SUBRC and SY-DBCNT are both 0 after the call.
Regards,
Ramesh
Addition
... ACCEPTING DUPLICATE KEYS
Effect
If the system cannot insert a line, the program does not terminate with a runtime error. Instead, SY-SUBRC is set to 4. All lines of the internal table after the one that could not be inserted are still inserted into the database table.