on 03-01-2010 10:49 AM
Hi gurus,
I'm trying to dinamically change a model data connector inside my web dynpro. I'm using an Adaptive RFC Model 2 to communicate with the R/3 backend. I've found that is possible to change the connector modifiyng the code inside the web dynpro. In detail I've found this example:
IWDDynamicRFCModel model1 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model1.class);
I put this code into wdDoInit method but I get the following error:
"<comp_name>.wdDoInit failed to create or init instance of model 'model_name' in scope NO_SCOPE with instanceId 'null'"
Furthermore I've used the deprecated Adaptive RFC Model and when I instantiate a model, ModelName m=new ModelName(), I see that the methods m.setJcoClient(client) and m.setSystemName(systemName) are visible, while when I try to do the same with Adaptive RFC Model 2, with my model m, the methods before there aren't.
So this is my question: is it possible to change data connector dinamically with Adaptive RFC Model 2?
Thanks a lot
Hi Upendra Agrawal,
I'm able to acces the information about a specific JCO using WDSystemLandscape.getJCOClientConnection("JCO") but the main problem is that I'm not be able to set dinamically another JCO, that it can be found in my Destinations repository, with another specific client using Adaptive RFC 2 Model. Infact in the document that I report above it specifies that the new Adaptive RFC 2 Model does'nt permit to change dinamically JCO at runtime. Perhaps have SAP disabled this feature?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've found this document that explain the new Adaptive RFC 2 Model:
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/50f7192d-2808-2d10-189b-df3fa5f71abf]
In the chapter "Summary of Differences between ARFC1 and ARFC2" it says that the new Adaptive RFC 2 Model doesn't permit the dinamically modification of JCO client...
In detail my scenario is the following:
I have a connection to backend with a specific client. I want to change dinamicaly this client (the backend is the same) inside the web dynpro without to create another model. Is it possible with Adaptive RFC 2 Model?
Thanks at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Lukinho,
You may try this ;
try {
IWDJCOClientConnection clientCon = WDSystemLandscape.getJCOClientConnection("<name of the JCO connection>");
String clientName = clientCon.getClientName();
String lang = clientCon.getLanguage();
String passowrd = clientCon.getPassword();
String sysID = clientCon.getSystemIdentifier();
String user = clientCon.getUser();
//etc...
} catch (WDSystemLandscapeException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
I got this code from the thread [Multiple Client Logon in JCO |;
Also have a look at this thread
Hope it helps!!
Warm Regards
Upendra Agrawal
Hi,
Perhaps you can try using the "new" Adaptive RFC. You will "Import" your BAPI normally into NWDS.
In your code, you could change this property directly using your Input class. Like:
Z_Get_Article_Label_Data_Input zGetArticleLabelDataInput = new Z_Get_Article_Label_Data_Input();
zGetArticleLabelDataInput.modelInstance().setJcoClient(JCO.Client);
zGetArticleLabelDataInput.modelInstance().setSystemName(String);
Hope it helps,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.