Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Return code for EXECUTE PROCEDURE (native SQL)

Former Member
0 Likes
771

Hi Experts,

I've seen in the Note 364707 that the field %_ERRCODE is no longer supported since WAS 6.10 for stored procedures like this:

EXEC SQL.
  EXECUTE PROCEDURE proc [(parameter list)] %_ERRCODE INTO :rc
ENDEXEC.

So an Upgrade to WAS 7.00 gives this programms an error.

Has anybody an idea for an alternative?

Regards,

Stefan

1 ACCEPTED SOLUTION
Read only

LucianoBentiveg
Active Contributor
0 Likes
506

We are using retrieving error information from stored procedure and using sy-subrc. Example:

EXEC SQL.

execute procedure get_account_info@STEALTH

( in :ACCOUNT,

out :CUST_ID,

out :CUST_NAME,

out :ACC_ADDRESS_STREET,

out :ACC_ADDRESS_NUMBER,

out :ACC_SUBURB,

out :ACC_ADDRESS_CITY,

out :ACC_ADDRESS_FLAT,

out :ACC_ADDRESS_FLOOR,

out :ERRNO,

out :ERRMSG )

ENDEXEC.

IF sy-subrc <> 0.

RAISE err.

ENDIF.

2 REPLIES 2
Read only

LucianoBentiveg
Active Contributor
0 Likes
507

We are using retrieving error information from stored procedure and using sy-subrc. Example:

EXEC SQL.

execute procedure get_account_info@STEALTH

( in :ACCOUNT,

out :CUST_ID,

out :CUST_NAME,

out :ACC_ADDRESS_STREET,

out :ACC_ADDRESS_NUMBER,

out :ACC_SUBURB,

out :ACC_ADDRESS_CITY,

out :ACC_ADDRESS_FLAT,

out :ACC_ADDRESS_FLOOR,

out :ERRNO,

out :ERRMSG )

ENDEXEC.

IF sy-subrc <> 0.

RAISE err.

ENDIF.

Read only

0 Likes
506

Hello Peluka,

i have seen you have worked with 'execute procedure'.

I want to execute a procedure with two Parameters and one structure. Example:

EXECUTE PROCEDURE test.p_getdata ( in :i_ls_nr , in :vdatum , out :vtest ).

vtest has the simple structure with field lieferscheinnr (char25).

When i execute the procedure, i get the error <b>wrong number or types of arguments in call</b>.

Do you know, whether execute procedure with structures is not possible?

Thank you in advance.