cancel
Showing results for 
Search instead for 
Did you mean: 

Send data from SAP to JAVA program

Former Member
0 Kudos

Hi,all.

There is a problem in my project.

I want to send data from SAP for external handling.I use the RFC to trans data, and then use JAVA to do futher handling.

I did it like this:

1.In SAP,define a RFC,

2.In JAVA,create a server;

3.In SAP,create a DESTINATION;

4.In SAP,do a report to write data into the RFC.

5.In JAVA,synchronized get the data which be writen to the RFC.

Am i right?

and I don't know how to do the step 5.

Thanks!

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,Lingxing Meng .

Tanks.

But my problem is not so simple.I know your business.your JAVA prg get data from SAP is active.

I want to do it passively in JAVA. The JAVA prg raise a server,generate the DESTINATION(TCP/IP type), another JAVA prg waiting for the data, if the SAP prg take action,then the data trans to the JAVA prg as soon as posible , and the JAVA prg format the data ,generate a XML file use these data.

Former Member
0 Kudos

Lei,

Now it's unclear who calls whom

If it is SAP program that calls JAVA code, then please read post /people/thorsten.nordholmsbirk/blog/2006/03/31/deconstructing-sap-was-jco-rfc-provider-under-the-hood

It describes how to set up RFC destination on WebAS Java and WebAS ABAP to let ABAP part invoke functionality provided by Session EJB running within WebAS Java.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

0 Kudos

Hello lei xiang,

I can call RFC from Java, but I am not sure how to call JAVA from SAP. Looking forward to the answer.

meng

null

Former Member
0 Kudos

Yes,I see it.

But i don't want to use it.

Is there any other way?

Now,the key is, the SAP is te sender, JAVA is the reciever, and the action of datat sending from the SAP is actively, when a SAP program, not only a REPORT,call the RFC,and trans some data to te RFC, then the JAVA program get the data automaticlly.

Could you help me?

Former Member
0 Kudos

HELP,HELP,HELP!!!

Former Member
0 Kudos

Did you go through my last reply !!

Regards, Anilkumar

Former Member
0 Kudos

I do use JCO to connect SAP and JAVA,

but i can not define a method in JAVA to call a RFC in SAP actively.

Former Member
0 Kudos

Thanks.

My program is:

get the SAP data,then use JAVA to do some process,such as format the data to XML,and at last send the data to another non-SAP system.

I do not know how to send data from SAP to java automatically.

need your help!

Former Member
0 Kudos

Hi,

1. Use AdaptiveRFC importer to mport the BAPI (from SAP system)

refer to sample tutorials for working with adpative RFC

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/5dcbe990-0201-0010-2c99-a2bc9e61acfc

2. Once you call execute() method in WebDynpro, it will execute the BAPI and you will get the SAP data into your WebDynpro context.

3. Read the context and then you can convert it into XML and so on....

Regards, Anilkumar

Former Member
0 Kudos

Especially,when i run the report which have called the RFC,then,it can send the data automaticlly, at the same time, the JAVA program can recieve the data.

Former Member
0 Kudos

Hi Lei,

1. It can be done on the ABAP side , bcose you willbe calling the report on the ABAP system.

2. Or You can use AdpativeRFC to call RFC and then transfer the data to java in your webDynpro code (If you are using WebDynpro)

3. or you can write Jco client in your java prog, which will call the ABAp Functionmodule and get the data after executing the function and set the methods on the java class.

Regards, ANilkumar