2018 Sep 12 4:26 PM
Hi all,
(Running Version: 7.00, LVL 17)
We need to insert a lot of data (about 5 million records) from a Z table to another Z table (same structure) in the same system. The target table already exists in the system.
Any easy (and fast) way to do this? All I have been able to find is related to newer versions.
Thanks in davance,
Luis
2018 Sep 12 8:23 PM
2018 Sep 12 8:23 PM
2018 Sep 12 8:39 PM
Mike,
Thanks for your answer. When compiling the program I get:
Field "(" is unknown. It is neither in one of the specified tables nor
defined by a "DATA" statement . . . . . . . . . .
I'm afraid I have a version problem...
Thanks again,
2018 Sep 12 9:08 PM
2018 Sep 12 9:13 PM
Hmm, I dug out my ABAP book to check and you're right that is not available in 7.00.
OK, but 5M records isn't really a huge amount, have you tried with a simple itab transfer?
SELECT * FROM source INTO TABLE itab.
INSERT target FROM itab.
If the system struggles, break it up:
SELECT * FROM source INTO TABLE itab PACKAGE SIZE 500000.
INSERT target FROM itab.
ENDSELECT.
2018 Sep 12 9:15 PM
Matthew,
Had already thought about it. My problem is that I'm getting several errors when running the "native" sql statement. Some of them refer to problems with NULL fields, which I don't realy understand, as the target is an exact copy of the source file. As soon as I wrote a coalesce I began to get 936 errors, which I believe is related to date fields.
Regards,
Luis
2018 Sep 12 9:21 PM
Mike,
That's what I was going to try next. Just wanted to do it with a single INSERT, as I thought it should be a lot more faster and efficient.
Thanks,
Luis
2018 Sep 12 9:42 PM
What was your native SQL statement? Same principle should work.
2018 Sep 13 6:10 AM
If its a one off, efficiency isn't an issue.
But packages of 50000 are default in BW, transferring data from one table to another, so I think it's fairly efficient anyway.
2018 Sep 13 2:44 PM
Matthew,
It's between a one off and once in a (long) while.
I'm somewhat of a newbie in the SAP/ABAP world, and my background is more geared towards IBM's Db2, so my first approach to a problem is to write one heck of SQL statement. I still have to struggle sometimes against the limitations I have with OPEN SQL in our current ABAP version.
Thanks for your help,
Luis.
2018 Sep 14 10:00 AM
It gets much better in later releases. Also check out AMDP and ADBC. 🙂
2018 Sep 14 2:52 PM
(sigh...) One can only hope...:-)
Thanks for the heads up about ADBC and AMDP. The latter looks really nice.
Best Regards,
Luis
2018 Sep 14 3:53 PM
AMDP has its annoyances (especially when it's an HANA Expert Routine in BW). Just found out today that if you want to call a stored procedure from an AMDP, it's only possible if the procedure is in the same name space and the name begins with /BCAMDP/.