‎2006 Jun 27 2:49 PM
i made this comma
DATA : zins LIKE ztable.
INSERT ztable FROM zins.
this takes a lot of time (se30)
why?????
‎2006 Jun 27 3:45 PM
‎2006 Jun 27 3:54 PM
hi rani,
INSERT dbtab FROM wa. or
INSERT (dbtabname) FROM wa.
Inserts one line into a database table. The line to be inserted is taken from the work area wa and the data read from left to right according to the line structure of the database table dbtab. Here, the structure of wa is not taken into account. For this reason, the work area wa must be at least as wide (see DATA) as the line structure of dbtab, and the alignment of the work area wa must correspond to the alignment of the line structure. Otherwise, a runtime error occurs.
If the database table dbtab or the work area wa contain strings, wa must be compatible with the line structure of dbtab.
When the command has been executed, the system field SY-DBCNT contains the number of inserted lines (0 or 1).
The Return Code is set as follows:
SY-SUBRC = 0:
Line was successfully inserted.
SY-SUBRC = 4:
Line could not be inserted since a line with the same key already exists.
Example
Insert the customer Robinson in the current client:
DATA: wa TYPE scustom.
wa-id = '12400177'.
wa-name = 'Robinson'.
wa-postcode = '69542'.
wa-city = 'Heidelberg'.
wa-custtype = 'P'.
wa-discount = '003'.
wa-telephone = '06201/44889'.
INSERT INTO scustom VALUES wa.
‎2006 Jun 27 3:59 PM
‎2006 Jun 27 4:06 PM
hi rani,
u can also give
DATA : zins LIKE ztable occurs 0 with header line.
INSERT ztable FROM table zins.
‎2006 Jun 27 4:13 PM
u can also add 'accepting duplicate keys' to avoid short dumps.