cancel
Showing results for 
Search instead for 
Did you mean: 

ARFC2 - javadocs & proper documentation

former_member182374
Active Contributor
0 Kudos

Hello Experts,

I'm using Adaptive RFC2 model in my project (authentication method is service user).

I need an additional use of the same model with SSO (logon ticket).

I can always create a new model which works with another destination but I don't want to duplicate code.

It's seems that it's not possible to extend the generated classes nor set RFC destinations in the c'tor of the model (I'm using NW 7.31 SP7).

I found note 1920259 and setting destinations in run time is possible in higher versions of NWDS (since I'm using NWDI I don't want to use higher version of NWDS).

I also found code for running ARFC2 without Web Dynpro (https://help.sap.com/saphelp_nw73ehp1/helpdata/en/4a/c48672975b2048e10000000a421937/content.htm) . This might solve my problem but besides the servlet code sample there isn't much documentation.

I raised an OSS message and this is the answer I've got:


Dear Customer,
There are no javadocs released to the customer for AFRC2, we are sorry
for any inconvenience caused.

I don't understand why SAP publish an example without javadocs...

Does someone have experience with the ARFC2 API without Web Dynpro?

Regards,
Omri

Accepted Solutions (1)

Accepted Solutions (1)

daniel_ruiz2
Active Contributor
0 Kudos

Hi,

well, I will do an assumption here.. I think you're using WDJ correct? (ARFC2 Model Type)

Case this is correct, the generators hardcode the execution destination into the Model Class directly - the class that extends ARFC2TypedModel..

The same ARFC2TypeModel class, will have a method called getExecDestination() -- but no setter as you probably saw.. The 'execDestination' attribute is carried over to a ARF2Model class which is contained in the ARFC2TypeModel as an attribute called _delegate - and of course, there is a setter for execDestination in ARF2TypeModel.

With such information, you could:

1. Get the Model instance;

2. Get the _delegate Field;

3. Set Accessible;

4. Get and cast the Field into and ARF2Model attribute (use tc/cm/arf2 -- public part restricted)

5. Set the execDestination(String);

Code should look something like:


MDLMyModel mdlMyModel = getModelInstance(MODEL_INSTANCE_KEY);

Field arf2ModelField = mdlMyModel.getClass().getField("_delegate");

arf2ModelField.setAccessible(true);

ARFC2Model arf2Model = (ARFC2Model) arf2ModelField.get(mdlGetPOSv2Auth);

arf2Model.setExecDestination("ANOTHER_DESTINATION");

I haven't really tested but this should work and avoid a lot of duplicate code due one simple String you should set.

Hope it helps,

D.

PS: SAP was never really great with documentation.. which is a shame.

PS2: I did not mention the step to setup a destination in NWA to use Logon Tickets, please let me know if you need help with that.

former_member182374
Active Contributor
0 Kudos

Hi Daniel,

Your assumption is incorrect (-:

I'm an "old school" portal developer (Visual Basic, Portal Components, Web Dynpro Java).

I've no problem using ARFC2 with Web Dynpro Java (including all the NWA stuff, SSO etc).

The problem as you mentioned is the lack of SAP documentation.
They have one lousy example in their web site and that's it. In the example they use classes but the classes don't have JavaDocs.

When you open OSS they answer "There are no javadocs released to the customer for AFRC2".


PS
All portal developers know the ep5user that's used for KM the class was deprecated for years with no proper replacement.

PS2
Some of the classes of Web Dynpro java (from 2004) will be deprecated in 2006 release (according to the docs).
As far as I know the year is 2014...

Regards,
Omri


junwu
Active Contributor
0 Kudos

That is sap java, I thought you should have known it...........

daniel_ruiz2
Active Contributor
0 Kudos

Hi Omri,

still, even thou documentation is not great (look, we all agree on that) there is mention on how to modify the destination used for execution of the ARFC2Model.

I mean, on the sample you posted you already have the ARF2Model instance, so just do a .setExecDestination(String) and you'll be fine.. are you doing something like that?

I have no idea what old school means in this context; because I have been coding Java since nearly its release (and I'm not old school) - I meant no offense on my comments, but I'm positive your query has been answered.

Cheers,

D.

PS: I assumed you were on WDJ since your query has been posted on the WDJ space.. which is only natural to assume.

former_member182374
Active Contributor
0 Kudos

Jun - you are absolutely right (-:

former_member182374
Active Contributor
0 Kudos

Daniel - thanks for you help!

I guess I will do the following:

1) If I need to use the same function with different system I'll use JRA.

2) For WDJ I'll still use ARFC2.

Regards,

Omri

daniel_ruiz2
Active Contributor
0 Kudos

Hi Omri, I'd agree on both your points; stick with JRA/JCA for anything that is not WDJ related -- underlying implemenation it's using JCO, but you work on EE specification and documentation actually EXISTS on that space, ARFC for WDJ. and, if one day you need to do the same in WDJ, that's pretty much the way to accomplish it. Cheers, D.

Answers (0)