Skip to Content
0
Former Member
Sep 13, 2005 at 03:31 PM

Job Stays running : Throwing ABAP-exceptions

265 Views

Hello,

I have a RFC server written with visual studio .NET and I use SAP.NET connector 2.0.

I want raise the exception to the ABAP program in order to stop the job which is calling the program.

Our problem is this one : this job is not stop every time. In this case is stay in a running state.

To solve the problem we have to select the job and check status in order to stop it.

When we test the RFC function with SE37 transaction sometimes we have the good raise exception else it kill the session.

Working :

- One SAP job scheduled every 5 minutes running an ABAP program

- this program execute a function module which use RFC connection

- Our RFC server .NET (Windows services) listen the RFC call and execute the good .NET method

- this method execute an SQL query and sometimes an error occurs

- the method raise an exception to SAP :

Try

{

....

}

catch(Exception ex)

{

RfcAbapException ns = new RfcAbapException("ERROR_Z_READ_TRANSACTION_SDG", ex.ToString());

throw ns;

}

- the ABAP program always catch the exception : (SM21) :

17:10:21 BTC 16 120 USERNAME AB0 Erreur d'exécution "RAISE_EXCEPTION".

- But the job isn't stopped every times and stay in this case in a running state.

Thank you for your help,

Nicolas US.

The last job raise exception correctly :

I_RESERVATIONS Interr. 05.09.2005 17:09:41 41

SM 21 :

-

-


17:10:21 BTC 16 120 USERNAME AB0 Erreur d'exécution "RAISE_EXCEPTION".

17:10:22 BTC 16 120 USERNAME AB1 > Préparation du vidage d'une partie de la mémoire "050905 171021 mestral USERNAME "

17:10:22 BTC 16 120 USERNAME D01 Transaction termination &9 &9 &5 ( &a &b &c &d &e &f &g &h &i )

17:10:22 BTC 16 120 USERNAME R68 Exécuter roll-back

RFC server log :

-

-


05/09/2005 5:09:44 PM : Z_Mm_Read_Resa_Request()

05/09/2005 5:09:44 PM : Tentative n°1/5 de se connecter à : INT19

05/09/2005 5:09:44 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:09:54 PM : Tentative n°2/5 de se connecter à : INT19

05/09/2005 5:09:54 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:10:04 PM : Tentative n°3/5 de se connecter à : INT19

05/09/2005 5:10:04 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:10:14 PM : Tentative n°4/5 de se connecter à : INT19

05/09/2005 5:10:14 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:10:24 PM : Tentative n°5/5 de se connecter à : INT19

05/09/2005 5:10:24 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:10:24 PM : System.Exception:

-

-


- Interface : MMI10_Reservation -

- Méthode : Z_Mm_Read_Resa_Request -

-

-


OpenConnection() Error INT19 : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

The job in running state (no stopped after error):

I_RESERVATIONS actif 05.09.2005 17:10:41 1,616 sec

SM21 :

-

-


17:11:21 BTC 17 120 USERNAME AB0 Erreur d'exécution "RAISE_EXCEPTION".

17:11:21 BTC 17 120 USERNAME AB1 > Préparation du vidage d'une partie de la mémoire "050905 171121 mestral USERNAME "

????? (no Transaction termination and no rollback)

RFC server log :

-

-


05/09/2005 5:10:43 PM : Tentative n°1/5 de se connecter à : INT19

05/09/2005 5:10:43 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:10:53 PM : Tentative n°2/5 de se connecter à : INT19

05/09/2005 5:10:53 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:11:03 PM : Tentative n°3/5 de se connecter à : INT19

05/09/2005 5:11:03 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:11:13 PM : Tentative n°4/5 de se connecter à : INT19

05/09/2005 5:11:13 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:11:23 PM : Tentative n°5/5 de se connecter à : INT19

05/09/2005 5:11:23 PM : OpenConnection() : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name

05/09/2005 5:11:24 PM : System.Exception:

-

-


- Interface : MMI10_Reservation -

- Méthode : Z_Mm_Read_Resa_Request -

-

-


OpenConnection() Error INT19 : System.Data.OleDb.OleDbException: ORA-12154: TNS:could not resolve service name