Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Script Calculation view - Update cursor and Insert/Update en Temporary table.

$
0
0

Hi,

I have the following code on a  Script Calculation View. But it throws the error. The purpose is to perform a select in a cursor, cursor update fields and further insert the data into a temporary table.

 

Any better ideas to achieve the same goal.

 

Best regards,

 

PD: Utilization BKPF table is only for example.

 

  /********* Begin Procedure Script ************/
BEGIN   
 declare cursor c_bkpf for                select *                                from "SAP"."BKPF"                                where "MANDT"='100';        lt_bkpf_tmp = SELECT top 0 * FROM "SAP"."BKPF";                    for cur_row as c_bkpf do                insert :lt_bkpf_tmp into (cur_row."MANDT", cur_row."BUKRS", cur_row."BELNR", cur_row."GJAHR");                                 update c_bkpf set "BKTXT"='Test'                                 where current of c_bkpf;                update :lt_bkpf_tmp set "BKTXT"='Test'                                 where "MANDT" = cur_row."MANDT"                                   and "BUKRS" = cur_row."BUKRS"                                                  and "BELNR" = cur_row."BELNR"                                                  and "GJAHR" = cur_row."GJAHR";    end for;                                var_out:               select "MANDT", "BUKRS", "BELNR", "GJAHR", "BKTXT"                                                                                from :lt_bkpf_tmp;
END /********* End Procedure Script ************/

Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>