Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Applies to:

Web Dynpro for Java 7.31.

Summary:

This tutorial is aimed at developers already familiar with versions of Web Dynpro Java 7.0 and Web Dynpro Java 7.31. This explains step by step procedure on how to migrate Web Dynpro Java Components from NW 7.0 to NW 7.4. This tutorial also handles common error & exceptions during the migration process. This covers all important settings & solutions required for NWDS work perfectly for the migration process.

Author: Nutan Sangai

Company: Infosys Ltd

Created on:  June 2, 2014


Table of Contents

1. Introduction

2. Prerequisites

3. Import WD DCs to NWDS

4. Resolve Dependencies

5. Migrate Model

6. Migrate WebDynpro DC component

7. Cheat Sheet Activities

8. Build & Deploy

9. Run-time Errors

10.References

1. Introduction

In this tutorial you will learn about end-to-end migration steps for Web Dynpro DCs from NWDS 7.0 to NWDS 7.31. This covers all the settings for NWDS 7.31 for smooth migration, SLD import, creating new project, Resolving dependencies, Component migration, Cheat sheet activities, Issues during migration process.

2. Prerequisites

  • NWDS version used to perform migration steps below:
  • Nwds-extsoa-7.3-EHP1-SP10-PAT0003-win32
  • JDK version required: jdk1.6.0_18
  • New Track for 7.31 migration has been created & upgraded.
  • WD DCs & SCs should be imported to new track.
  • Once NWDS 7.31 & JDK configured, set default JDK version to jdk1.6.0_18

  • In Environment Variables, Set JAVA_HOME path to JDK path.

  • In Workspace, check file jdkPreferences is set to correct JDK version & path.

  • Define the SLD path (Windows->Preferences->Development Infrastructure->SLD)

  • Define the Deployment server (portal) details (Windows->Preferences ->SAP AS JAVA)

  • Define R3 destinations for back-end system used (Windows->Preferences ->Destination configuration->R/3 destination)

  • Maintain JCO connections for metadata & model data (Select WD DC->Project->Properties->Web Dynpro->JCO References)


3. Import WD DCs to NWDS 7.31

  • Login to new track and import WebDynpro development components into NWDS 7.31

  • Create Project for all required WD DCs out of new Development track.

  • Migrate project with automatic migration wizard during DC creation.Right click on project->Migrate

4. Resolve Dependencies

  • Open component properties of WD DC and Go to Dependencies

  • The list shows all the required DCs also the deprecated DCs. Remove all deprecated dependencies. Add/Replace alternate dependencies by clicking on deprecated dependency and (CTRL+ALT+1)

     

  • Add/remove DC if not added properly or shows grayed out.
  • Check tc/bl/jco/api (ENGFACADE), tc/je/usermanagement/api (ENGFACADE- if the DC used security/api) added & public part of tc/wd/api has built time dependency

  • Check the error and warning messages.Check if any errors or warnings are repairable by Quick Fix option(Right click on error->Quick Fix->Apply quick fix)
  • Repair project with Project structure & class path
  • Reload project and rebuild. Development component -> Build
  • Check component properties->Dirty DC build status->OK

5.  Migrate models

  • Check R/3 destination has been maintained correctly.
  • Right Click on Model->Migrate to ARFC2 Model. After some time the migration completed window opens as below

  • Repair->Reload
  • Development Component->Build


Error handling under Migrating models:

Error 1: Unhandled exception type ARFC2ModelExecuteException

Fix: In ARFC1, a model object would throw a WDDynamicRFCExecuteException. This exception is no longer used. Instead, the ARFC2ModelExecuteException exception is thrown. Remove WDDynamicRFCExecuteException and Replace it with ARFC2ModelExecuteException as below and Save.


Error 2: The constructor is undefined

Fix: In ARFC2 model type, we need to redefine ARFC2 model declaration

Ex: ValidateModel validatemodel = new ValidateModel ();

    Zrfc_Validate_Input input = new Zrfc_Validate_Input (validatemodel);

6.  Migrating components

  • WD component which still needs to be migrated is displayed in Gray.
  • Right click on WD Component->Migrate Component. It will open the Cheat Sheet Wizard.
  • This helps to monitor all the component migration activities accurately & helps to fix the issues during the process.

7.  Cheat Sheet Activities – listing some important activities

  • Start the component migration with Cheat sheet. It migrate the WD Component parts one by one.
  • View & Window migration: If Conflicting Component & Window name. Change the Window name.
  • Component package check: Select/Create new package. Make sure all your components for the same WD application are on same package. This makes tracking easier.
  • Implement Interface Controller: the declaration of all objects within these interface controllers must be replicated into the component controller. This cheat sheet thus helps you to copy all the relevant objects from interface controller into the component controller

Note: All methods & code in interface controller are copied to Component controller.

  • Once the component migration in finished. Interface controller will only has method signatures.
  • Check implementation relation: Use to find out which objects defined in the interface controller are not implemented within the component controller and if there are any conflicts.
  • Implement interface controller : to automatically copy all relevant objects from the local interface controller to the component controller
  • Refer below the error handling during component migration process.

Note: While running cheat sheet. Before you start migration step. Always close and  reopen your WD project and restart the cheat sheet.

Error Checks during Cheat sheet activities and Component migration process:

Error 1: The type of the attribute in the interface definition is missing

Fix: If the context of the interface controller contains nodes with context mappings to the component controller, this will create implementation errors. So delete the mappings from the context nodes in the interface controller to the component controller.

Error 2: Check Method signatures from Interface controller to component controller are same. It is case sensitive and gives run time error if not maintained correctly. Migration wizard does not perform lower case to upper case conversion.

Error 3:  Check all the context has been mapped correctly. When Context has been mapped manually, check the cardinality has been similarly maintained as per the interface controller node for multiple values.


8. Build & Deploy the NWDS DC.

  • Once the WD Component migrated successfully, Review if any existing build errors.
  • Click on Development Component->Build
  • Fix the errors and Deploy the DC


Error Checks while build:


Error 1: Used Component/component interface is missing

Fix: If you have used component from other DC. Please check used components reference are maintained correctly. Public parts have been added correctly. Used component usage has to be redefined in code. This error comes, when one WD component migrated & the dependent WD component yet to be migrated and missing the reference links as per changed package and other definitions

Also make changes in Public Part -> Manage Entities, if package or component name has been changed.

Error 2: The method is undefined for the type’ etc.

Fix: Once the component usage has been updated, make code changes as per new component Naming convention.

Error 3: Duplicate Methods

Fix: Causes when old reference of used DC has not been deleted and new reference already been created. Delete the Old reference.

Error 4: The project was not built since its build path is incomplete.

Fix: Add the jar file ‘com.sap.mw.jco.jar’ at location: C:\nwds-extsoa-7.3-EHP1-SP10-PAT0003-win32\eclipse.jdi\0\DCs\sap.com\com.sap.mw.jco\_comp\gen\default\public\default\lib\java


9.  Run-time Errors:

There are some errors & exception which only picked up at runtime once application has been deployed and handled on portal.

Few examples are listed below:


Error1: JCO destination initialization failed/RFC_ERROR_SYSTEM_FAILURE

Fix: Check Userid/password used for the application is valid for that application. Check hostname/server is correct


Error2: Exception in triggering the workflow, Please Contact System Administrator com.sap.tc.cm.arfc2.gci.exception.ARFC2ModelRuntimeException: Creation of generic ARFC2 model metadata failed; see nested exception for details.

Fix: We need to maintain at least 2 RFC destinations in NWA for both METADATA & MODEL DATA. Also, whatever JCO Destination names you choose during the model import process, must only be used while creating it on NWA.


Error3: java.lang.NoSuchMethodError:

Fix: NWDS 7.31 does not handle conversion from lower case to upper case. We can check if methods names are similar in component controller and interface controller.

10. References

http://scn.sap.com/docs/DOC-2594

http://help.sap.com/saphelp_nw73/helpdata/en/a7/152df44212453d97abfd5e32917cf6/frameset.htm

10 Comments
Labels in this area