cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Composite Application Generation - RFC

macds
Explorer
0 Kudos


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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member192811
Participant
0 Kudos

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

macds
Explorer
0 Kudos

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


former_member192811
Participant
0 Kudos

Thanks a lot James.

I am actually using SAP NetWeaver 7.2 SP09 PAT0008.

I will try installing NWDS again and will update you if it works.

thanks again 🙂

former_member192811
Participant
0 Kudos

Thanks James it worked 🙂

macds
Explorer
0 Kudos

Excellent.

Happy to help.