Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

  In SAP NetWeaver 7.1 CE, we use the development configurations to 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 without the NWDI. This is possible only in SAP NetWeaver 7.1 CE. For example, you can model Visual Composer applications locally without NWDI integration and support.
  • Choose to develop without following the SAP component model principles. In this development scenario you only use the Developer 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:

  1.  development without a versioning system
  2.  development with our own versioning system

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.

 

    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 scratch and specify the name of configuration as TeamEnvironment and also choose arcpool as the Archive Provider Type in Software Components.

     v.Click Finish.

        Now the TeamEnvironment development 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 TeamEnvironment and select Export As File.
     ii. Give a name and save it in a convenient location. Eg. TeamEnvironment.export in 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.

 


    iii. Select next.
    iv. Select Finish.
    As a consequence the TeamEnvironment development configuration appears in the Component Browser of the second IDE.

  2.2. Creating Software Component:
    Now let us create a software component in the second IDE.
    i.  Right click on the TeamEnvironment development configuration.
    ii. Select new-->software component
    iii. Enter Salary as Name and enter some legal Vendor name.
    iv. Select Source SC.
    v.  Select Next

    vi. Select Finish.

    Now if we open the TeamEnvironment Development Configuration in the drop down we can see the new software component added.

  2.3. Creating the Development Component:
     Now we will create development components that will generate the annual salaryof the person.
    i. Right click on the software component Salary.
    ii. Select new-->Develop component-->Composite application.
    iii. Click next.
    iv. Enter salaryservice as Name.

 

    v.Click Next.
    vi. Click Finish.
    vii. Click yes for 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. Enter Application Service name as AnnualSalary.
      iii. Click Finish.
      Now as a result the application service AnnualSalary gets 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 Operations tab click Add.
      iv. Choose Custom Operation in New Operations window.
      v. Click Next.
      vi. Enter getAnnualSalary in Name.

 

      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. Click Add to Fault.
      iv. Select [TeamEnvironment] caf.core-->primitive-->
Data Types-->Simple Types-->LONG

      v. Click Add to Input
      vi. Select [TeamEnvironment] caf.core-->primitive-->
Data Types-->Simple Types-->LONG

      vii. Click Add 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 salaryservice project in Composite Application Browser.
      ii. Select Save Application.
      iii. Select Generate Application.

 

      iv. Go to Implementation tab of AnnualSalary service.
       v. Select AnnualSalaryBeanImpl.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 Configuration mode by following the steps from A.i to A.ii.
    ii. Select TeamEnvironment-->Salary.
    iii. Right click Salary.
    iv. Select Export.
    v. Select Next.

 

    vi. Take a note of the File Name & Folder name since 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 Infrastructure Perspective.
    iii. Create new Software Component under TeamEnvironment with name BonusCalculator using steps 2.2(i) to 2.2(vi).

    iv. Create Development Component for BonusCalculator under the name bonusestimate using steps 2.3(i) to 2.3(vii).
    v. Create Application Service with name BonusService by following steps 2.4.1(i) to 2.4.1(iii).

    vi. Add method calculateBonus using steps 2.4.2 (i) to 2.4.2 (vi). Click Finish.

 

3. Importing required Software Components and contained Development Components:

 3.1 Importing the Software Component:                                                                                           i. Switch to Development Infrastructure perspective.
    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 Name as Salary. Enter the data as in figure below.



    v. Click Finish.
    vi. Now right click the software component Salary that has been created.
    vii. Click import.
    viii. In Import Software Component Window for From File (*.sca) give the path of the previous .sca file we created in the previous workspace.

    ix. Click Next.
    x. Click Finish.
    Now the development components would have been imported to the Salary software component. But we should synchronize 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, click Select All.

    xiv. Click Ok.

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 BonusCalculator in Component Browser.
    ii. In Component Properties tab select Dependencies tab.
    iii. Click Add.

    iv. Check Salary [com.hcl] and click Finish.
    v. Switch to Composite Application perspective.
    vi. Double click bonusestimate and select Reused Projects tab.
    vii. Click Add.
    viii. Select salaryservice/metadata under SALARY.

    ix. Click Finish.
    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 BonusService application 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.

  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 Infrastructure perspective.
    ii. Select TeamEnvironment-->Salary-->salaryservice/ear
    iii. Select permissions tab.
    iv. Click Add.

    v. Check BonusCalculator and click Finish.
    vi. Select TeamEnvironment-->Salary-->salaryservice/metadata.
    vii. Select permissions tab.
    viii. Click Add.
    ix. Check BonusCalculator and click Finish.
    x. Select salaryservice/metadata and salaryservice/ear and right click.
    xi. Choose sync/create project-->Sync used DCs

    xii. In Sync Used DCs window, click Select All and then OK.

  4.4 Building and Deploying the Application:

    i. Switch to Composite Application Perspective.
    ii. Right click on [TeamEnvironment]bonusestimate.
    iii. Select Build Application and then ok in Build DCs window.
    iv. Right click on [TeamEnvironment]bonusestimate.
    v. Select Deploy Application.

    Now you can test your service.
    i. Right click on BonusService and choose Test Service.

5. Results:

     In service browser
    i. Select calculateBonus method.
    ii. Enter some value.
    iii. Select Execute Query.


 

Finally the bonus will be calculated.

1 Comment