This Space has blogs on various topics in the field of SAP. These blogs point out solutions to various technical and functional issues that consultants face during implementation or support of SAP Projects. Readers/followers are welcome to contribute to this space by emailing your content at bohra.mohammadi@gmail.com. You will be rewarded according to the topic/number of words/complexity of the topic/issue which are you addressing in your blog.
Sunday, June 26
Introduction to SAP NetWeaver Enterprise Portal
In this post, we address what ancha enterprise portal is and how it differs from an
ordinary website. We then discuss the business benefits involved in implementing
an enterprise portal. In the next post, as part of the introduction, we deal with the
SAP NetWeaver Portal in particular and analyze the various components that constitute
the portal.
We also look at the SAP NetWeaver technology stack and analyze the role of the SAP
NetWeaver Portal in the stack. We then address some of the benefits of using the portal,
such as navigating intuitively, drag and relate functionality, branding and personalization,
integration using iViews, role-based personalization, securing the portal, single sign-on, and
ready-made implementation of content using business packages.
Another important component of the SAP NetWeaver Portal is the Knowledge
Management (KM) component that is used for integrating unstructured content. This is
accomplished using two major components—namely, Content Management and TREX.
Knowledge Management provides functionality such as discussion forums, content
workflow, and classification. Sitting on top of KM is the collaboration functionality of
the portal, which provides functionality such as the collaboration room, the Collaboration
Launch Pad, real-time collaboration, and third-party integration.
Why SAP NetWeaver Portal?
One of the first few questions that needs to be answered during a portal implementation is
how do we stand to benefit by implementing a portal? Is it really important to use a portal,
or is it something that can be avoided? A portal provides a means by which we can improve
the business efficiency of a process. For example, by implementing a portal, a company can
provide the right information to the right person at the right time. Based on this information,
the person can make a decision that is not only correct, but also quick.
By implementing an enterprise portal, you can provide the right information in the right
format to the right person at the right time.
The portal provides the required information in one place. Not only does the portal
increase the productivity of an employee, it also reduces the turnaround time of a given
business process. By implementing a portal, a customer service representative can quickly
attend to customer complaints, or a sales representative can place an order at a customer
site and answer customer inquiries regarding pricing. related post :
What Is an Enterprise Portal ?
SAP EP Connecting to SAP Backend systems
SAP Enterprise portal is a single point of access to enterprise wide information. This information can reside in various types of databases and various type of systems. SAP EP does not generate data on its own. It simply displays data which it fetches from various backend systems. How does it do so? How does it fetch data. There has to be some connection established. This connection is called JCO, the Java Connector.
In case you want to fetch only transaction data, you need not use JCOs. Systems objects would be enough for fetching transaction data.
When you have a portal component, none of the above mentioned connectors will be useful. You will have to use connector using SAP Connector Framework which is based on JCA. These three connection types in detail are written below.
Transaction Data:
So for transaction data, you have to create a system object on SAP EP. For this, go to system admin->system configuration. Right Click on a folder and say create system. Enter all mandatory parameters needed to create a system, its host name, port number etc. Enter system alias. Alias is the name by which system is identified when transports are done. Once you enter system alias and mandatory parameters, you are done. This system object which you just created can help you getch transaction data in SAP enterprise portal.
RFC or BAPI data in WDJ application:
For this you have to create JCO. In SAP Enterprise portal, screens are provided to create and maintain JCO. There is nothing much to explain here as the screen for creating and maintenance of JCO is self explanatory. You can go web dynpro console on sap ep and say create a JCO destination. You will need to provide system object name and user ID and password to logon to that system.
SAP Connector Framework using JCA:
Here we use connector based on JCA. This is one of the most important connections to the backend as it connects a portal component to backend. JCA code is available on the sap help portal. Copy the code from there. Create a system object in SAP EP and configure a Alias for it. Then you need to provide this Alias in the JCA code which you copied from the sap help portal.
In the process of establishing connection, JCA hands over the control to system object which is identifies in the code. System object in turn fetches data from the backend and the control is again transferred to JCA.
Two important things to be noted here are system Alias and user mapping. When a system is transported to another environment in the landscape, its user mapping and alias have to transported along with it manually. If this is not done, none of the connections using that system would work.
Instant start to Netweaver portal administration
This post will provide you a basic and instant start to Netweaver portal administration. Definitions of the most important things that you much know for portal administration are covered in this post.
Usage Types
Before I tell you what are usage types, I must tell you that usage types made a SAP Portal administrator's life easy. Usage types were introduced when SAP Came up with SAP Netweaver Portal 7.0.
Usage types of SAP NetWeaver are software units to be installed. The usage types Application Server ABAP and Application Server Java are used as a foundation for other units. You can select one or more usage types during NetWeaver installation.
SLD
If you are a portal administrator you must know how to configure SLD. This can be done manually also and there is an automated way of doing this. You can chose one depending on your situation and requirements.
The SLD configuration is included in the AS Java installation. In some cases, the SLD configuration has to be changed. Below are main steps to be followed while changing the SLD Configuration.
- Specify the Groups and Users That Can Operate in the SLD
- Specify Where to Persist the SLD Information and Who Can Alter It
- Fine Tuning the SLD Server
- Initial Import of the SAP CIM model or the CR Content
- Configuring the Channel for Receiving SLD Reports
JCO
JCO or the Java Connectors connect SAP EP applications to SAP R/3 systems. So basically they fetch data and functionality from the SAP systems to be used and displayed in SAP EP or in applications which are used by SAP EP. For example, SAP Web Dynpro Java applications can talk with the SAP systems using JCO. As a portal administrator, you must know how to created, edit, check and activate a JCO. How to delete a JCO, how to troubleshoot a JCO in case of errors in connection.
Properties of Iview, workset and roles
Various properties of Iviews, worksets, roles are a must to know. This is important when administrator is asked to create/modify these PCD objects. Based on various business requirements, portal administrator may have to change the properties at runtime or design time and achieve what is needed.
Admin Tools
Various tools like Visual admin, Config tool and offline config editor are must.
SSO and System Configurations
Single Sign On means that portal user will have to punch in his/her username and passord only once and after that he/she will not be asked for login credentials no matter which system he/she tries to access through portal. This feature of SAP Netweaver portal helps you a lot by providing you the freedom to forget passwords. SAP EP connects to various backend SAP systems on your behalf. It is very important topic to be known by a portal administrator. Frequently asked in interview questions. How to create a SSO. How to change SSO settings etc etc...
Labels:
admin tools,
default sap roles,
iviews,
Jco,
portal administrator,
portal solutions,
sap enterprise portal tutorial,
sap enterptise portal,
single sign on,
SLD,
Usage Types,
worksets
Monday, June 13
Connecting SAP EP to a SQL database
This post will explain the procedure of connecting SAP EP to a SQL database.
Create a portal project. Create a portal component of type abstractportalComponent in the project. Add few external Jar files in the portal project. These external jar files will be needed while writing some code for the connection. The Jar Files to be added in the project build path are :
j2eeclient/activation.jar
j2eeclient/connector.jar
portalapps/com.sap.portal.ivs.connectorserviceapi.jar
other/genericConnector.jar
j2eeclient/jta.jar
The Code to open a connection is written below
public class JDBC extends AbstractPortalComponent {
public void doContent(
IPortalComponentRequest request,
IPortalComponentResponse response) {
// Open a connection
IConnectorGatewayService cgService =
(IConnectorGatewayService) PortalRuntime
.getRuntimeResources()
.getService(
IConnectorService.KEY);
ConnectionProperties prop =
new ConnectionProperties(request.getLocale(), request.getUser());
IConnection client = null;
try {
client = cgService.getConnection("myDB", prop);
} catch (Exception e) {
response.write(e.toString());
return;
}
try {
// Issue SQL Query statement
INativeQuery query = client.newNativeQuery();
String queryStr =
"SELECT name, address, zip FROM hotel.hotel";
Object result = query.execute(queryStr);
// Iterate returned result
ResultSetMetaData recordMetaData =
((ResultSet) result).getMetaData();
int colNum = recordMetaData.getColumnCount();
//result.beforeFirst();
response.write("<table border=1>");
while (((ResultSet) result).next()) {
response.write("<tr>");
for (int i = 1; i <= colNum; i++) {
response.write("<td>" + ((ResultSet) result).getString(i)+ "</td
}
}
// Close the connection
client.close();
} catch (QueryExecutionException e) {
response.write(e.toString());
} catch (CapabilityNotSupportedException e) {
response.write(e.toString());
} catch (ConnectorException e) {
response.write(e.toString());
} catch (InvalidQueryStringException e) {
response.write(e.toString());
} catch (ResourceException e) {
response.write(e.toString());
} catch (SQLException e) {
response.write(e.toString());
} catch (Exception e) {
response.write(e.toString());
}
}
}
After writing this code, if error occur, right click in the editor and say organize imports. Make sure that you have service reference in the <application-config> tag.
<application-config> <property name="ServicesReference" value="com.sap.portal.ivs.connectorservice"/> </application-config>
Then upload the PAR file.
Thats it. The portal application you created above is ready to be tested. Now by merely changing the query you wrote i nthe above code to fetch data from the hotel table can be changed to fetch data from any other database table as well.
Create a portal project. Create a portal component of type abstractportalComponent in the project. Add few external Jar files in the portal project. These external jar files will be needed while writing some code for the connection. The Jar Files to be added in the project build path are :
j2eeclient/activation.jar
j2eeclient/connector.jar
portalapps/com.sap.portal.ivs.connectorserviceapi.jar
other/genericConnector.jar
j2eeclient/jta.jar
The Code to open a connection is written below
public class JDBC extends AbstractPortalComponent {
public void doContent(
IPortalComponentRequest request,
IPortalComponentResponse response) {
// Open a connection
IConnectorGatewayService cgService =
(IConnectorGatewayService) PortalRuntime
.getRuntimeResources()
.getService(
IConnectorService.KEY);
ConnectionProperties prop =
new ConnectionProperties(request.getLocale(), request.getUser());
IConnection client = null;
try {
client = cgService.getConnection("myDB", prop);
} catch (Exception e) {
response.write(e.toString());
return;
}
try {
// Issue SQL Query statement
INativeQuery query = client.newNativeQuery();
String queryStr =
"SELECT name, address, zip FROM hotel.hotel";
Object result = query.execute(queryStr);
// Iterate returned result
ResultSetMetaData recordMetaData =
((ResultSet) result).getMetaData();
int colNum = recordMetaData.getColumnCount();
//result.beforeFirst();
response.write("<table border=1>");
while (((ResultSet) result).next()) {
response.write("<tr>");
for (int i = 1; i <= colNum; i++) {
response.write("<td>" + ((ResultSet) result).getString(i)+ "</td
}
}
// Close the connection
client.close();
} catch (QueryExecutionException e) {
response.write(e.toString());
} catch (CapabilityNotSupportedException e) {
response.write(e.toString());
} catch (ConnectorException e) {
response.write(e.toString());
} catch (InvalidQueryStringException e) {
response.write(e.toString());
} catch (ResourceException e) {
response.write(e.toString());
} catch (SQLException e) {
response.write(e.toString());
} catch (Exception e) {
response.write(e.toString());
}
}
}
After writing this code, if error occur, right click in the editor and say organize imports. Make sure that you have service reference in the <application-config> tag.
<application-config> <property name="ServicesReference" value="com.sap.portal.ivs.connectorservice"/> </application-config>
Then upload the PAR file.
Thats it. The portal application you created above is ready to be tested. Now by merely changing the query you wrote i nthe above code to fetch data from the hotel table can be changed to fetch data from any other database table as well.
Labels:
connnector framework,
learn sap ep online,
portal connector framework,
sap jobs,
SQL database
Sunday, June 12
Methods of IUserFactory API and Iuser API
There are various tasks which can be perfomed by using the IUSERFACTORY API of the UME(user management engine).
Instantiate user objects
Create New Users
Delete existing users
search users
and perform mass commit/rollback operations on a set of users
Access to the users factory is possible by using the following lines of code
import com.sap.security.api.*
IUserfactory userfact = Umfactory.getUserfactory();
You can obtain a user object by using the userfactory provided you know the logon ID or the Unique ID of the user.
getUserFactory.getUser(String UniqueID);
getUserFactory.getUserbyLogonID(String LogonID);
If you want to get user and prepopulate specific attributes, use the following method
getUserFactory.getUser(String UniqueID, AttributeList AttrList);
Most of the information needed for processing in a web dynpro java application is present in the IUser Object. Information about the name of the user, their unique ID, LDAP attributes, display name, role membership, etc are available from the IUser object.It is also possible to edit the corresponding profile data with the interface IUserMaint.
Obtaining information about the current User
The user associated with current portal request can be obtained by using getUser() methos in the IPortalComponentRequest Object.
IPortalComponentRequest request = .... ;
IUser user = request.getUser();
String Username = user.getDisplayName();
String depname = user.getDepartment();
Obtaining Information about another User
You can access any user by using the getuserbyLogonID() provided you have the logon ID of the desired user
An Exception would occur if the user does not exist
String uid = "demouser";
try
{
Iuser user = UmFactory.getuserFactory().getUserbyLogonID(uid);
String username = user.getDisplayName();
}
cartch(UME Exception e)
{
wdComponentAPI.getMessagemanager.reportexception(e.getlocalizedmessage, false);
}
The above lines of code also are applicable if you know the unique ID of the user whose information is required. Instead of method getUserbyLogonID(), use getUserbyUniqueID().
Searching for Users
steps are :
create a search filter from the userfactory.
set the search attributes for the search.
invoke the search
iterate thourgh the results
The result of the search is of type ISearchResult and returns an iterator containing the UniqueIDs of the principals returned.
The SearchReult also contain the state of the search.
Search_Result_Incomplete
Search_Result_OK
Search_Result_UNDEFINED
Search_Result_EXCEEDED
TIME_LIMIT_EXCEEDED
IUserFActory userfact = UMFactory.getUserFactory();
IUserSearchFilter userfilt = userfact.getUserSearchFilter();
userfilt.setLastName("bohra*");
ISearchResult result = userfact.SearchUsers(userfilt);
if (result.getState() == ISearchResult.SEARCH_RESULT_OK)
{
while(result.hasNext())
{
String uniqID = (string) result.next();
IUser thisuser = userfact.getuser(uniqID);
}
}
else
{
// print error or warning.
}
}
Instantiate user objects
Create New Users
Delete existing users
search users
and perform mass commit/rollback operations on a set of users
Access to the users factory is possible by using the following lines of code
import com.sap.security.api.*
IUserfactory userfact = Umfactory.getUserfactory();
You can obtain a user object by using the userfactory provided you know the logon ID or the Unique ID of the user.
getUserFactory.getUser(String UniqueID);
getUserFactory.getUserbyLogonID(String LogonID);
If you want to get user and prepopulate specific attributes, use the following method
getUserFactory.getUser(String UniqueID, AttributeList AttrList);
Most of the information needed for processing in a web dynpro java application is present in the IUser Object. Information about the name of the user, their unique ID, LDAP attributes, display name, role membership, etc are available from the IUser object.It is also possible to edit the corresponding profile data with the interface IUserMaint.
Obtaining information about the current User
The user associated with current portal request can be obtained by using getUser() methos in the IPortalComponentRequest Object.
IPortalComponentRequest request = .... ;
IUser user = request.getUser();
String Username = user.getDisplayName();
String depname = user.getDepartment();
Obtaining Information about another User
You can access any user by using the getuserbyLogonID() provided you have the logon ID of the desired user
An Exception would occur if the user does not exist
String uid = "demouser";
try
{
Iuser user = UmFactory.getuserFactory().getUserbyLogonID(uid);
String username = user.getDisplayName();
}
cartch(UME Exception e)
{
wdComponentAPI.getMessagemanager.reportexception(e.getlocalizedmessage, false);
}
The above lines of code also are applicable if you know the unique ID of the user whose information is required. Instead of method getUserbyLogonID(), use getUserbyUniqueID().
Searching for Users
steps are :
create a search filter from the userfactory.
set the search attributes for the search.
invoke the search
iterate thourgh the results
The result of the search is of type ISearchResult and returns an iterator containing the UniqueIDs of the principals returned.
The SearchReult also contain the state of the search.
Search_Result_Incomplete
Search_Result_OK
Search_Result_UNDEFINED
Search_Result_EXCEEDED
TIME_LIMIT_EXCEEDED
IUserFActory userfact = UMFactory.getUserFactory();
IUserSearchFilter userfilt = userfact.getUserSearchFilter();
userfilt.setLastName("bohra*");
ISearchResult result = userfact.SearchUsers(userfilt);
if (result.getState() == ISearchResult.SEARCH_RESULT_OK)
{
while(result.hasNext())
{
String uniqID = (string) result.next();
IUser thisuser = userfact.getuser(uniqID);
}
}
else
{
// print error or warning.
}
}
Labels:
Iuserfactory,
sap iusersearchfilter,
sap userfactory,
userfactory,
userfactory api,
userfactory getuser,
userfactory sap
Subscribe to:
Posts (Atom)