on 10-25-2017 5:41 PM
Dear experts,
I need to change only one field in a dataset and upsert it to a physical db table with AMDP. This physical table has too many columns which I do not want to specify all fields, and also developers can add some fields in future and when a new field added I do not want to edit code again and again.
Please see ZAG_SIM is a physical table and lt_result temp table type of ZAG_SIM should read base version and copy this data changing version column entries.
Please advice why UPDATE command is not accepted in eclipse editor?
Thanks in advance,
Ergin Ozturk
Updates on a table variable are not supported by the keyword UPDATE. Since HANA 2.0 SPS01 you can do updates with another syntax. Details can be found here. But personally I haven't tried it yet within an AMDP (maybe there are further restrictions).
If you are not on a HANA revision level which supports that, you can use an index based cell access to update your column (of course a loop has to be done over all entries and each data record has to be accessed by its index).
Another option would be to use a local temporary row table like that:
do
begin
create local temporary row table #test like "ZAG_SIM";
insert into #test select * from "ZAG_SIM";
update #test set "VERSION" = :lv_temp;
...
drop table #test;
end;
You can try both options if you like and share your results on the performance.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Too bad. Have you tried the index-based cell access too?
Hello erginozturk,
It might be an late answer �� ,
But this may help to other.
The easiest way for this is by using select itself.
we can do it as below for the above code:
lt_result = select feild1 , feild2, :lv_temp as version where version = :lv_base and mandt = session_context( 'CLIENT' );
We don't have to loop which may have performance to it.
Regards,
Rahul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.