‎2010 Jan 06 6:49 AM
Hi Friend,
I need help in how to proceed using ABAP and Call JAVA Function . I know that we need to use RFC enabled Function modules. I was able to connect using JAVA Connector which was provided by SAP For communicating with JAVA Apps. The approach for connecting the JAVA to SAP is working fine. But I have browsed through various website but failed to find any information.Now i am looking forward to help from you friends to solve my problems .
The Requirement is mentioned below:-
1. Prerequiste for SAP ABAP calling a third Party software which is working in JAVA Platform (like any middle ware which might be hardware or software).
2. Sample Code like calling a Text ' Hello to the world calling JAVA from ABAP'.
3. Steps and process so that it would be helpful.
Timely help would be appreciated.
Rajiv Christopher.
‎2010 Jan 06 12:26 PM
1.Middleware is JCO RFC provider it comes with SAP so no need any third party Adapter.
2.
" The ECHOTXT parameter should contain the text of REQUTXT.Information on
" calling the function module should be returned in RESPTXT, indicating, for
" example, in which system and when the function module call was processed.
"------------------------------------------------------------------------------
data:ECHOTEXT type SY-LISEL,
RESPTEXT type SY-LISEL.
CALL FUNCTION 'STFC_CONNECTION' DESTINATION '<Your JCO destination name>' " which one you have developed in SM59 as TCP/IP
EXPORTING
requtext = 'ABAP Calls JAVA'
IMPORTING
ECHOTEXT = ECHOTEXT
RESPTEXT = RESPTEXT.
if sy-subrc = 0.
WRITE:/'---------------------------------------------------------------------'.
WRITE: / 'establish a link to the ABAP application server with logon data'.
WRITE:/'---------------------------------------------------------------------'.
write:/ ECHOTEXT .
else.
WRITE:/'---------------------------------------------------------------------'.
WRITE: / 'Not establish a link to the ABAP application server with logon data'.
WRITE:/'---------------------------------------------------------------------'.
endif.Check the sample code and Let me know will you get ECHOTEXT ?
Kanagaraja L
Edited by: Kanagaraja Lokanathan on Jan 6, 2010 1:27 PM