+ All Categories
Home > Documents > How to reference External JAR files in Web Dynpro DC in SAP NW

How to reference External JAR files in Web Dynpro DC in SAP NW

Date post: 03-Feb-2022
Category:
Upload: others
View: 25 times
Download: 0 times
Share this document with a friend
12
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com © 2011 SAP AG 1 How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3 Applies to: SAP NetWeaver Portal 7.3, NWDS 7.3. For more information, visit the Portal and Collaboration homepage . Summary This article describes how to add external JAR files to an External Library DC and reference it in Web Dynpro DC during Compilation and Runtime. Author: Pavithra Upadhya Created on: 10 October 2011 Author Bio Pavithra Upadhya is working as an SAP Enterprise Portal Consultant over the past 6 years.
Transcript
Page 1: How to reference External JAR files in Web Dynpro DC in SAP NW

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 1

How to Reference External JAR

Files in Web Dynpro DC in SAP NW

Portal 7.3

Applies to:

SAP NetWeaver Portal 7.3, NWDS 7.3. For more information, visit the Portal and Collaboration homepage.

Summary

This article describes how to add external JAR files to an External Library DC and reference it in Web Dynpro DC during Compilation and Runtime.

Author: Pavithra Upadhya

Created on: 10 October 2011

Author Bio

Pavithra Upadhya is working as an SAP Enterprise Portal Consultant over the past 6 years.

Page 2: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 2

Table of Contents

Requirement ....................................................................................................................................................... 3

Pre-requisite........................................................................................................................................................ 3

Procedure ........................................................................................................................................................... 3

Create External Library DC ............................................................................................................................. 3

Create Enterprise Application DC and add External Library DC as Used DC ................................................ 5

Create Web Dynpro DC .................................................................................................................................. 8

Related Content ................................................................................................................................................ 11

Disclaimer and Liability Notice .......................................................................................................................... 12

Page 3: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 3

Requirement

This document provides a step-by-step procedure in creating an External Library DC which contains the external JAR files. This External Library DC will then be added as Used DC in Web Dynpro DC.

Pre-requisite

NWDS 7.3, NetWeaver Portal 7.3

Procedure

Create External Library DC

1. Create an External Library DC (say, sample/extlib) as follows:

Page 4: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 4

2. Once the DC is created, navigate to 'Resources' perspective and add the following JAR file to

"libraries" folder of the External Library DC created:

a. jxl.jar

3. Right click on the DC and choose Development Component -> Show In -> Component Properties.

Go to "Public Parts" tab and create 2 Public Parts of type "Compilation" and "Assembly"

4. Right click on the JAR files under libraries folder and select Development Component -> Publish as

File and add to Assembly Public Part. Similarly select Development Component -> Publish as

Archive and add to Compilation Public Part

Page 5: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 5

5. In the "Permissions" tab, select the checkbox 'Entity Forwarding allowed'

6. Build the External Library DC

Create Enterprise Application DC and add External Library DC as Used DC

1. Create an Enterprise Application DC (sample/extlibear) as follows:

Page 6: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 6

2. The DC is now available in Java EE perspective as shown below:

3. Right click on the DC and choose Development Component -> Show In -> Component

Properties. In the "Dependencies" tab, add the Assembly Public Part of External Library DC as used

DC with 'Build Time' dependency for the Public Part extlib_assembly

Page 7: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 7

4. Create Assembly Public Part for the enterprise application DC. Right click on the public parts and

select "Reference Entities" and add the assembly public part of External Library DC

5. In the "Permissions" tab, select the checkbox 'Entity Forwarding allowed'

6. Build and Deploy the Enterprise Application DC

Page 8: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 8

Create Web Dynpro DC

1. Create a Web Dynpro JAVA DC (sample/wd) as follows:

2. The DC is now available in Web Dynpro perspective as shown below:

Page 9: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 9

3. Right click on the DC and choose Development Component -> Show In -> Component

Properties. In the "Dependencies" tab, add the Compilation Public Part of External Library DC and

Assembly Public Part of Enterprise Application DC as used DCs with "Build time" dependency for the

public parts.

4. Build the Web Dynpro JAVA DC

5. In the Component Controller of WebDynpro DC, write the code to download data to excel. The

classes are recognized as shown below:

Page 10: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 10

6. Build and Deploy the Web Dynpro DC

7. On running the Web Dynpro application, the jxl jar is correctly recognized during runtime as well

Page 11: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 11

Related Content

How to use external JAR files in Web Dynpro development components?

How to use external libraries in the SAP component model (PART II)

For more information, visit the Portal and Collaboration homepage

Page 12: How to reference External JAR files in Web Dynpro DC in SAP NW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 12

Disclaimer and Liability Notice

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.


Recommended