cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SAP JCo usage

Former Member
0 Kudos

Hi people,

I'm new in this community and I'm asking here this after weeks of investigation on the web. I've found some articles that allowed me to understand some of the basics principles of working with SAP and using the SAP Java Connector library, but I've not reached full understanding of some functions, methods, classes, etc.

This is the situation:

I've to develop a Java App that could run as a Windows Service (already solved this with Java Service Wrapper), and act as a Middleware between SAP and an Access Control System (ACS).
This app should:

  • Get the absenteeism stored in SAP (Justified Absenteeism or Disciplinarian Measure) and send it to the ACS in order to block employee Clock In register in that cases.
  • Get the Clock In and Clock Out data from the ACS and send it to SAP.

I have doubts about using a BAPI or an IDOC for the first item.
I know I have to use a BAPI for the second one, but I don't know how to create the Business Specific Object and passing it as a parameter to the BAPI.

Could you guide me to achieve these functionalities?

Thanks a lot!

P.S: Sorry for the mistakes but English is not my native language...

Accepted Solutions (1)

Accepted Solutions (1)

former_member215981
Active Participant
0 Kudos

Hello,

I would suggest you have a look at JCO guide

service.sap.com/connectors

SAP Java Connector

Tools & Services

SAP JCo 3.0 Documentation

Best Regards,

Yong Luo

Former Member
0 Kudos

Yong, I'm a third party developer and I have no direct access to the download section. I've  asked for the documentation that you're suggesting, hope it helps. Thanks!

Former Member
0 Kudos

Yong, I've obtained the documentation you suggest but it isn't different from what I've found in internet or in the SAP JCo library itself.

I've been making progress with this issue and found that I need to use a Z-function named "ZARHR_CC1_UPLOAD_TIMEEVENT", with the same parameters as "BAPI_CC1_UPLOAD_TIMEEVENT".

This BAPI has a table called "TIMEEVENT" with all the fields representing Infotype 2011 - TimeEvent (http://www.consolut.com/en/s/sap-ides-access/d/s/doc/F-BAPI_CC1_UPLOAD_TIMEEVENT~~~~~TIMEEVENTS)

Now I should guess how to fill these fields and execute the function.

Once I've achieved this, should I execute another BAPI like BAPI_TRANSACTION_COMMIT or something like that?

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bruno... if your Java application isn´t in a WAS Java...maybe you might expose your BAPIs are Web Service and consume them from your application, otherwise you might use JCA connector, take a look tto the next guide.

http://help.sap.com/saphelp_nw73/helpdata/en/4a/5fd52b16bc0451e10000000a421937/frameset.htm

Hope it helps

Former Member
0 Kudos

Hi Juan, thanks for the reply but I don't really understand what are you talking about. I've no access to SAP so I can't change the way the BAPIs are exposed. I have to use SAP JCo 3 to achieve mi goals.
Also I'm not using SAP NetWeaver to do the development, just NetBeans.

Sharathmg
Active Contributor
0 Kudos

Hello Bruno,

Even though you will use netbeans , try to use nwds to prepare

Proxy classes with Jco.

Install NWDS.

Create  Wdynpro project.

Create a model

In the wizard, give the Java connector name defined for the Sap system

Give sap credentials and choose the Bapi

Complete the wizard

Now, you can use proxy files generated in your java project

Regards,

Sharath

Former Member
0 Kudos

Thanks Sharath, I'll give it a try if I get access to NWDS!

Sharathmg
Active Contributor
0 Kudos

Hello Bruno,

I have written a short blog for this purpose.

You can use it for this purpose. Hope it helps.

Blog link: http://scn.sap.com/community/java/blog/2013/08/27/proxy-class-to-access-sap-functions-jco-and-enterp...

Thank you.

Regards,

Sharath

Sharathmg
Active Contributor
0 Kudos

Additionally, check the following link : http://help.sap.com/saphelp_nw04/helpdata/en/b6/55e3952a902447847066a0df27b0d6/content.htm for code snippets to use these classes.

Regards,

Sharath