Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Trainee
Date of registration: Mar 13th 2009
Location: Oberirsen - Germany
Occupation: Senior Software Engineer
Hobbies: Programming aund Photography
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
'-Begin Class----------------------------------------------------------- Implements DestinationDataProvider '-Variables----------------------------------------------------------- Private eL As DestinationDataEventListener Private ABAP_AS_Prop As Properties '--------------------------------------------------------------------- Public Function GetDestinationProperties(destName As String) As _ Properties If (destName = "ABAP_AS") And (ABAP_AS_Prop <> Null) Then GetDestinationProperties = ABAP_AS_Prop Else GetDestinationProperties = Null End If End Function '--------------------------------------------------------------------- Public Sub SetDestinationDataEventListener(EventListener As _ DestinationDataEventListener) eL = EventListener End Sub '--------------------------------------------------------------------- Public Function SupportsEvents() As Boolean SupportsEvents = True End Function '--------------------------------------------------------------------- Public Sub ChangePropertiesForABAP_AS(Prop As Properties) If Prop = Null Then eL.deleted("ABAP_AS") ABAP_AS_Prop = Null Else If (ABAP_AS_Prop <> Null) And (ABAP_AS_Prop <> Prop) Then eL.updated("ABAP_AS") ABAP_AS_Prop = Prop End If End If End Sub '-End------------------------------------------------------------------- |
Jabaco Source |
|
1 |
Dim myDestDataProv As New myDestinationDataProvider |
This post has been edited 2 times, last edit by "Stefan Schnell" (Apr 16th 2009, 11:10pm)
Administrator
Date of registration: Jul 16th 2008
Location: Erlangen, Germany
Occupation: Software Developer
Hobbies: Jabaco, game theory, text-mining
Methoden mit einem Unterstrich werden bei der automatischen Vervollständigung nicht angezeigt - du kannst die Methode aber trotzdem verwenden. Ich würde den Namen der Methode ändern, wenn diese nicht zu dem Interface "DestinationDataProvider" gehört.Quoted
Public Sub ChangePropertiesForABAP_AS(Prop As Properties)
Die Klassen werden nur unter bestimmten Voraussetzungen aktualisiert. In der nächsten Version wird sich dieses Verhalten noch verbessern...Quoted
Auch habe ich das Problem, das nach Änderung eines Klassen-Moduls nicht sofort alle Methoden sichtbar werden
Danke für diesen Hinweis. Ich werde das noch genauer prüfen...Quoted
wie oben zu sehen private Attribute sichtbar sind
Trainee
Date of registration: Mar 13th 2009
Location: Oberirsen - Germany
Occupation: Senior Software Engineer
Hobbies: Programming aund Photography
Source code |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
import java.util.Properties; import com.sap.conn.jco.JCoDestination; import com.sap.conn.jco.JCoDestinationManager; import com.sap.conn.jco.JCoRepository; import com.sap.conn.jco.ext.DestinationDataEventListener; import com.sap.conn.jco.ext.DestinationDataProvider; import com.sap.conn.jco.JCoFunction; import com.sap.conn.jco.JCoContext; import com.sap.conn.jco.JCoTable; public class SAPCon { public static class MyDestinationDataProvider implements DestinationDataProvider{ private DestinationDataEventListener eL; private Properties ABAP_AS_properties; public Properties getDestinationProperties(String destinationName){ if (destinationName.equals("ABAP_AS") && ABAP_AS_properties != null) return ABAP_AS_properties; return null;} public void setDestinationDataEventListener(DestinationDataEventListener eventListener){ this.eL = eventListener;} public boolean supportsEvents(){return true;} void changePropertiesForABAP_AS(Properties properties){ if (properties == null){ eL.deleted("ABAP_AS"); ABAP_AS_properties = null;} else{ if (ABAP_AS_properties != null && !ABAP_AS_properties.equals(properties)) eL.updated("ABAP_AS"); ABAP_AS_properties = properties;}} } public static void main(String[] args) throws Exception{ Properties connectProperties = new Properties(); connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "10.100.200.100"); connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "99"); connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "099"); connectProperties.setProperty(DestinationDataProvider.JCO_USER, "bambi"); connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "hugo"); connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "DE"); MyDestinationDataProvider myProvider = new MyDestinationDataProvider(); com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(myProvider); myProvider.changePropertiesForABAP_AS(connectProperties); try{ JCoDestination dest = JCoDestinationManager.getDestination("ABAP_AS"); dest.ping(); System.out.println(dest.getAttributes());} catch (Exception e){}}} com.sap.conn.jco.ext.Environment.unregisterDestinationDataProvider(myProvider); connectProperties.clear(); |
This post has been edited 2 times, last edit by "StefanSchnell" (Oct 5th 2010, 9:43am)
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Trainee
Date of registration: Mar 13th 2009
Location: Oberirsen - Germany
Occupation: Senior Software Engineer
Hobbies: Programming aund Photography
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Quoted
The SAP JCo is only available from SAP for connecting Java Applications to SAP Systems. Other than the above permitted usage is not allowed by SAP. The redistribution of the SAP JCo is not allowed. The terms and regulations of the respective End User License Agreement shall otherwise apply.
Java® is a registered trademark of Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303, USA.
All SAP connectors are licensed without additional license fees as part of the respective solution or component license. However, please note that each developer using a connector is required to get a respective development license and that all users accessing application functionality through the relevant connector are required to be licensed under a respective solution or component license.
Answers to frequently asked questions about the license terms of SAP JCo can be found on the FAQs Page of SAP JCo, especially under questions and answers from number 12 through number 17.