on 08-24-2012 2:23 PM
I am writing a calculation view, and unfortunately, I must loop over a table variable, because I need to update a row on the current row based on the value of the prior row (old COBOL control break logic). How do I do this? I tried to use a cursor and it did not work.
Thanks,
Raphael
P.S. I already know that this will not be the efficient, but it is the only way that I can think of to accomplish my task.
Hi Raphael,
Are you trying to write a procedure to update the table. The Calculation view is to display the data.
Can you please post your code. It will be helpful in understand why it is not working as per your expectations.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to do the following in a calculation view. I want to display var_out to the user. My end logic will be much more complicated, but I can not get this basic example to work:
var_out = select salary from employee;
v_number :=0;
for var_out as var_out do
v_number := row_var.salary+v_number;
row_var = v_number;
end for;
I get the following error:
Calculation View: SQL: identifier is not a cursor
Thanks,
Raphael
Hi Raphael,
Since you haven't posted the complete code, I am going ahead with some assumptions.
- The var_out in general Calculation view is the output structure. It is not a cursor defined, hence you are getting the error message.
- Secondly, what I believe is you need a procedure with SQL output (WITH RESULT VIEW). In the procedure you can update the table and then produce the output. You can refer to sample examples on Cursor in the document http://scn.sap.com/docs/DOC-27981.
Hope this helps.
Regards,
Ravi
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.