SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

пытаюсь не подключаться заново если соединение уже откр



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
даня
Участник
Участник



Joined: 30 Jun 2009
Posts: 9

PostPosted: Mon Jul 06, 2009 2:40 pm    Post subject: пытаюсь не подключаться заново если соединение уже откр Reply with quote

хотелось бы не подключаться заново если соединение уже открыто
такой вариант не проходит, прошу помощи:
CONSTANTS dbs TYPE dbcon-con_name VALUE 'TEST'.
DATA dbtype TYPE dbcon_dbms.
SELECT SINGLE dbms FROM dbcon INTO dbtype WHERE con_name = dbs.

IF dbtype <> 'ORA'. EXIT.
EXEC SQL.SET CONNECTION :dbs ENDEXEC. " EXEC SQL.GET CONNECTION :dbs ENDEXEC. - тоже не идет
IF sy-subrc <> 0.
TRY.
EXEC SQL.
CONNECT TO :dbs
ENDEXEC.
IF sy-subrc <> 0. RAISE EXCEPTION TYPE cx_sy_native_sql_error. ENDIF.
ENDTRY.
ENDIF.
ENDIF.
Back to top
View user's profile Send private message
даня
Участник
Участник



Joined: 30 Jun 2009
Posts: 9

PostPosted: Tue Jul 07, 2009 9:46 am    Post subject: Reply with quote

TRY.
EXEC SQL.
SET CONNECTION :con_name
ENDEXEC.
IF SY-SUBRC <> 0. " not open
EXEC SQL.
CONNECT TO :con_name "opening
ENDEXEC.
IF SY-SUBRC <> 0.
subrc = 4.
RAISE EXCEPTION TYPE cx_sy_native_sql_error.
ENDIF.
ENDIF.

Тема закрыта)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.