How to call java program from javascript
Hi,
I have an java program which will transform one xml to another xml using XSLT.
I want to call this java program from Javascript? Is this possible? Please suggest me.
Thanks,
Gopal
is it not possible?
do i have to refresh the page and read in the values like...
<%
String ename = request.getParameter( "EmployeeName");
session.setAttribute( "ename", ename);
%>and then call the class from here?
looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
is ajax better or not really worth it?
i have anything up to 100 fields that need saving at one save click
Similar Messages
-
How to call java program from ABAP
Hi Experts,
My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
parameter TYPE string VALUE 'D:java MyFirstProgram'.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = command
parameter = parameter
OPERATION = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
OTHERS = 8.
Thanks.This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
Implement an RFC server in 7.0:
http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
Implement an RFC server in 7.1 or higher:
http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm -
How to call java classes from javascript?
i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
the class is stored under tomcats classes directory and is accessed:
com.Database.Employee
the method is called : UpdateEmployeeDetails
the button
<input type="button" value="Save" onclick="submitForm('save')" />the javascript
<script language="javascript">
function submitForm(process){
document.myForm.action="update.jsp";
document.myForm.submit();
</script>is it not possible?
do i have to refresh the page and read in the values like...
<%
String ename = request.getParameter( "EmployeeName");
session.setAttribute( "ename", ename);
%>and then call the class from here?
looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
is ajax better or not really worth it?
i have anything up to 100 fields that need saving at one save click -
How to call Abap Program from Javascript or html ?
Hi All,
I have developed a program using html, abap and javascript. I want to call an abap program while clicking on the button.
How can I do it ?Hi Rajesh,
What kind of program it is? is it a report or a transaction?
If it's transaction, you can call the transaction as below from a link or button.
http://<host>:<port>/sap/bc/gui/sap/its/webgui?~transaction=<transaction>
Please replace the parameters in <..> with appropriate values before testing.
Regards,
Ravi -
How to call java function in javascript
Hello Everyone,
Can anyone tell me solution that:
How to call java function in javascript?
Thanks,
VIDsYou can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want. -
How to call java program by HTML page
Hi guys,
I'm new java programer and want to build an HTML page to access to ORACLE database on NT server by JDBC, Can anyone give me a sample?
I already know how to access database by JDBC, but I don't know how to call java program by HTML page.
If you have small sample,pls send to me. [email protected], thanks in advance
JianThis code goes with the tutorial from this web page
http://java.sun.com/docs/books/tutorial/jdbc/basics/applet.html
good luck.
* This is a demonstration JDBC applet.
* It displays some simple standard output from the Coffee database.
import java.applet.Applet;
import java.awt.Graphics;
import java.util.Vector;
import java.sql.*;
public class OutputApplet extends Applet implements Runnable {
private Thread worker;
private Vector queryResults;
private String message = "Initializing";
public synchronized void start() {
// Every time "start" is called we create a worker thread to
// re-evaluate the database query.
if (worker == null) {
message = "Connecting to database";
worker = new Thread(this);
worker.start();
* The "run" method is called from the worker thread. Notice that
* because this method is doing potentially slow databases accesses
* we avoid making it a synchronized method.
public void run() {
String url = "jdbc:mySubprotocol:myDataSource";
String query = "select COF_NAME, PRICE from COFFEES";
try {
Class.forName("myDriver.ClassName");
} catch(Exception ex) {
setError("Can't find Database driver class: " + ex);
return;
try {
Vector results = new Vector();
Connection con = DriverManager.getConnection(url,
"myLogin", "myPassword");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
String s = rs.getString("COF_NAME");
float f = rs.getFloat("PRICE");
String text = s + " " + f;
results.addElement(text);
stmt.close();
con.close();
setResults(results);
} catch(SQLException ex) {
setError("SQLException: " + ex);
* The "paint" method is called by AWT when it wants us to
* display our current state on the screen.
public synchronized void paint(Graphics g) {
// If there are no results available, display the current message.
if (queryResults == null) {
g.drawString(message, 5, 50);
return;
// Display the results.
g.drawString("Prices of coffee per pound: ", 5, 10);
int y = 30;
java.util.Enumeration enum = queryResults.elements();
while (enum.hasMoreElements()) {
String text = (String)enum.nextElement();
g.drawString(text, 5, y);
y = y + 15;
* This private method is used to record an error message for
* later display.
private synchronized void setError(String mess) {
queryResults = null;
message = mess;
worker = null;
// And ask AWT to repaint this applet.
repaint();
* This private method is used to record the results of a query, for
* later display.
private synchronized void setResults(Vector results) {
queryResults = results;
worker = null;
// And ask AWT to repaint this applet.
repaint(); -
How to call SOAP API from JavaScript
Hi,
I'm trying to call the SOAP API to get statistics about emails. Are there any examples on how to call the API from JavaScript?
Here is a link to my original question about using the REST API. REST API URL for email statistics
Thanks,
TimTim,
In order to consume a SOAP API I recommend you use something other than JavaScript.
Any platform can offer you a good SOAP client should be OK. (.Net, Java, php, Ruby, python).
I didn't see anyone successfully used javascript and consume the Eloqua SOAP API.
I know you can create a SOAP client in Java script but it will be too much work to handle the Eloqua response in some cases.
Regards,
Daniel -
Error while calling java program from ABAP
Hi Experts,
We are trying for RFC inbound scenario.
We followed the below blog
/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
We are working with SAP JCO 3.0.2
We are getting the error : 'STFC_CONNECTION' could not be found in the server repository.
After I run the Java server program if I execute the RFC destination directly from SM 59 it is showing successful messages.
If I stop the java program then this RFC is failing. Based on this we concluded that RFC to Java connection is working fine.
But as mentioned in blog if we call the RFC Destination from ABAP program it is giving the below error,
'STFC_CONNECTION' could not be found in the server repository.
If we test the RFC destination using RFC_TRUSTED_CHECK standard FM we are getting the below error.
'RFCPING' could not be found in the server repository.
We create the RFC destination of Type : TCP/IP as exactly mention in the blog.
Please help us in resolving this issue.
Thanks
PrincePabi,
Using the RFC connection,we can establish a link between Java and SAP.
Afterwards,hope we can call Java program from ABAP.
Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
DATA: REQUTEXT LIKE SY-LISEL,
RESPTEXT LIKE SY-LISEL,
ECHOTEXT LIKE SY-LISEL.
DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
DATA: RFC_MESS(128).
REQUTEXT = 'HELLO WORLD'.
RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
CALL FUNCTION 'STFC_CONNECTION'
DESTINATION RFCDEST
EXPORTING
REQUTEXT = REQUTEXT
IMPORTING
RESPTEXT = RESPTEXT
ECHOTEXT = ECHOTEXT
EXCEPTIONS
SYSTEM_FAILURE = 1 MESSAGE RFC_MESS
COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
IF SY-SUBRC NE 0.
WRITE: / 'Call STFC_CONNECTION SY-SUBRC = ', SY-SUBRC.
WRITE: / RFC_MESS.
ENDIF.
Regards,
Sree -
Calling Java program from ABAP
Hi All,
my ABAP program downloads one file to one folder. Then one Java program is running to Encrypt the file.
Now , they want to call the JAVA program in ABAP, so that they can encrypt the file before downloading.
Is it possible to call a Java program from ABAP ? If Yes, please give me the detailed procedure.
Thanks
pabiPabi,
Using the RFC connection,we can establish a link between Java and SAP.
Afterwards,hope we can call Java program from ABAP.
Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
DATA: REQUTEXT LIKE SY-LISEL,
RESPTEXT LIKE SY-LISEL,
ECHOTEXT LIKE SY-LISEL.
DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
DATA: RFC_MESS(128).
REQUTEXT = 'HELLO WORLD'.
RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
CALL FUNCTION 'STFC_CONNECTION'
DESTINATION RFCDEST
EXPORTING
REQUTEXT = REQUTEXT
IMPORTING
RESPTEXT = RESPTEXT
ECHOTEXT = ECHOTEXT
EXCEPTIONS
SYSTEM_FAILURE = 1 MESSAGE RFC_MESS
COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
IF SY-SUBRC NE 0.
WRITE: / 'Call STFC_CONNECTION SY-SUBRC = ', SY-SUBRC.
WRITE: / RFC_MESS.
ENDIF.
Regards,
Sree -
How to call java method from workflow script?
Hi
I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
Is there any alternative better way to achive this requirement from workflow? Please suggest.
Thanks,
SarangOK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
Solved? -
How to run java program from website?
Hello
I'd like to know how to run java program from my web page.
I'd like to push some button in this web page so java program that would be on my server
would pop-up. Can it be done automaticaly upon running this web site? (without any buttons - I just enter website and program pops up).
CheersI rather thought about RMI. But I could try servlets. So how it would look like?.
I would make http request in browser (enter address) and program would show up in its window?. And I would not have to change anything in my program?. This program would run then on both boxes?. One remotely and one not?.
But I would have to learn some basics, I've never worked with servlets. Could you suggest some good sites about it?. With ready examples so I could tweak them to my purpose.
Message was edited by:
macmacmac -
How to call Java API from BSP?
I have a requirement to call Java API from BSP application.
I have checked the forum and found that it is possible by using some ABAP codes.
However there is no pointer on how this is done.
Can someone explain the details on how to call Java API from BSP is done?
I found class CL_EJB_JAVA_OBJECT_METHODS to call a method in EJB but can't find function or SAP class to call Java API.
Actually is there any BSP extention which can used to call Java API?
Thanks,
Hendricheck out these weblogs, it should give you an idea how to go about it.
/people/ignacio.hernndez/blog/2006/12/04/speech-synthesis-listen-the-application-server-is-talking-to-you
/people/puru.govind/blog/2006/12/20/let-abap-speak
Regards
Raja -
How to call java implementations from C language
How to call java implementations from C language....
I know using JNI java can call C code....is the converse also possible????
-RamsHow to call java implementations from C language....
I know using JNI java can call C code....is the
converse also possible????Yes. -
Calling Java programs from Oracle Stored Procedure
Is it possible to call Java programs from Oracle stored procs? If possible Can this be used to exchange data from other applications? Is there a better method/feature in oracle for doing data exchange with other apps?
If what you mean by Oracle stored procedures is pl/sql then yes.
You can create a "wrapper" this way:
CREATE OR REPLACE FUNCTION xmlXform
in_mapUrl IN VARCHAR2,
in_inputUrl IN VARCHAR2
RETURN VARCHAR2
AS
LANGUAGE JAVA NAME
'com.yourcompany.xml2any.xform(java.lang.String,java.lang.String)
RETURN java.lang.String';
Then load the java as:
loadjava -user youruser/youruserpasswd -resolve -verbose lib/xmlparserv2.jar classes/com/yourcompany/xform.class classes/com/yourcompany/xml2any.class
The java, given the correct permissions, can do anything java can do including communicate with outside applications.
Is this the "best" way... depends on what you are trying to accomplish. -
How to call Java Pgm from a VB / C / C++ Application???
Hi,
I have 3 applications in VB, C, C++ respectively.
I have a java program which accepts a message id & message description.
How can i call this java program from my VB, C, C++ applications and pass the parameters.
Thanks,
Karthik Naraino You could use an exec() call to run it in another process.
o You could write JNI code to start the JVM and run your program. (Complicated)
Maybe you are looking for
-
My thunderbolt port is being HOT and the external hard drive doesn't work with this port! Can anybody help me?
-
Can't find table in PRO*C application.
it is a ORACLE 10g (10.2.0.3.0) I programed a pro*c application that has many querys. Application runs very nice for many many days. Some day, application can't run because oracle error occured. I dumped trace file it in ORACLE. =====================
-
How to add an image in APEX?
How do display a picture in my Apex web forms? Edited by: movilogo on Jun 11, 2009 1:49 PM
-
Dreamweaver CC 2014.1 on Mac Constantly Hangs / Crashes Since Yosemite Update.
Deleting Cache file didn't help, but deleting the Configuration Folder made the program function for about an hour. The hangs occur during changing site and saving a file. Any advice would be appreciated.
-
Missing HTML5 layouts - how do I find them?
Hi. I just installed Dreamweaver CS5, went to open a new, blank document ... and there are no HTML5 layouts in the layout column. There should be two? Does anyone know how I can get these missing HTML5 layouts? (HTML5 does display as a choice in the