on 12-04-2013 11:35 AM
Hi,
I have a composite application, that is basically a number of imported SAP RFC function modules. This composite application is used in various ways and has been performing well for many years.
I now have to import a new RFC into the composite application.
I connect to the NWDI and create the project in my workspace from the source control.
I now have the nice, working version with it's 10 imported function models.
The problem starts if I try to generate this application.
If I look at the bean for one of the function function models in the EJB (under the navgator window in the Composite Application prespective).
I see the connection code for the service and and it looks like below (this is pre generation)
recordFactory = sapConnectionFactory.getRecordFactory("R3_SVC");
try { // Try creating a connection with the language of the current user first.
IUser user = UMFactory.getAuthenticator().getLoggedInUser();
if (user != null && user.getLocale() != null) {
ConnectionSpec spec = sapConnectionFactory.createConnectionSpec("R3_SVC", null, user.getLocale().getLanguage());
connection = sapConnectionFactory.getConnection(spec);
}
} catch (ResourceException e) { // $JL-EXC$ Probably the R/3 system does not support the user language. The language from the destination will be retried below.
}
if (connection == null) {
connection = sapConnectionFactory.getConnection("R3_SVC");
}
As stated this is fine and has worked for years.
As soon as I try to generate the Application (I have made no changes, same as when imported from the source control, this is a simple generate). The code changes to the below;
try { // Try creating a connection with the language of the current user first.
IUser user = UMFactory.getAuthenticator().getLoggedInUser();
if (user != null && user.getLocale() != null) {
Map<SAPConnectionFactory.CustomDestinationProperty, String> props = new HashMap<SAPConnectionFactory.CustomDestinationProperty, String>();
props.put(SAPConnectionFactory.CustomDestinationProperty.LANG, user.getLocale().getLanguage());
connection =sapConnectionFactory.getConnection("R3_SVC", props);
}
} catch (ResourceException e) { // $JL-EXC$ Probably the R/3 system does not support the user language. The language from the destination will be retried below.
}
if (connection == null) {
connection = sapConnectionFactory.getConnection("R3_SVC");
}
The generateion has added the lines
Map<SAPConnectionFactory.CustomDestinationProperty, String> props = new HashMap<SAPConnectionFactory.CustomDestinationProperty, String>();
props.put(SAPConnectionFactory.CustomDestinationProperty.LANG, user.getLocale().getLanguage());
This throws up a "SAPConnectionFactory.CustomDestinationProperty cannot be resolved to a type" and I cannot do anything with the class anymore.
Obviuosly, this is code generated by NWDS on the back of a function model import. I cannot change this code. It's automatic.
I've raised the meesage on OSS but they are currently claiming they can't help with custom code!!! I have tried to exaplain it's their tool generating it.
Has anyone seen this before? I don't have a clue where to stop it happening.
Cheers
Hello James,
Can you please let me know how you solved this issue.
I am facing the same issue and I am absolutely clueless and need help.
Thanks & Regards,
PoojaM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi PoojaM,
I found a developer on site who did not have the issue, they were using an earlier version of NWDS. I simply re-installed this version on my PC and the problem we fixed.
I was using NWDS 7.3 SP09 PAT0001.
I am now using NWDS 7.3 SP02 PAT0008 and this works fine.
Must have been a problem in SP09. We are about to upgrade to 7.4 so I will need try a newer version of NWDS but hopefully it'll be ok in a later version.
If you can, try installing 7.3 SP02.
Let me know how you get on.
Cheers
James
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.