cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Connector and RfcCancel

Former Member
0 Kudos

Hi,

My goal is to be able to cancel a long BAPI from a .NET application.

After some research I've discovered that the .NET Connector uses the "RfcCallReceive" function. The problem is that (according to the RfcLib docs), RfcCancel can be used only if the BAPI call is invoked using RfcCall / RfcListen methods.

Does anyone knows how to work around this?

Thanks,

Daniel

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Amit,

Thanks for replying, I'm doing great!

I'm trying to use a BW BAPI which returns some tables. From the documentation (and the functions prototype) it looks like tRfc is amid for write only BAPIs. This is not my case. Thanks anyway

I would appreciate any other ideas. If I could only override two lines of code in the RfcClient.RfcInvoke so it uses RfcCall / RfcListen and not RfcCallReceive, it would be so sweet… I would be able to give the user the ability to stop something he exceedingly did and now takes forever.

Thanks,

Daniel

Former Member
0 Kudos

Hi Daniel,

thanks for the clearer picture of requirements.

your scenario, as i understand it :

1> you have a read only BAPI, which does what it does for quite a while before returning with the result

2> as a requirement, you wish to be able to have the capability to end the bapi call at any given point and return to the winForm / webForm

you are pursuing a connector level solution to fulfill this requirement

here is my 2 cents :

looking at options which do not modify standardized code (as this will not pass the GoLive check that easily, it will take up a lot of resources to custumize this way, and not deliver any real value from a maintainance point of view)

1> as it is a bapi which takes a while to be processed, you could look at async mode of communication :

async rfc calling

http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/22ac17b9cfad40ade01d2e7e0d2ac9/content.htm

IDoc sender :

http://help.sap.com/saphelp_nw2004s/helpdata/en/1e/4da84f80e84946878fd98508d419f7/content.htm

2> could the bapi be modularized and broken into smaller bapi's which would return partial results ?

you could write a wrapper which gives it a selection criteria, and based on the input will return in a specific time frame

this is a common approach when you need to read tables which return million plus records

3> thread manipulation in a winForm could achieve your required effect

4> using a webService Behaviour (client side invocation of a server side function) would give you the needed functionality in a web based scenario

with respect,

amit

Former Member
0 Kudos

Hi Daniel,

how are you doing ?

Have you used tRFC's (transaftional) ?

being asyncronous you could have a similar to your deisred effect ...

// call proxy

proxy.TRfcRfc_SomeMethod(ref someParameters , myTransactionId);

//the SAP system rolls back the rfc changes unless confirmed

proxy.ConfirmTID(myTransactionId);

please have a look at :

http://help.sap.com/saphelp_nw2004s/helpdata/en/86/58d1e4032eb646b0f88b2366e03fa6/content.htm

and

http://help.sap.com/saphelp_nw2004s/helpdata/en/23/a00d4ce84731418c41039966be3111/content.htm

with respect,

amit