Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP Calling JAVA Function or Method

Former Member
0 Likes
689

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.

1 REPLY 1
Read only

Kanagaraja_L
Active Contributor
0 Likes
360

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