sap network blog - team oriented development without remote nwdi in ce 7.1

Upload: imaximus

Post on 07-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    1/19

    Subscribe

    Print

    Permalink

    Blogs

    Team Oriented Development without remote NWDI in

    CE 7.1Srinivasan Subbiah

    Business Card

    Company: HCL Technologies

    Posted on Mar. 21, 2008 01:34 PM in Composition Environment (CE)

    In SAP NetWeaver 7.1 CE, we use the development configurationsto organize the development in a team. The development

    configuration describes the whole development landscape (for example, which software to develop, which software to use, and

    which servers or file systems to connect to), and keeps information that can be used to track if a certain part of the software is not

    up-to-date or has somehow changed.

    From a technical point of view, this is a simple file, which you can easily distribute using e-mail and import into a developer's

    local Developer Studios and, in this way, you can always keep the development environment consistent.

    The choice you have to make is to decide which development scenario to follow:

    1. Standard development - without using the NWDI or following SAP's component principles.There are certain situations in

    which you cannot or do not want to stick to the SAP component model and/or use NWDI. In this case you can:

    Use the Developer Studio as Integrated Development Environment (IDE) and go on with SAP's specific development withoutthe NWDI. This is possible only in SAP NetWeaver 7.1 CE. For example, you can model Visual Composer applications locallywithout NWDI integration and support.

    Choose to develop without following the SAP component model principles. In this development scenario you only use theDeveloper Studio as an IDE.

    2. Development based on the SAP component model, using a remote NWDI installation.

    You can choose to develop following the SAP component model and develop against an SAP NetWeaver 7.0 installation, with

    the full blown NWDI installation and using all NWDI features.Here you have to ensure that the SAP NetWeaver 7.1 CE and the SAP

    NetWeaver 7.0 work together. This development scenario can be very helpful if you already have an SAP NetWeaver 7.0 system

    and also want to work with an SAP NetWeaver 7.1 CE.

    3. Development based on the SAP component model, but without using the NWDI.

    This web log will discuss the third scenario of developing based on the SAP component model but without using the NWDI.

    Development Based on the Component Model without the SAP NetWeaver Development Infrastructure

    Here we are developing using software components and development components, following the principles of SAP's component

    model development, but without a remote NWDI integration.

    Again, there are two options for such development:

    development without a versioning system1.

    development with our own versioning system2.

    Here we will discuss the development without a versioning system.General overview of the development steps without a versioning system

    The steps are:

    1. Create a development configuration from scratch.

    2. Import the development configuration into each SAP NetWeaver Developer Studio in the landscape.

    3. Import the required software components (SCs) and the development components (DCs) contained in the SCs.

    4. Start the development. If needed, you can go on with creating other development configurations. In the Developer Studio, you

    can import many different development configurations at the same time.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    2/19

    As an example let us take the following application. The application is about calculating the bonus an employee gets. One

    service is going to calculate the total annual salary whereas the other service finds 15% of the total annual salary which is the

    bonus.

    For simulating team working you can create two workspaces in your own system so that each of them can be treated as a

    separate user.

    Prerequisites

    i.CE platform is installed.

    ii.Each developer has a IDE installed in the development machines

    Step by Step Approach

    1. Creating Development Configuration from Scratch:

    The development configuration is the one that acts as a framework or as an environment for the team members to work on.

    i.Start the SAP Net Weaver Developer Studio

    ii.Switch to Development Infrastructure perspective by selecting window-->open perspective-->other-->Development

    Infrastructure

    iii.In the Component Browser right click and select new-->Development Configuration.

    iv.Select the option from scratchand specify the name of configuration as TeamEnvironmentand also choose arcpoolas the

    Archive Provider Typein Software Components.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    3/19

    v.Click Finish.

    Now the TeamEnvironmentdevelopment configuration appears in the Component Browser.

    2. Importing the Development Configuration into Developer studio:

    2.1. Transporting the Development Configuration:

    By transporting the development configuration we can transport the entire framework so that we can ensure that everyone is

    working on same environment.

    Exporting

    i. Right click on the TeamEnvironmentand select Export As File.ii. Give a name and save it in a convenient location. Eg. TeamEnvironment.exportin desktop.

    Importing

    i. Follow steps 1.i to 1.iii but with a different workspace. Select the choice from Development Configuration file.

    ii. Browse the address of the TeamEnvironment.export.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    4/19

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    5/19

    v.ClickNext.

    vi. ClickFinish.

    vii. Clickyesfor the popup so that we can shift to Composite Application Perspective.

    2.4. Developing the Application Service:

    Now we will create the application service that actually calculates the annual salary.

    2.4.1. Creating the Application Service

    i. Select salaryservice-->modeled-->New Application Service

    ii. EnterApplication Servicename asAnnualSalary.

    iii. ClickFinish.

    Now as a result the application serviceAnnualSalarygets created and gets displayed under salaryservice. Now configure this

    application service to have an operation which calculates the annual salary of the person.2.4.2. Adding an Operation

    i. Select salaryservice-->modeled-->Application Services-->AnnualSalary(double click).

    ii. In the side window choose Operations

    iii. In Existing Operationstab clickAdd.

    iv. Choose Custom Operationin New Operationswindow.

    v. ClickNext.

    vi. Enter getAnnualSalaryin Name.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    6/19

    vii. Click Finish.

    The operation will be created. Now we have created the method with permission check disabled. We have to set the inputs,

    output and faults for this method.

    2.4.3 Defining input, output and faults to the operation

    i. Select the operation getAnnualSalary.

    ii. Select [TeamEnvironment] caf.core-->faults-->

    Data Types-->Faults-->CAFServiceException

    iii. ClickAdd to Fault.iv. Select [TeamEnvironment] caf.core-->primitive-->

    Data Types-->Simple Types-->LONG

    v. ClickAdd to Input

    vi. Select [TeamEnvironment] caf.core-->primitive-->

    Data Types-->Simple Types-->LONG

    vii. ClickAdd to Output.

    Having formed the frame work of the operation we have to implement the operation.

    2.4.4 Implementing the Operation

    i. Right click on salaryserviceproject in Composite Application Browser.

    ii. Select Save Application.

    iii. Select Generate Application.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    7/19

    iv. Go to Implementationtab ofAnnualSalaryservice.

    v. SelectAnnualSalaryBeanImpl.java

    vi. Implement the following code.

    return inputParameter1*12;

    2.5 Exporting the Software Component:

    We have to transport this Software Component so that we can reuse it wherever we want.

    i. Switch to Development Configurationmode by following the steps from A.i to A.ii.

    ii. Select TeamEnvironment-->Salary.

    iii. Right clickSalary.iv. Select Export.

    v. Select Next.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    8/19

    vi. Take a note of the File Name & Folder namesince we will import from this location only.

    vii. Select Finish.

    viii. You can open the Folder in which the file is stored or choose close.

    This will result in the formation of .sca file. Now we can transport this .sca file anywhere. This .sca file contains all

    the necessary information about the software component and the development components in it.

    2.6 Creating Application in other workspace:

    We will now import the previously exported Software Component into the Development Configuration in the first workspace.

    i. Switch to the previous workspace.

    ii. Switch to Development InfrastructurePerspective.

    iii. Create new Software Component under TeamEnvironmentwith name BonusCalculatorusing steps 2.2(i) to 2.2(vi).

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    9/19

    iv. Create Development Componentfor BonusCalculatorunder the name bonusestimateusing steps 2.3(i) to 2.3(vii).

    v. CreateApplication Servicewith name BonusServiceby following steps 2.4.1(i) to 2.4.1(iii).

    vi. Add method calculateBonususing steps 2.4.2 (i) to 2.4.2 (vi). ClickFinish.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    10/19

    3. Importing required Software Components and contained Development Components:

    3.1 Importing the Software Component: i. Switch to

    Development Infrastructureperspective.

    ii. Right click on TeamEnvironment.

    iii. Select new-->Software Component.

    iv. Enter the same name you have given to the software component you are going to import. Here enter Nameas Salary. Enter

    the data as in figure below.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    11/19

    v. ClickFinish.

    vi. Now right click the software component Salarythat has been created.

    vii. Clickimport.

    viii. In Import Software ComponentWindow for From File (*.sca)give the path of the previous .sca file we created in the

    previous workspace.

    ix. ClickNext.

    x. ClickFinish.

    Now the development components would have been imported to the Salarysoftware component. But we should synchronize

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    12/19

    it with other development components here.

    xi. Select all the 5 development components under the Salary.

    xii. Right click and select Sync/Create Project-->Sync Used DCs.

    xiii. In Sync used DCs window, clickSelect All.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    13/19

    xiv. ClickOk.

    4. Continuing Development:

    4.1. Adding Dependency and Reusing the salaryservice(imported):

    Now we have to create dependency for existing project towards the imported one.

    i. Select BonusCalculatorin Component Browser.

    ii. In Component Propertiestab select Dependencies tab.

    iii. ClickAdd.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    14/19

    iv. CheckSalary [com.hcl]and clickFinish.

    v. Switch to Composite Application perspective.

    vi. Double clickbonusestimateand select Reused Projectstab.

    vii. ClickAdd.

    viii. Select salaryservice/metadataunder SALARY.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    15/19

    ix. ClickFinish.

    x. Reload and save the project by clicking Yes.

    Now finally the imported project becomes visible to the existing project.

    4.2 Using the imported application service methods:

    i. For BonusServiceapplication service, using steps 2.4.4(i) to 2.4.4(v) navigate to implementation of BonusService.

    ii. Implement the following code. Note the usage of the imported service.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    16/19

    4.3. Setting Access Permissions:But before building the application we need to do one more thing. We have visibility for the imported project in the existing one.

    But for building and deploying, the imported project should give accessibility permission for the one that is using it.

    i. Switch to Development Infrastructureperspective.

    ii. Select TeamEnvironment-->Salary-->salaryservice/ear

    iii. Select permissionstab.

    iv. ClickAdd.

    v. CheckBonusCalculatorand clickFinish.

    vi. Select TeamEnvironment-->Salary-->salaryservice/metadata.

    vii. Select permissionstab.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    17/19

    viii. ClickAdd.

    ix. CheckBonusCalculatorand clickFinish.

    x. Select salaryservice/metadataand salaryservice/earand right click.

    xi. Choose sync/create project-->Sync used DCs

    xii. In Sync Used DCswindow, clickSelect Alland then OK.

    4.4 Building and Deploying the Application:

    i. Switch to Composite Application Perspective.

    ii. Right click on [TeamEnvironment]bonusestimate.

    iii. Select Build Applicationand then okin Build DCs window.

    iv. Right click on [TeamEnvironment]bonusestimate.

    v. Select Deploy Application.

    Now you can test your service.

    i. Right click on BonusServiceand choose Test Service.

    5. Results:

    In service browser

    i. Select calculateBonus method.

    ii. Enter some value.

    iii. Select Execute Query.

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    18/19

  • 8/6/2019 SAP Network Blog - Team Oriented Development Without Remote NWDI in CE 7.1

    19/19