‎2011 Aug 03 6:24 AM
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
pabi
‎2011 Aug 03 6:37 AM
Pabi,
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
‎2011 Aug 03 6:34 AM
Hi Pabi,
I think this link can help you.
[Communication between ABAP and Non-ABAP Technologies|http://help.sap.com/saphelp_nw2004s/helpdata/en/6c/934a4278bbb56be10000000a155106/frameset.htm]
Regards,
Peter
‎2011 Aug 03 6:37 AM
Pabi,
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
‎2011 Aug 03 7:02 AM
Hi Sreeram,
Thanks for your help. After the Java connection is successful, what are the code to put , to call JAVA program.
Thanks
pabi
‎2011 Aug 03 10:57 AM
Can anybody have the detailed procedure to achieve this requirement ?
‎2011 Aug 03 11:28 AM
Hi pabitra,
JAVA or javascript? You can use the HTML viewer GUI control to run javascript.
But starting with ECC600, a SAP server has a JAVA stack by default which is used for purposes like PDF interactive form processing and the like. I do not know how to run any JAVA program there, your basis admin may have an idea.
On the long run, your company may consider to use digital signatures. SAP offers integrated solutions for signing and encrypting data, start here:
[Secure Store and Forward Mechanism (SSF) |http://help.sap.com/saphelp_nw70/helpdata/en/4d/bf6f77a2c5446a86e0152f1b309db6/frameset.htm]
Regards
Clemens
‎2011 Sep 13 2:56 AM
Hi pabita,
Just read your question. Actually I also got this kind of assignment; my abap to call javascript. and this script will extract the DME file from TEMSE and encrypt it and lastly store the file to the download folder. THis script given by bank and I need to pass the DME filename, TEMSE path and download path.
Have you found the solution for this? since I just started, so, roughly I have idea and might use class CL_JAVA_SCRIPT to call this javascript. you may refer to tcode ABAPDOCU and find DEMO_JAVA_SCRIPT_MINI_EDITOR. there are alot of sample abap coding to call the javascript.
if you don't mind, maybe you can share what you got for this? I still not sure either my idea is working or not since I need to understand the javascript given by the bank; i.e. input parameter, process and the output.
ok thanks