Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 07, 2005 at 06:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      ...and unfortunately, the RFC_READ_TABLE RFC isn't "officially" supported / allowed for productive use, but on the other hand, i know many installations, that use it... 😉

      kr, achim

  • avatar image
    Former Member
    Feb 08, 2005 at 08:27 AM

    I checked the productive system and it doesnt contain this BAPI. So I need to write one my own?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 08, 2005 at 08:22 AM

    hm, okay.. both sounds a bit strange. But I will check out whether the general get table data BAPI is accessible within the produktive system. The dev system got it.

    Thanks,

    Paul

    P.S. I read about giving "reward points"? Where is it?

    Add comment
    10|10000 characters needed characters exceeded