Call sap transaction from java

can anyone tell me how to call SAP transaction from JCO,
cheers
Ajay

Hi Ajay,
You should find or create functional module which covers your requrements.
Best regards, Maksim Rashchynski.

Similar Messages

  • Calling SAP Transaction from BSP

    I wonder whether it is possible to call SAP transaction from BSP application and pass to it some data; e.g., PO# when calling VA02?
    The called transaction could appear in a separate MS IE Window (like in some Portal applications) or in SAP GUI.
    Any help will be appreciated.
    Thank you in advance

    I have launched the Java SAPGui from BSP pages before.  I used SNC so that the users were logged on via Single Sign On.  I store the Java Gui in the Mime directory.  You can force the startup transaction.  Theorectically you could also Gui Scripting to try and control the Gui and force in the default value for your PO field.  I have not tried that however.  You will probably want to check the Service Marketplace for documents on the Gui Scripting.  The following is the code from my BSP page to launch the Java Gui in the Browser as an applet:
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <HTML>
    <HEAD>
      <TITLE>SAPGUI for the Java Environment</TITLE>
      <STYLE type="text/css">
          body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; }
      </STYLE>
    </HEAD>
    <BODY scroll="no">
    <SCRIPT language="JavaScript">
    // user configurable part starts here
    var pluginurl         = '';
    var scriptable     = 'true';
    var codebase         = '.';
    var jnlp           = 'platin.jnlp';
    var keepalive      = 'true';
    var frog           = 'true';
    var trace          = '';
    var tracefile      = '';
    var connectionData = 'conn=/M/nts163/S/3620/G/SPACE/&tran=SE80&clnt=088&fast=true&sncon=true&sncname=p:[email protected]&sncqop=9';
    // user configurable part ends here
    // verify if Java Plugin as control in Internet Explorer or Java Plugin for Netscape or native JRE of browser must be used
    var jre = 'control';
    if(navigator.platform.indexOf("Mac") > -1)
       jre = 'native';
    else if (navigator.appName.indexOf("Netscape") != -1)
       jre = 'plugin';
    document.open();
    switch (jre)
    case 'control':
        document.writeln('<OBJECT CLASSID  = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"                               ');
        document.writeln('    ID       = "PlatinGUI"                                                                    ');
        document.writeln('    CODEBASE = "j2re-1_3_1_02-win-i.exe#Version=1,3,1,0"                             ');
        document.writeln('    WIDTH    = "100%"                                                 ');
        document.writeln('    HEIGHT   = "100%"                                                 ');
        document.writeln('    BORDER   = 0>                                                      ');
        document.writeln('<PARAM NAME = "TYPE"           VALUE = "application/x-java-applet;jpi-version=1.3.1">         ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable,'">                                ');
        document.writeln('<PARAM NAME = "code"           VALUE = "com.sap.platin.GuiApplet2">                   ');
        document.writeln('<PARAM NAME = "codebase"       VALUE = "', codebase,'">                             ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp,'">                             ');
        document.writeln('<PARAM NAME = "archive"        VALUE = "GuiStartS.jar">                             ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive,'">                             ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog,'">                             ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace,'">                             ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile,'">        ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData,'">                               ');
        document.writeln('                                                                ');
        document.writeln('This page requires a Sun Java Plugin 1.3 and a SAPGUI for Java to view.                      ');
        document.writeln('                                                                ');
        document.writeln('</OBJECT>                                                           ');
        break;
    case 'plugin':
        document.writeln('<EMBED TYPE        = "application/x-java-applet;version=1.3"                         ');
        document.writeln('    PLUGINURL      = "', pluginurl,'"                                          ');     
        document.writeln('    WIDTH          = "100%"                                            ');                                        
        document.writeln('    HEIGHT         = "100%"                                             ');
        document.writeln('    ALIGN          = "BASELINE"                                                ');
        document.writeln('    code           = "com.sap.platin.GuiApplet2"                                      ');
        document.writeln('    codebase       = "', codebase,'"                                        ');
        document.writeln('    jnlp           = "', jnlp,'"                                                ');
        document.writeln('    archive        = "GuiStartS.jar"                                       ');
        document.writeln('    keepalive      = "', keepalive,'"                                       ');
        document.writeln('    frog           = "', frog,'"                                            ');
        document.writeln('    trace          = "', trace,'"                                            ');
        document.writeln('    tracefile      = "', tracefile,'"                                       ');
        document.writeln('    connectionData = "', connectionData,'"                                        ');
        document.writeln(' <NOEMBED>                                                      ');
        document.writeln(' </NOEMBED>                                                      ');
        document.writeln(' </EMBED>                                                              ');
        break;
    case 'native':
        document.writeln('<APPLET CODEBASE  = "', codebase,'"                                                           ');
        document.writeln('        ARCHIVE   = "GuiStartS.jar"                                                           ');
        document.writeln('        CODE      = "com.sap.platin.GuiApplet2"                                               ');
        document.writeln('        WIDTH     = "100%"                                                                    ');
        document.writeln('        HEIGHT    = "100%">                                                                   ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable, '">                                    ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp, '">                                          ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive, '">                                     ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog, '">                                          ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace, '">                                         ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile, '">                                     ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData, '">                                ');
        document.writeln('</APPLET>                                                                                ');
        break;
    document.close();
    </SCRIPT>
    </BODY>
    </HTML>

  • Run SAP transaction from Java?

    I'm looking for answers for two questions:
    1) Can I run an SAP transaction from Java & capture the result either in a file or table.. or any such structure?
    2) Can I run an ABAP report directly from Java? and then capture the result as well? I realise that I can use the JCO to run any RFC enabled function module..? But what about a report itself.? Can I run the report behind an SAP transaction directly from Java?
    I need this information urgently, and would appreciate any help on this.

    Hi Deepika,
    I think the requirement you have asked is quite complex and there is no solution as far as i have know.
    You can use BAPI to run SAP Transactions for example BAPI_MATERIAL_DISPLAY will take you to MM03 transaction when you pass a valid material number to it.
    When i searched for the same i ended up with no solution,
    but got a good link which gave some idea
    http://expertanswercenter.techtarget.com/eac/knowledgebaseCategory/0,295197,sid63_tax296869_idx25_off25,00.html
    Go through that link that might be helpful.
    Thanks & Regards,
    Kathir~

  • Calling SAP transaction from WebDynpro

    HI,
    Could someone post a link as to how I may call a SAP transaction from a webdynpro.
    Will this be an external call to R/3 or can i get it embedded in my dynpro.......
    Tnks..

    Hi,
    You can call by creating external window method.
    create LINK to URL or LINK TO ACTION according to requirement, for this. write code in onaction of that.
    data: iv_url type string value 'http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP'.
      data: api_component  type ref to if_wd_component,
              window_manager type ref to if_wd_window_manager,
              window type ref to if_wd_window.
      api_component = wd_comp_controller->wd_get_api( ).
      window_manager = api_component->get_window_manager( ).
      window = window_manager->create_external_window(
                     url = iv_url
                     modal = abap_false ).
      window->open( ).
    Cheers,
    Kris.

  • Call SAP Transaction from BSP

    Hi,
    I am new to BSP. I have to call SAP Screen on button click event on BSP and also need to pass data at runtime.
    I searched this forum but didn't find the right solution. I tried to call SAP screen from BAPI and through URL but no success.
    Anyone knows how it can be done?
    Regards,
    Usman Malik

    Thanks for your reply,
    Actually I am very new to BSP. I don't understand where to put this code?
    [System]
    Name=DEV
    Description=DEV [Development]
    Client=123
    [User]
    Name=RAJA
    Language=EN
    [Function]
    Title=
    Command=*SU01 USR02-BNAME=raja;
    Type=Transaction
    [Configuration]
    WorkDir=d:xxxxxxSapWorkDir
    [Options]
    Reuse=1
    Second thing is about shortcut. Do I have to place this shortcut on server?
    Thanks,
    Usman Malik

  • Calling SAP Webservice from JAVA ME bad response time

    Hello together,
    I'm calling a SAP RFC as a Webservice from JAVA ME (Netbeans 6.8). The stub classes I've generated with the Sun Wireless Toolkit. The RFC function stores entries in a SAP database table. The call of the websevice with transmitting the data and the database update in SAP works fine, but I got the response message from SAP with a delay of 40 seconds.
    Does anyone know why there is so a long delay in the response and how to fix it?

    hi,
    is this reproducible or was it just the first call to that service?
    it usually occurs that once you call a webservice for the first time, some of the programs (be it your application programs or the even the SOAP runtime itself) required have not been compiled until that and so they are compiled during the webservice call.
    This leads to slow response times even time-outs. The effect vanishes once all sources are compiled (i.e. depending on the complexity of your calls after one to a few calls to that service).
    So, if the slow response times persist, you should turn on debugging in SICF and see where time is spent...
    my 2 cents,
    anton

  • Calling SAP Transaction from WDA

    Hi,
    We have a peculiar requirement of calling SAP Standard Transaction from Web Dynpro ABAP.Well, we tried achieving this using the Transactional iview. On click of appropiate link/button in my applicaiton, I can call the Transactional iview. But the problem is, I could not pass on the data from WDA Application to Transactional iview. I need some inputs in handling such cases.
    The case might look something similar to PCR's final updation(like after all approvals of PCRs, the final Administrator executes the workitem which in turn calls the Notification Maintenance and this in turn calls the PA40 passing the data from Adobe form(XML data) to PA40 txn. Like this, After all my approvals, I would like to call the SAP Transaction passing the data from WDA Application. Hope I am clear.
    Regards
    <i><b>Raja Sekhar</b></i>

    Hi,
    Maybe you can use the information from this blog to pass dynamic parameters to the SAP transaction iview which you call with the created URl
    How to launch SAP transaction & pass parameters via URL
    Dagfinn

  • Calling SAP transaction from Webi report?

    Hi experts,
    With BI/BW query, we can retrieve data from R/3 source system via report-to-report interface. For instance, from a Purchasing query with data aggregated by Vendor, the user can trigger the R/3 transaction ME2L by clicking on a row.
    Is there a similar feature in BOBJ Webi report? For instance, can we use hyperlink or some other means to do this?
    Any idea will be much appreciated.
    Thanks and regards,
    Linda

    Hi Stratos,
    Really appreciate your advice. Following your suggestion of using blank cell, the server is determined dynamically for the hyperlink.
    However, there're still some issues with defining a hyperlink for table columns. For instance, I have 2 columns in the table - Cost Centre and Cost Element. SAP transactions KS03 and KA03 are to be launched respectively for these 2 columns. The value of the clicked column (Cost Centre, Cost Element) is to be passed to the SAP transaction.
    I've created the following hyperlink for the Cost Centre column:
    http://[[MyServer]]?sap-client=([Client])&sap-language=EN&~transaction=KS03
    with Tool Tip = [[L01 Cost Center Key]]
    The link is not working immediately, so I adjusted the formula as follows via the formula editor (by adding double quotes for <MyServer>):
    ="<a href=\""[[MyServer]]"?sap-client="URLEncode(""[[Client]])"&sap-language=EN&%7Etransaction=KS03\" title=\"\" target=\"_self\" nav=\"web\">"[[L01 Cost Center Key]]+"</a>"
    Clicking the <tick> button does not return any error.
    When I click on the Cost Center column, the SAP transaction is launched successfully. However, there're still a few issues:
    1) The Cost Center Key is not passed to the SAP transaction. Is Tool Tip the way to go?
    2) When checking the hyperlink (via right-click > Hyperlinks > Edit Hyperlink), I found the Tool Tip (L01 Cost Center Key) has disappeared
    3) After I've clicked <OK> to exit the Edit Hyperlink window, I got the error message 'Invalid character '[[MyServer]]' at position 14. (Error: WIS10080)'.
    -- It seems correct syntax in the formula editor is considered invalid in the hyperlink editor.
    Do you mind commenting on what could have caused the above issues?
    Thanks again for your time.
    Linda

  • Calling SAP FM from java/jsp

    To
    All Java Developers,
    I would like to access an ECC SAP Function Module from a regular JAVA class or a JSP page.
    Basically hava jsp or java page which can pass data to a BAPI/FM or read values from it.
    How would one go about doing this?
    I am aware that with java web dyn pro one can use adaptive RFC model but if one were not to use
    web dyn pro what will be the approach?
    Any information/code snippets on the above will be highly appreciated?
    If you need further details on the above requirement do let me know.
    Thanks
    Stride

    Yes you can go through the link below.
    http://help.sap.com/saphelp_nw04/helpdata/en/89/8a185c148e4f6582560a8d809210b4/frameset.htm
    Regards,
    Sandeep.

  • Is it possible to call std. SAP transaction from abap wd

    Is it possible to call std. SAP transaction from abap wd so that transaction appears and work as in gui? Without portal ofcourse.
    I know that using webgui and/or ITS it is possible so then it must be somehow possible....

    Hi,
    see Web Dynpro ABAP call transaction in the foreground and just carry out a simple search in this forum, then you'll find several threads with similar questions...
    Regards, Heidi

  • Calling SAP scripts from WEBDYNPRO

    Hi
    We need to call SAP scripts from WebDynpro application.  As per my understanding we need to do following steps
    Create a new RFC function module and create sap script output in PDF format.For this
        - use OPEN_FORM , by assigning TDGETOTF='X' in the Options(Structure
          ITCPO). 
        - call function module CLOSE_FORM with option OTFDATA
        - convert OTF data to PDF by using function module CONVERT_OTF_2_PDF
    Now I would like to know how to display the PDF string from WebDynpro.
    Please help....
    Regards
    Sujith

    Hi,
    You can call by creating external window method.
    create LINK to URL or LINK TO ACTION according to requirement, for this. write code in onaction of that.
    data: iv_url type string value 'http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*se38 RS38M-PROGRAMM=rsparam;DYNP_OKCODE=SHOP'.
      data: api_component  type ref to if_wd_component,
              window_manager type ref to if_wd_window_manager,
              window type ref to if_wd_window.
      api_component = wd_comp_controller->wd_get_api( ).
      window_manager = api_component->get_window_manager( ).
      window = window_manager->create_external_window(
                     url = iv_url
                     modal = abap_false ).
      window->open( ).
    Cheers,
    Kris.

  • Calling sap transaction in html

    hi all
    i've created an iview which is calling sap transaction while creaating it has given me some options like sap gui for windows,sap gui for html.while selecting sap gui for html i am getting some error.other is working. can any one plzz tell me how to create a iview which calls saptransction using sap gui for html template.
    awaiting for replies

    Hi,
    In order to show your Iview in sap gui for html, you need to have ITS server configured.
    1. If you are using SAP version <= 4.7 on web as 6.20 then you need to install ITS 6.20.
    2. If you are using SAP version >= 4.7 on WEBAS 6.40, then ITS comes as integrated ITS 6.40. So you can activate the Integrated ITS.
    If you want to use SAP GUI for java then you need little configuration which is explained in my weblog.
    Steps for quick installation and usage of SAP GUI for JAVA in EP
    Hope this helps,
    Thanks,
    Praveen.
    PS.Dont forget to reward points.

  • Triggering an SAP Transaction from Adobe Form

    Hi all,
    i wanna know if i can Trigger an SAP Transaction from an Adobe Form...
    so that i can open the transaction like MM01, or VA01.
    THx,
    Guru

    Hi Graham!
    I have a similar problem in transaction CIC0 and the Sales summary tab in CRM.
    I have created a new class and assigned it to a new fact sheet. One column in this fact sheet should be a hyperlink defined in the way that you have described.
    When using method get_event_parameter I are not getting any data for the SAPEVENT parameters - I don't get the value, only the keys:
    <a href="SAPEVENT:?OBJTYPE&OBJKEY>
    How should I procced to assign an object type and object key to this SAPEVENT???
    Would also be very nice if anyone could explain how to "call transaction" works.
    Help understanding this would be very appreciated.
    BR
    Mattias

  • Reading selection parameters of transaction from Java

    Hi everyone,
    I 'm trying to find a way to read the selection parameters of a transaction from Java code. For example, the transaction MM03 (Display Material) expects a parameter called RMMG1-MATNR. I would like to be able to get the parameter's name in Java code via some RFC using JCO.
    Regards,
    Yoav.

    When the write end of the FIFO pipe is closedNamed pipes can be opened through several file desciptors. When all open file desriptors referring to a pipe are closed, only then is EOF indicated at the reading side. Named pipes "dwell" in the file system, and can be accessed as files through their names in the file system.

  • Curious thing while calling a procedure from Java !...

    Hi !. My name is Agustin and my doubt would be the following one... I am working for a e-business comp and they asked me to call a procedure from java... The code is the following one:
    CallableStatement cs = null;
    System.out.println("Fecha Nro. 1: " + paramFechaDesde);
    System.out.println("Fecha Nro. 2: " + paramFechaHasta);
    try
    cs = getDBTransaction().createCallableStatement("{call paq_w_ListadoSiniestralidadART. p_sinsiniest(?,?,?,?) }",0);
    cs.registerOutParameter(4,OracleTypes.VARCHAR);
    cs.setInt(1,paramContrato.intValue());
    cs.setString(2,paramFechaDesde);
    cs.setString(3,paramFechaHasta);
    cs.setString(4,paramNombreArchivo);
    cs.executeQuery();
    String nomArchivo = cs.getString(4);
    System.out.println("### " + nomArchivo +" ###");
    catch(SQLException e)
    The weird thing is that, I was expecting a big big exception but the only thing I got is
    ### Error ###
    The String I am expecting is a file's name !; so I am a little bit confused...
    Also I didn't know where to post so If it's in the wrong category... I apologize !... If anyone need more details, I'll be checking out... The account I am working on is an Insurance company, who is the one who provide access to the DB and the procedures... So I can't check what's inside...

    Please provide your Java and OS versions, the JDBC jar file and the Oracle DB version being used when you post.
    >
    I was expecting a big big exception
    >
    Then why do you have an empty exception block? That just makes it disappear so you won't see one if it happens.
    And your code has
    cs.registerOutParameter(4,OracleTypes.VARCHAR);
    cs.setString(4,paramNombreArchivo);You use 'registerOutParameter' for an OUT parameter and the 'setXXX' methods for other parameters.
    Remove the 'setSTring' for the OUT parameter.
    Then as malcollmmc already said
    >
    Sounds like the PL/SQL is returning "Error" as the 4th parameter of the call
    >
    The actual value returned by PL/SQL is strictly determined by the PL/SQL code and Java and JDBC are not involved.
    Fix the code problems, retest, and folllowup with whoever wrote the code if it still returns ERROR.

Maybe you are looking for