cancel
Showing results for 
Search instead for 
Did you mean: 

bapi problem via jco

Former Member
0 Kudos

hi guys,

i am using bapi via jco

i am retrieving data,appending data on standard funtional modules , ok, fine

how can i insert data into custom tables using bapi via jco...

plz give me some steps...............

thanks,

tony

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Tony,

Sorry for late reply.

Can you please let me know in which table you want to insert data into.

There are few default BAPI's like BAPI_FLIGHT_SAVEREPLICA which is used to update the data in SFLIGHT.

You can take your own input feilds depending upon the requirement to update the data.

Anil Dichpally

Former Member
0 Kudos

hi Anil Dichpally ,

ok fine information,,, is there any queries like oracle to communicate to sap r/3

tables....

ex: select * from emp;

thanks

Former Member
0 Kudos

Dear Swathi,

I have mentioned clearly in my last post, we dont write any kind of quieries in SAP.

we just call a BAPI and internally BAPI will have the queries.

regards

Anil Dichpally

Former Member
0 Kudos

Hi,

Just to clarify (again) as far as I know yuo cannot directly access SAP tables via JCo calls from Java. JCo only allows you to call function modules on teh SAP system. Any database interaction (Select, Insert, etc.) has to be coded in ABAP inside the function module. You then call the function module (which must be RFC enabled) via JCo in your Java.

You can use standard function modules or you can create custom function modules if you need to acces custom tables or perform custom logic.

Hope this helps,

Gareth.

Former Member
0 Kudos

hi,

ok fine i got one error........

while i am setting values to the sap r/3 table.. using bapi via jco

codes.setValue("12.02.2007","BEGDA");

HERE it throwing error:

cannot convert string type to data field in BEGDA

PLZ help me...

thanks,

Former Member
0 Kudos

Hi Tony,

It is probably because SAP stores dates internally in the format yyyymmdd and the field type BEGDA is probably of this format. So you could try reformating your string representation of 12.02.2007 to be "20070212".

Gareth.

Former Member
0 Kudos

Dear Swathi,

Try to assign the data value to some String and then use that String value in your program.

regards

Anil

Former Member
0 Kudos

hi,,

THANKS IT IS WORKING ...NOT THROWING ANY EXCEPTION..

Former Member
0 Kudos

Congrats Swathi.

regards

Anil

Answers (2)

Answers (2)

Former Member
0 Kudos

i would like to have an complete examples both on server side and client side using abapa and jco, can any body help me in this and i would like to know the libraries used in jco.

Former Member
0 Kudos

Hi tony,

To do that you will have to write a custom BAPI module in SE37 that does the database updates on the SAP system for you. Then call that from JCo as before. If you don't know ABAP you will need to get an ABAP developer to write this BAPI for you.

Gareth.