Create RFC Function using Java Program

hi
I am trying to create a small utility in java that extracts data from SAP system and loads it to local Db
For extracting data from SAP we have a custom ABAP function (RFC) running on SAP server that is called from Java using JCO3 APIs
Installation of this utility on client side involves -
1.     Installing RFC on Clientu2019s SAP instance
2.     Installing / Configuring Java code on Clientu2019s machine
Is there a way to install / create a RFC function using java -JCO APIs so that Step-1 can be omitted?
I had browsed through a sample provided in examples installed with JCO3 but its very trivial example can someone point to a exhaustive link or explain how this can be achieved using Java program
Thanks

Hi Amit
I am not sure I understand the question. You want to create an RFC in Java? If this is correct why not create a Remote Method in java for example as EJB or Web Service which is more standard than creating an RFC.
On the other hand if you want to create a RFC client in Java (a Program which calls a RFC in SAP ABAP system) you can use JCo APIs (which can be either standalone or on the NW Java server) or JRA (from NW 7.1 onwards).
Regards
Partha

Similar Messages

  • Create shortcut file using Java program

    Hi,
    I have an exe file. I want to create its shortcut file through Java program.
    Is it possible? If yes, how to do it??
    regards,
    Anand

    Hi,
    See we have developed a swing application for the school children.
    Also, we have written Java based installer program to install that software.
    This installer program asks user whether he wants to create a desktop shortcut or not.
    Now I am not getting how to write Java program to create a desktop shortcut of our software.
    So, can somebody help us in this problem??
    regards,
    Anand

  • How to create poll functionality using java(struts)

    Hiii,
    How to create the poll functionality to place into the site. I am using struts and XML file to store the data. We should able to view the result of the poll in horizontal bar graph.
    Please give me an idea how to implement it or provide a link which has the implementation.
    Thanks

    Whatever happened to good, old-fashioned thinking? All we see here now is "how to write <common application> with minimal input from myself?"-type questions. It's only a matter of time until we get people coming here asking "how to write <massively-scoped enterprise app>? What class I need for that?". Oh, wait. We already do get that

  • How to create a directory or Folder  using java program?

    Hi all,
    Can any one know, how to create a directory(new folder) in java.
    can any give me some idea, on creating a directory using java program dynamically.
    thanx in advance

    hi thanks for your answer,
    sorry, actual i know this technique(its my fault i didnt mentioned it)
    i am looking for some what different technique.
    bye
    ram

  • Want To create Zip file  using java,And Unzip without Java Program

    I want to create a zip text file using java, I know Using ZipOutputStream , we can create a zip file, , But i want to open that zip file without java program. suppose i use ZipOutputStream , then zip file is created But for unZip also difftrent program require. We cant open that zip file without writing diff java program.
    Actually i have one text file of big size want to create zip file using java , and unzip simply without java program.Its Possible??
    Here is one answer But I want to open that file normal way(
    For Exp. using winzip we can create a zip file and also open simply)
    http://forum.java.sun.com/thread.jspa?threadID=5182691&tstart=0

    Thanks for your Reply,
    I m creating a zip file using this program, Zip file Created successfully But when im trying to open .zip file i m getting error like "Canot open a zip file, it does not appear to be valid Archive"
    import java.io.*;
    import java.util.zip.*;
    public class ZipFileCreation
         public static void main (String argv[])
         try {
         FileOutputStream fos = new FileOutputStream ( "c:/a.zip" );
         ZipOutputStream zip = new ZipOutputStream ( fos );
         zip.setLevel( 9 );
         zip.setMethod( ZipOutputStream.DEFLATED );
    //     get the element file we are going to add, using slashes in name.
         String elementName = "c:/kalpesh/GetSigRoleInfo092702828.txt";
         File elementFile = new File ( elementName );
    //     create the entry
         ZipEntry entry = new ZipEntry( elementName );
         entry.setTime( elementFile.lastModified() );
    //     read contents of file we are going to put in the zip
         int fileLength = (int)elementFile.length();
         System.out.println("fileLength = " +fileLength);
         FileInputStream fis = new FileInputStream ( elementFile );
         byte[] wholeFile = new byte [fileLength];
         int bytesRead = fis.read( wholeFile , 0 /* offset */ , fileLength );
    //     checking bytesRead not shown.
         fis.close();
    //     no need to setCRC, or setSize as they are computed automatically.
         zip.putNextEntry( entry );
    //     write the contents into the zip element
         zip.write( wholeFile , 0, fileLength );
         zip.closeEntry(); System.out.println("Completed");
    //     close the entire zip
         catch(Exception e) {
    e.printStackTrace();
    }

  • Error creating RFC function /BODS/ABAP_RUN : RFC_ABAP_EXCEPTION-(Exception_Key: FU_NOT_FOUND, SY-MSGTY: E, SY-MSGID: FL,

    Hi Expert,
    I try to execute job on development system but he showed error "Error creating RFC function </BODS/ABAP_RUN>: <RFC_ABAP_EXCEPTION-(Exception_Key: FU_NOT_FOUND, SY-MSGTY: E, SY-MSGID: FL, SY-MSGNO: 046, SY-MSGV1: /BODS/ABAP_RUN)>. Notify Customer Support.
    In ECC I use ABAP execute option as Execute Preloaded. How to solve this problem? Thanks for your advise.

    Dear,
    have you checked in EXX wether the function group /BODS/BODS is available?
    Some notes here:
    You will have to have to import the new ABAP Program group "BODS/BOS" which you can find in the local install folder...
    Here are some details:
    Installing Functions on the SAP Server
    SAP BusinessObjects Data Services provides functions that support the use of the ABAP, BAPI, and
    IDoc interfaces on SAP servers. You will need some or all of these functions in the normal operation
    of the software in an SAP environment. These functions perform such operations as dynamically loading
    and executing ABAP programs from Data Services, efficiently running preloaded ABAP programs,
    allowing for seamless metadata browsing and importing from SAP servers, and reporting the status of
    running jobs. Some of these functions read data from SAP NetWeaver BW sources.
    You must upload the provided functions to your SAP server in a production environment. It is
    recommended that you always upload the functions to your SAP server whether you are in a
    development, test, or production environment. The functions provide seamless integration between
    Data Services and SAP servers.
    The default installation places two function module files for SAP servers in the ...\Data
    Services\Admin\R3_Functions\transport directory. You then upload these files to SAP servers
    using the SAP Correction and Transport System (CTS) or manually. Using CTS allows for version
    control as the functions evolve across releases.
    The installation provides two versions of transport files (depending on the server version you are using)
    to install the functions on the SAP server. To obtain the names of the latest transport files for installing
    or upgrading these SAP server functions, see the readme.txt file
    And I've found those files and text files in the local install folder....in:
    Program Files\SAP BusinessObjects\Data Services\admin\R3_Functions
    (that's where I've installed it).
    There you'll find some descriptive txt as how to proceed.
    After installing, it might happen that the executing user is missing some authorizations.
    Here my authorizations team helped me by tracing the user and then adding the necessary rights.
    Sure hope this will help you.
    Notes to check:
    see SAP Note 1919255
    Note 1916294

  • The troubles with creating SQL function in Java

    Hi!
    I use Oracle 10g and connect to it from Java application. I need in creating SQL functions from Java code.
    In Java I have:
    Statement stm = null; try{     stm = dbConnection.createStatement();     stm.executeUpdate( query ); }catch(SQLException ex){     throw ex; }finally{     try{ stm.close(); }catch(Exception ex){ stm.close(); } }
    And I'm passing the next SQL function:
    create or replace function get_me return number is
    result number;
    begin
    select 5 into result from dual;
    return result;
    end;
    This code is run successful, but I can't call this funtion, because it has status Invalid
    I'm looked the next error: PLS-00103: Encountered the symbol "" when expecting one of the following: . @ % ; is authid as cluster order using external character deterministic parallel_enable pipelined aggregate
    But I don't understand, What the matter? From Oracle Enterprise Manager I can create this function without problems. So, I wrote the wong Java code. Also, I can't find my error :(
    May be, do u have the some ideas?
    Thank you very much!

    Post the whole pl/sql code please.
    To run PL/SQL from within java you'll need callablestatement.
    [here |http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java] an example : http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

  • How to create a Folder using java.

    Hi All,
    I have a doubt. I want to create a folder using java.
    Inputs are the destination where the folder should be created and the name of the folder. Plz help me in this regard.
    thanks and regards,
    Vincent .R.

    check out javadoc for java.io
    File reldir=new File("NewDir");//relatively where your program runs
    reldir.mkdir();
    File absdir=new File("C:/NewDir");//absolute path
    reldir.mkdir();
    File newdir=new File(absdir,"SubDir");//defines another dir under absdir
    newdir.mkdir();
    Gil

  • HOW TO creat  BAR CHART using ABAP Programming

    DEAR ALL,
    I want some help as to how to creat GRAPHICAL display using ABAP programing (BAR CHART) any sample codes Example will be very helpful.
    Regards,
    VJ

    On earlier versions, you can do something like this.
    [code]
    REPORT ZRICH_0005 .
    DATA: BEGIN OF ITAB_DATA OCCURS 0,
               DATANAME(15),
               QUANTITY1 TYPE I,
               QUANTITY2 TYPE I,
               QUANTITY3 TYPE I,
          END OF ITAB_DATA.
    Data: BEGIN OF ITAB_OPTIONS OCCURS 0,
               OPTION(20),
          END OF ITAB_OPTIONS.
    ITAB_DATA-DATANAME = 'Maple'.
    ITAB_DATA-QUANTITY1 = 5500.
    ITAB_DATA-QUANTITY2 = 6200.
    ITAB_DATA-QUANTITY3 = 5900.
    APPEND ITAB_DATA.
    ITAB_DATA-DATANAME = 'Oak'.
    ITAB_DATA-QUANTITY1 = 3500.
    ITAB_DATA-QUANTITY2 = 5200.
    ITAB_DATA-QUANTITY3 = 4400.
    APPEND ITAB_DATA.
    ITAB_DATA-DATANAME = 'Cherry'.
    ITAB_DATA-QUANTITY1 = 1800.
    ITAB_DATA-QUANTITY2 = 2200.
    ITAB_DATA-QUANTITY3 = 1900.
    APPEND ITAB_DATA.
    CALL FUNCTION 'GRAPH_MATRIX_3D'
         EXPORTING
              COL1        = 'Jan'
              COL2        = 'Feb'
              COL3        = 'Mar'
              TITL        = 'Lumber Usage in $'
         TABLES
              DATA        = ITAB_DATA
              OPTS        = ITAB_OPTIONS
         EXCEPTIONS
              OTHERS      = 1.
    [/code]
    Regards,
    Rich Heilman

  • I need to create RFC function module which creates the IDOC

    Hi-
    Any idea how to create RFC function module which creates the outbound IDOC. If you have any sample code please forward to me.
    Thanks,
    Sony

    My Problem is
    Whenever they create Invoice using T-code's like FV65(Parked Document), automatically should create IDOC's...
    I have used message type FIDCC1 but this message type is usefull only for Posting documents.
    1. Whenever they create parked document, entries will be stored in BKPF(Parked Document-Filed-BKPF-BSTAT = 'V') and Bseg....
    2. I have to read entries from those tables and should create IDOC...
    3. I checked FM's(FI_IDOC_CREATE_FIDCC1, FI_IDOC_PREPARE) but are not useful...
    4. Now I need to write one RFC function module and that FM should create the IDOC's....
    Can anyone please help me out?
    Thanks,
    Sony

  • How to send fax using java programming

    i need to send files in my hard disk through fax using java programming.
    i have found on the internet that it is possible to be implemented by using java.comm API and JTAPI. however, i don't know how...does anyone can tell me the details? also, as i know it will be a big project to send fax using such API. is that any other simple way to implement the fax function in java? thx a lot!

    To cse.mahbub:
    Are you aware that you replied to a 5 1/2 year old question?
    Please don't do that. Reply only to current questions.

  • Unable to locate existing  file from unix using java program

    Hi
    I have created a file in unix using java program, file.createNewFile();
    And when i try to search for the same file using file.exists() it is returning false. Paths are correct. Can anybody help me out.
    Thanks & Regards,
    Prasanth

    In Linux FC5 using JDK1.6, this code         File temp = new File(System.getProperty("user.home") + "/abcdefghijklmn");
            System.out.println(temp.createNewFile());prints 'true' and the file is created with length zero.

  • Setting persitent system environment variables using java program

    hai,
    Iam tryng to write installation for an application,which require to set some persistent system environment variables using java program. I have tried using set command Runtime.getRuntime().exec("cmd /c set blah blah "),but this applies only to that particular DOS promt only,i presume.And this is not perisistent.please do help.
    Biju

    The solution I proposed worked only on Windows XP/2003.
    The following solution will work on Windows NT/2000/XP/2003 with JDK 1.2+.
    1- Download the [url http://www.gjt.org/download/time/java/jnireg/registry-3.1.3.zip]JNIRegistry zipped archive.
    2- Open the registry-3.1.3.zip file and extract in the folder of your choice ( Eg. c:\setenv ) only the 2 first files (when sorted by path): ICE_JNIRegistry.dll and registry.jar.
    You don't need to keep the folder tree in the extraction.
    3- Create the following SetEnv.java file in the same folder ( Eg. c:\setenv ).
    import com.ice.jni.registry.Registry;
    import com.ice.jni.registry.RegistryKey;
    import com.ice.jni.registry.RegStringValue;
    import com.ice.jni.registry.RegistryValue;
    public class SetEnv
        static final String REG_HKLM_SUBKEY_NAME = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
        public static void main(String[] args)
        throws Exception
            new SetEnv().exec(args);
        void exec(String[] args)
        throws Exception
            if (args.length != 2)
                throw new IllegalArgumentException("\n\nUsage: java SetEnv {varName} {varValue}\n\n");
            String varName = args[0];
            String varValue = args[1];
            RegistryKey key = null;
            RegStringValue value;
            try
                key = Registry.HKEY_LOCAL_MACHINE.openSubKey(REG_HKLM_SUBKEY_NAME, RegistryKey.ACCESS_ALL);
                value = new RegStringValue(key, varName, RegistryValue.REG_EXPAND_SZ);           
                value.setData(varValue);
                key.setValue(value);
                key.flushKey();
            finally
                try { key.closeKey(); }
                catch (Exception e) {}
    }4- Compile it.
    javac -classpath .;registry.jar SetEnv.java
    5- Run it. varName and varValue are strings of your choice.
    java -classpath .;registry.jar -Djava.library.path=. SetEnv varName varValue

  • How to create sql database using java frame or appelet?

    hi ! i am working on database project i want to create a database using java frame or applet where it asks user to select the location for database to be created , after user have specified the path then the programs creates the database, again i want that database to be read and write by another frame or applet but as user select the path how do i make the connectivity. i just have basic knowledge on java. please give me idea how can i process further.
    thanks a lot

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

Maybe you are looking for

  • Firewire Drives & mirroring

    I use Lacie drives, both 400 & 800 at our office for backups and storage, but I will be using this for audio/video editing at home on my personal system. I am leaning towards buying (2) 1 TB drives. On one of Callbox's DVDs and they recommended using

  • Report ing Hours in CATS

    Hi, We´ve encountered the following need. We are using CATS to register presences and absences. Supposing that there is a week where wednesday is a holiday, we want the system to set by default that day as a holiday. We want to achieve that the emplo

  • Null pointer with array

    Please help! I'm new to Java and have done the following: Created an array to hold 100 records. Created 5 records for the array (index 0, 1, 2, 3, 4) Now I'm trying to use a for loop to have a write output of the array values and I'm getting a NULL p

  • Ipod touch always changes the time and date when synced

    Since I got my touch, even before any updates etc, every time I sync it the time and date changes, usually back about a week or so. Anyone else got this problem or any solution as its really annoying me. A cutting edge bit of kit that has practically

  • F110 Profit Center Dummy error

    Hi: I have a problem with tx F110, I hope you could help me. Since two or tree weeks when we use F110 for Automatic payments, we find that erverything goses to profit center dummy. We have change nothing (as far I know) and responsible for FI syas no