Accessing SAP Tables from a Java application

Hi,
I know, the forum is called "Web Application Server" but because it's Java question I hope to get answers here.
I have a small stand-alone Java application that needs to access (read-only) all records from a SAP table. Is there a possibility to do this without writing a BAPI before?
thanks a lot
Paul

Hi Paul,
You can use JCo to call the standard remote-enabled function RFC_READ_TABLE. There is one annoyance involved with this function, though: each row of data returned is packed into a single string, so you must either specify a delimiter and use e.g. String.split(...) to parse out the column values or use the returned metadata to extract each value based on position and length attributes of the column.
Another option (although this is usually not allowed in a productive environment) is to establish a direct JDBC connection to the database, thus bypassing the ABAP application layer entirely.
Regards,
Thorsten

Similar Messages

  • Access SAP Tables from Java Program

    Hi All,
    We have a requirement to integrate attendance portal(which is done in java) with SAP.
    Our problem is how to access SAP tables from a Java program?
    Database is Sybase.
    Please suggest us a good solution.
    Thanks in advance...

    Did you go through Sap Help?
    Calling BAPIs from Java - BAPI User Guide CA-BFA) - SAP Library
    Regards,
    Philip.

  • Can we access PI tables from WebDynpro Java via PI 7.1?

    Hi Experts
    Is it possible to fetch PI Tables (to display monitoring and alerts as dashboard on portal) from Java Stack. I got some javadocs API SAP Netweaver for PI 7.1 but i don't know how far it can help me in solving my purpose of fetching and displaying the PI monitoring data on Portal.
    https://www.sdn.sap.com/irj/sdn/javadocs
    Please advise if J2EE access to PI Tables is possible or RFC is the suggested solution to fetch PI Monitoring data.
    Thanks
    Neha

    Hi Neha,
    You can access PI tables from Webdynpro Java application using RFC or Webservices. Create RFC or Webservices which will fetch data from the PI tables.Create the required JCO's and the Webdynpro java application which uses the Adaptive RFC model or Adaptive Webservice Model to connect to the ECC system.
    I found a document that speaks about fetching data from SXMB_MONI Standard Table https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050ff4f-84c3-2b10-3d99-8f9c44f57a17
    Hope this is useful.
    Regards,
    Seema Rane.

  • Access ABAP table in Webdynpro Java application

    Hi All
    Is it possible to access ABAP table in Webdynpro Java application
    Please provide your input
    Thanks
    Karthi D.

    Hi you will connect to the remote SAP system, the
    backend, using an Adaptive RFC MOdel. To access database tables, you can make use of existing functions in terms of RFC function modules. For each function module you need, the system generates a corresponding Java proxy class. All the generated proxy classes and interface are bundled together in the RFC model and treated as part
    of your Web Dynpro project
    In WebDynpro java you RFC by using Model :
    Adaptive RFC Model
    1. automatically adapts to changes in function module signature
    2 provides support for data types and extensibility
    3.support for different structure definitions in different backend
    systems (release dependent structures, custom adaptation)
    Basic principles and guidelines
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9eabd9c216de
    See this blog
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2brfc
    http://help.sap.com/saphelp_nw04s/helpdata/en/6a/11f1f29526944e8580c5e59333d96d/frameset.htm
    Thanks,
    Tulasi

  • Insert the data in sap tables from C SHARP application

    Hi All,
                 I want to save some data in sap table from my CSharp(DOTNET)  windows application.I tried with the help of  SAP.Net Connector but that connector is not been supported visual studio 2005 or i not have visual studio 2003 .Soo plz any one can help how i can do this .
    If any one have a idea then plz give me some example also how we did.
    thanks
    regards
    sandeep Dabral

    You have to use SAP .NET connetor to make interface with SAP. This is better way of doing interface between .NET and SAP.
    You create web service (wsdl) in .NET 2003 and try to use that in .NET 2005.
    You're getting the two technologies confused ......
    .Net Connector is used for RFC-type interfaces. It calls Bapi's directly. Web services are not involved for this type of interface.
    WSDL files are used to generate proxies for the .Net client to call Web Services (typically web-enabled Bapi's). This type of interface uses SOAP protocol not RFC and does not use the .Net Connector. Enterprise Web Services may be discovered using the .Net Enterprise Service Explorer, which is a different component from the .Net Connector.
    Regards,
    D.

  • JMS: can I access SAP messages from extenal Java

    - Can I access SAP Messages from an external (non-SAP) java program?
    - Do I use JNDI or can I call using a jar file from my java invocation?
    - Do I have to define a queue (or does SAP JMS have queues)
    - What port do I use?
    Thanks

    Hi John,
    > - Can I access SAP Messages from an external
    > (non-SAP) java program?
    >
    Yes, you can use the JMS provider on the Web AS from a standalone java program.
    > - Do I use JNDI or can I call using a jar file from
    > my java invocation?
    You connect your remote java client to the server by getting an InitialContext. The you lookup the JMS resources (such as Topic- or Queue ConnectionFactory, etc.) from the JNDI. You can have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/25/bf8f44540c469abc19fb6ac3ac7885/frameset.htm">this</a> page for more info.
    >
    > - Do I have to define a queue (or does SAP JMS have
    > queues)
    >
    The JMS Provider on the Web AS provides default connection factories that you can use to create a topic ot queue. The lookup strings you have to use are
    jmsfactory/default/TopicConnectionFactory
    for topics and
    jmsfactory/default/QueueConnectionFactory
    for queues.
    > - What port do I use?
    >
    You use the P4 port (50004 by default for instance number 00) when obtaining the InitialContext with this code:
    java.util.Properties properties = new Properties();
    // set the properties of the connection
    properties.put("Context.INITIAL_CONTEXT_FACTORY", "com.sap.engine.services.jndi.InitialContextFactoryImpl");
    properties.put(Context.PROVIDER_URL, "<Server_Host>:<p4_port>");
    properties.put("Context.SECURITY_PRINCIPAL", "Administrator");
    properties.put("Context SECURITY_CREDENTIALS", "admin_password");
    // start initial context with the properties specified
    InitialContext context = new InitialContext(properties);
    Hope that helps!

  • How to access SQL tables from WebDynPro ABAP application ?

    Hi,
    I am trying a scenario, where I need to send an user ID to SQL server table (update/modify/delete) from webDynpro ABAP application.
    Basically ,I am trying to know:---
    a>How to write a SQL Connection from ABAP code within webdynpro ABAP application
    b>What are the ways to do it.(by code or any other API/mechanism)
    I appreciate if anybody knows this.
    Thanks
    Praveen

    Hi,
    The EXEC CONNECT ... is usually used in the procedural ABAP code. For this you can refer to the ABAPDOCU.
    I dont have any sample code on the classes I listed try to check out them for the parameters and the methods they have.
    In WD for Java, we have these connection classes to connect to any databsae server.
    Or try to create an RFC with DESTINATION for this
    Pls check out this link for this -
    Pull data from another r3 server using abap dynpro
    Regards
    Lekha

  • Can we access PI tables from WebDynpro Java via PI 7.1 to display inPortal?

    Hi Experts
    Is it possible to fetch PI Tables (to display monitoring and alerts as dashboard on portal) from Java Stack. I got some javadocs API SAP Netweaver for PI 7.1 but i don't know how far it can help me in solving my purpose of fetching and displaying the PI monitoring data on Portal.
    https://www.sdn.sap.com/irj/sdn/javadocs
    Please advise if J2EE access to PI Tables is possible or RFC is the suggested solution to fetch PI Monitoring data.
    Thanks
    Neha

    Hi
    For that tables any if RFC are created if created it's possible with WD for Java technology.
    Suggestable is backend is R/3 right, advisable is use all SAP standard tech
    Regards
    -SS
    Edited by: Sridhar S on Apr 14, 2009 11:12 AM

  • Access SAP BW from Java

    Hello,
    I need to build a Java web application that can collect and display data from various SAP BWs.
    Write operations are not required. What is the easiest way to do that?
    I found that SAP Open Hub Service lets you extract the data to a CSV file or a relational table.
    Assuming I go the way of creating a relational table, the following questions arise:
    - Where are those tables stored? Still within SAP BW or in an external relational DBMS (e.g. an Oracle database)?
    - How can I access those tables from within my Java code (just through a standard JDBC driver)?
    - Who initiates the population of those tables?
    - Can I trigger the extraction at a given time from within my java code?
    - If so, can I hand in filter critera, so that the table is populated only with data that matches my filter, or do I need to extract all data to the relational table and then filter at the next step?
    - Can I have a timer in the SAP BW that creates the table on a certain schedule (e.g. once per day)?
    What other (easier) options are there to achieve this task?
    Thanks,
    MARK
    Edited by: M. Arnold on Aug 17, 2010 9:50 AM

    Mark,
    What you can look at are :
    1. Use a JDBC connector to connect to the database directly - this has some obvious disadvantages because the data would have to be linked with the SID tables , text tables and Dimension tables for cubes which makes the process extremely cumbersome
    2. Use Openhub to extract to a relational table and access the same - possible , but you have two steps in between - openhub to update table and then access the table while maintaining data consistency - this might become a maintenance nightmare once you heavily use this concept
    3. Use web services - there are standard web services like query_view_data and rfc_read_tale which you can use - these web services are SOAP based and you should be able to use the same in your JAVA application
    4. Use the BI JAVA SDK to connect to the backend through an API supported by SAP - this would be easy to use - the SDk should be available on SCN or on the support marketplace and you shoiuld be able to use the same quite easily
    5. Use JCO and build the application using NWDS where you have native connectivity to SAP BW using JCO
    6. Use Web Dynpro JAVA to develop your application where you should be able to access the necessary APIs wherever required.
    Edited by: Arun Varadarajan on Aug 17, 2010 8:15 PM

  • How can access MS Outlook Calender information  from my Java application.

    People schedule meeting with some data on regular basis.
    I need to access the Exchange server from my Java application and get the meeting dates along with other data pertaining to meeting.

    I had the same problem, and I dont think (as far as my knowledge goes) there is any freeware that will enable Java to access Exchange server. But there are some commercial products that are available.
    Chk this link as an example: http://www.compoze.com/products_hme_desc.html
    good luck in the research
    -kms

  • Accessing custom Portal service from a java application

    We have a custom portal service that connects to BW using xmla. How do you access this portal service from a java application. Not from web dynpro, jsp or servlet but from the java code.
    Can we use the INITIAL_CONTEXT_FACTORY to get access to the portal service.
    Thank You
    D.K

    Now I tried the following:
    I've added the prtapi.jar and the service's jar to the additional-lib folder and added the appropriate entries to library.txt and reference.txt.
    Now I can obtain now the PortalRuntime, but this is not initialized.
    Has anybody a solution for this problem? Help would be high appreciated!
    Regards,
    Matthias

  • Access ABAP tables using NWDS Java Code

    All,
    I am planning to write a program to autmatically update is_url entries in sxmb_admin using a Java program.
    Is there a way we can access the ABAP tables using standalone Java Code? would it something like dblookup that we use in the mappings?
    Your Thoughts....
    Thanks.

    Hi Vicky - Interesting..Seems like you are trying to automate every single thing
    However you can make use of Jco to connect to ABAP tables..
    Check the below thread..
    Help on accessing tables of SAP from the Java Application
    I assume the table name is "SXMSCONFVLV" which you might have to update but not sure..

  • Accessing ECC tables from XSLT mapping

    Hi All,
    I have requirement where I need to access a SAP table from PI XSLT mapping.
    Pls provide inputs on how to achieve it.
    Thanks,
    Navneeth K.

    Hello,
    You can refer to this document found in SAP Help
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    And a sample blog
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    In your case, the idea is to call a java class inside the xslt mapping. So to access the ECC table, you can use a Java Mapping Class so that it would be easier to implement an RFC lookup.
    Hope this helps,
    Mark

  • Insert into SAP table from external program

    Hi Gurus,
    I need to perform an insert of several records into a couple of SAP tables from an external program.
    Do you know of an RFC (if it is remote enabled the better) that allows me to specify the table and records to perfom an insert?
    Many thanks
    Mauricio Pego

    I don't know ABAP and wanted to avoid writing my own function if one standard exists.
    My requirement stands like this, I have a few z tables that need to populate from my C# application by use of the .Net connector.
    I haven't found a BAPI or RFC that allows me to add records to any table, but I don't know all the RFCs.
    May be one of you passed throu this already.
    Mauricio

  • Providing sorting filters for a table in webdynpro java application

    ho to provide sorting  , filters , for a table in webdynpro java application .

    Hi Pradeep,
    Please go through the following article on implementation of filtering and sorting:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f024364b-3086-2b10-b2be-c0ed7d33fe65
    The article contains a link to a sample application using the TableSorter and TableFilter Class.
    The same classes can be used by any other web dynpro application. Download the sample application and copy the classes. In case of a specific requirement, modify the TableSorter and TableFilter classes.
    Regards,
    Kartikaye

Maybe you are looking for

  • WRT610N disconnects and does not work with Vista or media center extenders like the DMA2200

    Linksys and all other router manufacturers advertise the greatness of the wireless 5ghz band (especially with 802.11n), but I’m beginning to have my doubts.  It is true that the 5Ghz band is hardly being used so you'll have virtually no one to compet

  • CS3 Adobe Media Encoder: HDV to PSP 720x480 ?

    Using the factory setting 'Sony PSP Widescreen High Quality' I am able to encode this material at 368x208 29.97fps, but I am losing way too much quality at this setting. I cannot seem to encode to a playable Sony PSP (3000) video at 720x480. I have t

  • Output to NTSC format for DVD

    Hi, I am from the UK, I filmed some DVCAM footage in PAL format, but bringing it into FCP to output onto NTSC and onto DVD for a Canadian conference / Broadcast. Can i simply change my project and capturing settings to get the footage to run at NTSC

  • Need a little help....Please

    So I have a large AVI file that someone gave me, which I'm trying to put to disc for a standard dvd player use, using IDVD. I did not want a "IDVD template menu" and just wanted the disc to play the movie when inserted. When I tried the "Onestep DVD

  • Itunes visual not appearing, but process is.

    I try for 3 hours straight trying to figure out why the visual isn't appearing. It should be obvious that I did not succeed. The process Itunes.exe, AppleMoblieDeviceHelper.exe, and disnote.exe. I also have TuneUp Companion with the Itunes pulg-ins.