Bi Beans session connect method and JWS gives accesscontrolexception
Hi,
I have folowing code for connecting to Bi session and am trying to load my application using java web start technology. When I try to run the code from Jdeveloper it works fine but when trying to run from java web start gives following error.
Error:
Exception occurred during event dispatching:
java.security.AccessControlException: access denied (java.util.PropertyPermission apple.awt.showGrowBox read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at oracle.bali.ewt.elaf.basic.BasicLookAndFeel$2.createValue(Unknown Source)
at javax.swing.UIDefaults.getFromHashtable(Unknown Source)
at javax.swing.UIDefaults.get(Unknown Source)
at javax.swing.MultiUIDefaults.get(Unknown Source)
at javax.swing.UIDefaults.getInsets(Unknown Source)
at javax.swing.UIManager.getInsets(Unknown Source)
at oracle.bali.ewt.button.DialogBarLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at javax.swing.JRootPane$RootLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.awt.BorderLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at oracle.bali.ewt.dialog.JEWTDialog.getPreferredSize(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at oracle.bali.ewt.dialog.JEWTDialog.pack(Unknown Source)
at oracle.bali.ewt.dialog.JEWTDialog.runDialog(Unknown Source)
at oracle.dss.util.gui.BIExceptionDialog.display(BIExceptionDialog.java:199)
at gecf.pmg.PmgBiOlapApp.showExceptionDialog(PmgBiOlapApp.java:2560)
at gecf.pmg.PmgBiOlapApp.connect(PmgBiOlapApp.java:2823)
at gecf.pmg.PmgBiOlapApp$39.actionPerformed(PmgBiOlapApp.java:2886)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener$ReleasedAction.actionPerformed(Unknown Source)
at javax.swing.JComponent$ActionStandin.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Code:
//1. create session
m_biSession = new BISession();
m_biSession.setBIUser(new BIUser(userName));
m_biSession.setDeploymentOption("LOCAL");
m_biSession.setProperty("Mode","ERROR");
DefaultErrorHandler m_handler = new DefaultErrorHandler();
m_handler.setDebugMode(DefaultErrorHandler.SHOW_ERROR);
m_biSession.addErrorHandler(m_handler);
//2.
m_connection = new Connection();
DefaultErrorHandler o_handler = new DefaultErrorHandler();
o_handler.setDebugMode(DefaultErrorHandler.SHOW_ERROR);
m_connection.addErrorHandler(o_handler);
m_connection.setSession(m_biSession);
m_connection.setDriverType("MDM");
m_connection.setServerType("OLAPServer");
m_connection.setJdbcDriverType("thin");
m_connection.setHostName(m_hostName);
m_connection.setPortNumber(Integer.parseInt(m_port));
m_connection.setSID(m_olapSid);
m_connection.setUsername(userName);
m_connection.setPassword(password);
//3.
p_connection = new Connection();
DefaultErrorHandler p_handler = new DefaultErrorHandler();
p_handler.setDebugMode(DefaultErrorHandler.SHOW_ERROR);
p_connection.addErrorHandler(p_handler);
p_connection.setSession(m_biSession);
p_connection.setDriverType(MDU.PERSISTENCE);
p_connection.setJdbcDriverType("thin");
p_connection.setHostName(m_hostName);
p_connection.setPortNumber(Integer.parseInt(m_port));
p_connection.setUsername("CATLOGADMIN");
p_connection.setPassword("CATLOGADMINPWD");
p_connection.setSID(m_catSid);
p_connection.setProperty(PSRConstants.STORAGEMANAGER_DRIVER, "oracle.dss.persistence.storagemanager.bi.BIStorageManagerImpl",1,1);
//4.
m_metadataManager = new MetadataManager();
DefaultErrorHandler md_handler = new DefaultErrorHandler();
md_handler.setDebugMode(DefaultErrorHandler.SHOW_ERROR);
m_metadataManager.addErrorHandler(md_handler);
m_metadataManager.setSession(m_biSession);
m_metadataManager.setConnection(p_connection);
m_metadataManager.setConnection(m_connection);
try{
m_biSession.connect();
}catch (Exception e)
System.out.println("error connecting to bisession");
e.printStackTrace();
m_metadataManager.attach();
It is giving me the error at "m_biSession.connect();" line.
Please help asap.
Thanks and Regards,
Ujwala
Did you follow the points outlined in the Release Notes:
http://www.oracle.com/technology/products/bib/htdocs/904/readme_bibeans.html#webstart
Hope this helps
Business Intelligence Beans Product Management Team
Oracle Corporation
Similar Messages
-
NEW SESSION - Firefox, IE and GLASSFISH
Hi all,
Here is my issue:
I have One application on Glassfish using EJB3,JPA and JSF.
Users can log to this application and have severals sessions opened simultanoulsy as each session is having a connection to its own database
How do I force a new session (particularly in Firefox as IE<=8 has no issue) and have the user using the same application but different databases in different tabs or windows of Firefox.
I tried almost all and get blocked
Many thanks in advance for your answers
NicogHi BalusC
Great Blog by the way...
Let me explain.
My architecture is as follows: using JSF, Glassfish and ...SQL Server!! (! i know but this is mandatory requirement as our application is full web version of an existing ERP application already sold and installed by more than 1000 of our customers...
I am using
JSF-->JSF Managed Bean (Session for some and Request for almost all when logged )-->EJB Interface-->EJB Impl-->Entity-->Database
I have a persistence Unit (using JTA and CMP) per database , each using a connection pool managed by Glassfish.
At the begining of my application, the user (when logging), choose a database, ...enter logging info and connect.
All databases have the schema but not the same data
You have to see in our case, a database as a company with particular configuration, customers, orders, invoices, contacts....
Our application is ERP that our customers uses to managed several companies simultanously .
Also, I need Session Scope as there is configuration data that I need to keep over all pages.
This configuration data is depending on the database connected to.
When selecting the database (company) for combo in logging form, The only way I found is fisrt to check is database(company) exists and can be connect to using at first begining Persistence.CreateEntityMangerFactory.. (i know that this is not J2EE and CMP but merly used in Java SE environments..).
This step is only used for checking database
Then, if creation did not generate a Persistence Exception , I can the use CMP and an EnityManger in EJB by JNDI lookup (as DI is not possible because you need constant in unitName)
ex :
@PersistenceContexts({
@PersistenceContext(name="pu/SOCIETE1", unitName="SOCIETE1"),
@PersistenceContext(name="pu/SOCIETE2", unitName="SOCIETE2"),
@PersistenceContext(name="pu/SOCIETE3", unitName="SOCIETE3"),
@PersistenceContext(name="pu/SOCIETE4", unitName="SOCIETE4"),
@PersistenceContext(name="pu/SOCIETE5", unitName="SOCIETE5"),
@PersistenceContext(name="pu/GENESYS_EXEMPLE", unitName="GENESYS_EXEMPLE")
@Stateless
public class SomeEJB extends CommonEjbImpl implements SomeEJBLocal {
private EntityManager em;
@PostConstruct
public void init() {
String puName = (String) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("database"));
em = (EntityManager) new InitialContext().lookup("java:comp/env/pu/"+puName);
@PreDestroy
public void cleanup() {
if (em != null && em.isOpen()) {
em.close();
}All works perfectly under IE6,IE7 and IE8 (forcing some parameter at launch of IE8).
But due to session management of Firefox (sharing session cookie among all exe or tabs)...session data is kept when opening a new tab.
What I did to avoid confilcts, is to clear FacesContext SessionMap when redirecting to Login page ...but i still can NOT log to multiple PU simultanously....
I do not see where DAO pattern could help me ...
Am I missing something here?
Many thanks in advance for your quick answer
Regards,
Nicog -
Questions about the new SBO2007 connection method
Hi all
Anyone who can clear up the following programs for me:
1 - With the new DI connection method multible add-ons can share the same DI-API connection (1 add-on = 80 MB, 2 add-ons = 81.5 MB and so on). But is this sharing user-specific or machine specific... Imagine 10 user on a terminal server all running only one add-on. Will those 10 instances of the same add-on share DI-API connections and in total use 93.5MB (80 + 91.5) or 800MB (1080)?
2 - Am I correct in assuming that the new connection method works when creating internal add-ons (running within the SBO client) or will external add-ons benefit in any way?
3 - Does the SAP add-ons allready use the new connection system?
4 - In the explaination of the new DI connect method the help file states "It is highly recommended to use XML format of the DI-API.".. What does this mean?... The connection itself does not seem to have any xml involved.Hi Rasmus,
I haven't seen any official test results but here's what we have found so far:
1) The shared DI API resource is stored within the SAP Business One client executable. This means that this grows by 80MB during the first connection but stays the same size as other addons connect. The addons themselves typically now take up 10-15MB (ie like an addon that only uses the UI API). On a Citrix or Terminal Server, as each user has their own SBO executable, the DI API connection will take 80MB+ per user session (assuming all addons are connecting using this new method).
2) As far as I know, this new connection method is only available for applications that use the UI API to connect to the SBO client (the GetDICompany method is on the UI API company object and not part of the DI API).
3) The SAP Fixed Assets and Outlook Integration addons do not use the new connection method (tested on patch 35). The rest I don't know about as we don't typically use them here in NZ. It would be really useful for SAP to make an official statement on this topic as it would definitely influence my decisions on using the new method.
4) I'm not sure what they mean either :-\
The biggest problem I found with this new connection method is debugging. When writing an addon, each time I ran a new debug session, the SBO client executable would grow by 70-80MB as it created a new DI API connection. However, when the debug session ended, the SBO executable did not release the memory used. After 4-5 debug sessions, the SBO client was taking 1/2GB of memory and couldn't be closed. This meant I had to close and reopen SBO every 2-3 debug sessions, which was a bit of a pain. In the end I reverted to writing using the old connection method and changed it over as a last step. Not sure if I was doing something wrong or this is a weakness in the new connection method while developing.
I also read that SAP are advising that a shared DI API connection can lower performance in some cases.
Kind Regards,
Owen -
Connection Pool and Database Sessions
Hi,
Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?
Thanks,
VinodHi,
Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?Hi Vinod,
Yes, TopLink allows you to use the app server's connection pooling and transaction services. Chapter 2 of the Oracle9iAS TopLink Foundation Library Guide provides details as do the TopLink examples. The easiest way to set this up is by using the sessions.xml file. The sample XML below is from the file <toplink903>\examples\ias\examples\ejb\sessionbean\sessions.xml. Here we are adding the datasource defined in OC4J and specifying that we are using the OC4J transaction controller also.
<login>
<user-name>sa</user-name>
<password></password>
<datasource>java:comp/env/jdbc/ejbJTSDataSource</datasource>
<uses-external-transaction-controller>true</uses-external-transaction-controller>
<uses-external-connection-pool>true</uses-external-connection-pool>
</login>
<external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
When using this approach you need to change your TopLink code slightly in the EJB methods:
a. Acquire the ACTIVE unit of work from the server
session (again, see the EmployeeSessionEJB code
example) with something like:
UnitOfWork uow = clientSession.getActiveUnitOfWork();
b. Calls to uow.commit() can be ommitted or commented out
because the EJB will handle this. Note that of course
the methods you create in the EJB that are using this
approach must have TX Required (default).
Hope this helps.
Pete -
Relation between RD Connection broker and RD session host farm in 2012 R2
Good Day
I have configured standard RDS session based deployment recently on 2012 R2 servers
Everything is working as expected
The setup has TWO RD Session host, 1 Session Broker, one RD Web access and one RD Gateway
I have created 2 DNS records named Rdsfarm.domain.com for my RDS1 and RDS2 session host servers and if I connect to this
rdsfarm.domain.com with RDP from TS clients, i am able to connect to any one of TWO rds servers without any problem
However some part is not clear to me
I have not added rdsfarm.domain.com any where except my RD Gateway server RAP policy
Also I have added my RD Broker server in RAP allowed group above.
I don't see any config where this farm name is associated with my RD Broker server
I have tried to connect to RD broker server from client, but it didn't redirect me to RD session host servers
If I try to connect to my RDS servers with their FQDN , it gives me error that I must connect thru farm name
Can you please help me to understand relation between RD session host servers farm and RD broker server ?
Also I would like to know what exactly happens in background when user start RDP session by entering RDS farm name
Note that RDS farm name is generic DNS Host(A) record pointing to my both RD session host servers
I wanted to know is there any command or configuration I missed out as I don't see any config where Generic RD Session Host Farm name (DNS Host(A) record) is associated with my RD Broker server ?
Thanks
Best Regards
MaheshHi,
If you are opening Remote Desktop Connection and manually connecting to the broker then it will not work properly because you have no way of specifying the target collection in the user interface. If manually using the RD Client to connect is a requirement
what you can do is set the default collection in the RD Connection Broker server's registry.
To specify the default collection, please create the registry setting below in the broker's registry:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\ClusterSettings
DefaultTsvUrl REG_SZ tsv://vmresource.1.<VDI pool ID>
To determine the correct value for DefaultTsvUrl please open RDWeb in a non-IE web browser and click on the icon for the collection you would like to be the default, then edit the downloaded rdp file with Notepad and copy the portion of the loadbalanceinfo
setting that is similar to the above.
An alternative would be to download the .rdp file from RD Web Access and double-click it to connect.
As I mentioned above it is generally intended to have users connect via RD Web Access or RemoteApp and Desktop Connections feed or Remote Resources (uses the feed) so that the client will obtain the proper .rdp file from the server.
To configure the FQDN that is published in the .rdp files you can use the cmdlet below:
Change published FQDN for Server 2012 or 2012 R2 RDS Deployment
http://gallery.technet.microsoft.com/Change-published-FQDN-for-2a029b80
Below is a sample configuration based on what you have written:
1. Published FQDN (using cmdlet above): rdsfarm.domain.com --> points to ip address of RDCB server. When launching a RemoteApp or Full Desktop connection from RD Web Access, the prompt window will show this FQDN next to Remote computer.
2. Gateway FQDN: gateway.domain.com --> externally points to public ip address of your RD Gateway server. TCP port 443 and UDP port 3391 need to be forwarded to the RDG's internal ip address. When launching a RemoteApp or Full Desktop
connection from RD Web Access, the prompt window will show this FQDN next to Gateway server. This FQDN is set in Server Manager -- RDS -- Overview -- Deployment Properties -- RD Gateway tab.
In RD Gateway Manager -- Properties of RD RAP -- Network Resources tab you should select Allow user to connect to any network resource or define a RD Gateway-managed group that has all of the FQDNs that the user will need to connect to.
3. RD Web Access FQDN: remote.domain.com --> internally points to the ip address of your RDWeb server, externally points to the public ip address of your RDWeb server. This is the name you give users if they want to use RD Web, for example,
https://remote.domain.com/rdweb
If you want users to manually connect using Remote Desktop Client as well as use RDWeb it will be a bit confusing to them since they will need to use one FQDN when manually using the client and a different FQDN when using RDWeb. You could fix this
by having them only use one method or run RDWeb directly on the RDCB server, that way users would only need to know a single FQDN for both RDWeb and manual connections.
4. You should have a wildcard certificate with subject of *.domain.com set for all RDS purposes in Deployment Properties.
Thanks.
-TP -
Session method and call transaction methos which one is the sap recomonded
hi
PLease give me the answer to these questions.
session method and call transaction methos which one is the sap recomonded why .
2) if we want to maintain BDC program in all the systems.wt to d0Hi Revethi,
Here is the difference between the Session and Call Transaction method.
Session
Session method supports both small amount of data aswell as large amount of data
2) data processing is asynchronus and data updation is synchronus.
3) it process multiple apllication while perfomaning validations.
4) in session method data will be updated in data base only after processing session only.
5) system provide by default logfile for handling error records.
6) it supports both foreground aswell as background process
in bdc we use FM ... bdc_open_group " for creating Session
bdc_insert " adding transaction and bdcdata table for updating database
bdc_close_group " for closing Session
Call Transaction
Call transaction exclusively for small amout of data
2) it supports only one apllication while perfoming validations
3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.
we can create logfile by using structure....BDCMSGCOLL
4) it doesn't support background processing.
5) data processing is synchronous and Data updation is Synchronous( default), in
this method also supports daya updation in asynchronus process also.
Syntax:
Call transaction <transaction-name> using BDCDATA
mode <A/N/E> update <L/A/S>
messages into BDCMSGCOLL. -
CMP Entity Bean with ejb-ql finder methods and INFORMIX database
Hi,
I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
<entity>
<abstract-schema-name>BeanName</abstract-schema-name>
<cmp-field><field-name>fieldOne</field-name></cmp-field>
<cmp-field><field-name>fieldTwo</field-name></cmp-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
</query>
<entity>
And in persistent.xml:
<db-properties>
<data-source-name>datasource_name</data-source-name>
</db-properties>
<entity-bean>
<ejb-name>BeanName</ejb-name>
<table-name>table_name</table-name>
<field-map key-type="NoKey">
<field-name>fieldOne</field-name>
<column><column-name>column_one</column-name></column>
</field-map>
<field-map key-type="NoKey">
<field-name>fieldTwo</field-name>
<column><column-name>column_two</column-name></column>
</field-map>
<finder-descriptor>
<method-name>findAll</method-name>
<method-params/>
</finder-descriptor>
Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
with names:
BeanName0_0pm.java
BeanName0_0PM.class
and the generated java file contains this code:
public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException {
TransactionContext tc = pm.getTransactionContext();
Connection conn = null;
PreparedStatement pSt = null;
ResultSet ejb_rs = null;
int status = javax.transaction.xa.XAResource.TMSUCCESS;
try {
conn = pm.getConnectionForFindMethod();
pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
ejb_rs = pSt.executeQuery();
I'm trying to call this method but it throws a SQLException when preparing the statement.
It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
Is there any way to define how this SQL query is build?
Thanks in advance.The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface
-
Calling session bean's business method through web dynpro component
Hi All,
Can anybody tell me how to call a session bean's methods through a web dynpro WITHOUT java-model or web service model ??
I have following scenario:-
1. Stateless Session bean having two business methods
2. Web Dynpro component
3.Now i want to call business methods without using any model. I have got following piece of code but I dont know how to go about it.
4.Where do i have to set JNDI name for session bean? which interface will be looked for?
5. Do I have to declare public part for EJB DC? If yes, how?
//This is inside web dynpro component
InitialContext context = new InitialContext();
o = context.lookup(JNDIName);
TestSessionbeanHome homeRef = (TestSessionbeanHome) PortableRemoteObject.narrow( o,
TestSessionbeanHome.class);
TestSessionbean beanRef = homeRef.create();
<returnValue> = beanRef.<ejb method name>
Please help to get a step-by-step approach to this case.
Thanks and regards,
Amey MogareHi,
If I comment out the part that is using session bean's business method, DC is building fine.
And if I uncomment, then compiler is unabl eto resolve business method(s).
And i would like to mention that my EJB + J2EE App DC is building properly, but it havent yet deployed properly as I am waiting for data-source-alias name prefix to be configured by ERP team. So will this be a reason why Web Dynpro DC is not able to resolve business methods ??
Because Web Dynpro DC is able to resolved all interfaces of Session bean and entity bean. But when it comes to business method, its not able to resolve.
Any more ideas why it is not happening?
Pls help.
Now i went through some forum posts regarding this and found that we also need to add EJB DC to Java Build Path for WebDynproDC>Properties>Java Build Path.
I did this and now it is able to resolve business methods and DTOs as well. So to summarize I did following:-
1. Added EJB DC (complete DC) as a Used DC to Web Dynpro DC with Buid-n-Deploy-n-Run time dependency
2. Added Sharing reference of J2EE application DC to Web Dynpro DC -->Properties
This reference I constructed as follows:-
<vendorname>/<name of j2ee application as appearing under display name tag in application.xml (replacing '/' with '~')>
So my Sharing Reference becomes:- <vendorname>/reqpstapscreqpstapja_reqid
3. Added EJB DC to Java Build Path in Web Dynpro DC's properties
4. Then I added following piece of code to get object of SessionBean class
InitialContext context = new InitialContext();
Object o = context.lookup("java:comp/env/ejb/SessionRequestIDBean");
SessionRequestIDHome homeRef = (SessionRequestIDHome) PortableRemoteObject.narrow(o, SessionRequestIDHome.class);
SessionRequestID beanRef = homeRef.create();
beanRef.<business method>
But After doing this I am facing another problem :-
The build fails saying it is not able find the package for DTOs. But when I see the Component Controller's code it is not showing any red or yellow marks.
Can anybody pls help me out here?
Thanks and regards,
Amey Mogare -
Session vs. Beans, what is better and why?
A question of principal: Is there any reason why it is always adviced to use beans (user beans, value beans etc.) if I can get the same results with sessionAttributes? I see one disadvantage of sessionAttributes; they can only store Objects, so you need wrapper for ints, booleans etc., but it seems easyer to write:
String xxx = session.getAttribute("xxx").toString(); or
session.setAttribute("xxx", xxx);
than writing a bean with a getxxxString() and setxxxString()method, compiling it and set the useBean tag scope="session" etc...
Is there any advantage in performance, storage use or security?
I have to excuse, if this topic has been discussed before, I couldn't find it...Here is an interesting test done on this topic...
http://www.sys-con.com/weblogic/articleprint.cfm?id=101 -
Difference between Session method and call transaction
Hi,
please give me the differences between session method and call transaction,
briefly explaining synchronus , asynchronus, process, update.
Thanks in advanceHi Vijay Kumar
CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
BATCH INPUT METHOD:
This method is also called as CLASSICAL METHOD.
Features:
Asynchronous processing.
Synchronous Processing in database update.
Transfer data for more than one transaction.
Batch input processing log will be generated.
During processing, no transaction is started until the previous transaction has been written to the database.
CALL TRANSACTION METHOD :
This is another method to transfer data from the legacy system.
Features:
Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
Updating the database can be either synchronous or asynchronous. The program specifies the update type.
Transfer data for a single transaction.
Transfers data for a sequence of dialog screens.
No batch input processing log is generated.
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
Among the two methods call transaction is better compared to session bcoz data transfer is faster in it.
Differences between call transaction and session.
Session Method:
1) Data is not updated in the database table until the session is processed.
2) No sy-subrc is returned.
3) Error log is created for error records.
4) Updation is always synchronous.
Call Transaction Method:
1) Immediate updation in the database table.
2) sy-subrc is returned.
3)Error need to be handled explicitly.
4) updation can be synchronous as well as asynchronous.
2) ya u can use using the N mode no screen.
3)u can't handle multiple transaction in call transaction.
4) u can handle multiple transaction in session using the BDC_INSERT fm.
5)When u go to SM35 u can able to see the error records.
Which is best?
That depends on your requirement. Both of them have there advantages.
According to the situation u can choose any one of these.
difference between batch input and call transaction in BDC Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
For session method,these are the function modules to b used.
BDC_OPEN_GROUP
BDC_INSERT
BDC_CLOSE_GROUP
For call transaction,this is the syntax.
CALL TRANSACTION TCODE USING BDCDATA
MODE A or E or N
UPDATE A or S
MESSAGES INTO MESSTAB.
Take a scenario where we need to post documents in FB01 and the input file has say 2000 records (2000 documents, not line items in FB01 but 2000 records)
In the BDC call transaction method
We call the transaction FB01 2000 times (once for each record posting) and if the processing fails in record no 3 it can be captured and start with reocord 4.
Eg: Loop at itab.
call transaction FB01
capture errors
endloop.
In the session method.
We do not explicity call the transaction 2000 times, but all the records are appeneded into a session and this session is stored. The processinf of the session is done wwhenever the user wants it to be done. Hence the errors cannot be captured in the program itself
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
Batch Input Session method is asynchronous as told by others here. But the advantage of this is that you have all the error messages and the data for each transaction held persistantly. You don't have to code anything for processing them or writing the logs.
But at the same time, the same feature can be disadvantageous if you need to react to an error or if there are too many errors to manually correct in a session. Since the session are created in the program and its execution is done seperately, you loose the trackability of such transactions.
With a call transaction, what was a disadvantage above will become an advantage. Call transaction immediately gives you messages back and you can react to it in your program. But the disadvantage is that, if you have several hundreds of transactions to run, running them from within the program can be resource crunching affair. It will hamper the system performance and you cannot really distribute the load. Of course, you have some mechanisms with which you can overcome this, but you will have to code for it. Also, storing the messages and storing the errored transaction data etc will have to be handled by you in the program. Whereas, in batch input session, your program's job is to just create the session, after that everything is standard SAP system's responsibility.
Ideally, you should do a call transaction if the resources are not a problem and if it fails, put the errored transaction into a session.
You can decide based on the data volume that your BDC is processing. If data volume is high go for session else call transaction will do.The call transaction updates will be instantaneous where as session needs to be processed explictly after creation.
Session Method
1) Session method supports both small amount of data aswell as large amount of data
2) data processing is asynchronus and data updation is synchronus.
3) it process multiple apllication while perfomaning validations.
4) in session method data will be updated in data base only after processing session only.
5) system provide by default logfile for handling error records.
6) it supports both foreground aswell as background process
in bdc we use FM ...
bdc_open_group " for creating Session
bdc_insert " adding transaction and bdcdata table for updating database
bdc_close_group " for closing Session
Call Transaction
1) Call transaction exclusively for small amout of data
2) it supports only one apllication while perfoming validations
3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.
we can create logfile by using structure....BDCMSGCOLL
4) it doesn't support background processing.
5) data processing is synchronous and Data updation is Synchronous( default), in
this method also supports daya updation in asynchronus process also.
syntax:
Call transaction <transaction-name> using BDCDATA
mode <A/N/E>
update <L/A/S>
messages into BDCMSGCOLL.
BDC:
Batch Data Communication (BDC) is the process of transferring data from one SAP System to another SAP system or from a non-SAP system to SAP System.
Features :
BDC is an automatic procedure.
This method is used to transfer large amount of data that is available in electronic medium.
BDC can be used primarily when installing the SAP system and when transferring data from a legacy system (external system).
BDC uses normal transaction codes to transfer data.
Types of BDC :
CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
BATCH INPUT METHOD:
This method is also called as CLASSICAL METHOD.
Features:
Asynchronous processing.
Synchronous Processing in database update.
Transfer data for more than one transaction.
Batch input processing log will be generated.
During processing, no transaction is started until the previous transaction has been written to the database.
CALL TRANSACTION METHOD :
This is another method to transfer data from the legacy system.
Features:
Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
Updating the database can be either synchronous or asynchronous. The program specifies the update type.
Transfer data for a single transaction.
Transfers data for a sequence of dialog screens.
No batch input processing log is generated.
For BDC:
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
call Transaction or session method ?
Check the following links:
http://www.sap-img.com/bdc.htm
See below example code :
Call three FM : BDC_OPEN_GROUP,BDC_INSERT and BDC_CLOSE_GROUP.
Once you execute the program and it creates the session at SM35 Transaction.
Report : ZMPPC011
Type : Data upload
Author : Chetan Shah
Date : 05/05/2005
Transport : DV3K919557
Transaction: ??
Description: This ABAP/4 Program creates new Production Versions
(C223). It accepts tab-delimited spreadsheet input and
creates BDC sessions.
Modification Log
Date Programmer Request # Description
06/10/2005 Chetan Shah DV3K919557 Initial coding
report zmppc011 no standard page heading line-size 120 line-count 55
message-id zz.
pool of form routines
include zmppn001.
Define BDC Table Structure
data: begin of itab_bdc_tab occurs 0.
include structure bdcdata.
data: end of itab_bdc_tab.
Input record layout of Leagcy File
data: begin of itab_xcel occurs 0,
matnr(18) type c,
werks(4) type c,
alnag(2) type c,
verid(4) type c,
text1(40) type c,
bstmi like mkal-bstmi,
bstma like mkal-bstma,
adatu(10) type c,
bdatu(10) type c,
stlal(2) type c,
stlan(1) type c,
serkz(1) type c,
mdv01(8) type c,
elpro(4) type c,
alort(4) type c,
end of itab_xcel.
data: begin of lt_pp04_cache occurs 0,
matnr like itab_xcel-matnr,
werks like itab_xcel-werks,
alnag like itab_xcel-alnag,
plnnr like mapl-plnnr,
arbpl like crhd-arbpl,
ktext like crtx-ktext,
end of lt_pp04_cache.
data: v_ssnnr(4) type n,
v_lines_in_xcel like sy-tabix,
v_ssnname like apqi-groupid,
v_trans_in_ssn type i,
wa_xcel LIKE itab_xcel,
l_tabix like sy-tabix,
v_matnr like rc27m-matnr,
v_plnnr like mapl-plnnr,
v_plnal like mapl-plnal,
v_tcode like sy-tcode value 'C223',
v_plnty like plas-plnty value 'R',
v_objty like crhd-objty value 'A',
v_plpo_steus like plpo-steus value 'PP04',
v_verwe like crhd-verwe value '0007'.
Parameters
selection-screen: skip 3.
selection-screen: begin of block 1 with frame.
parameters: p_name like rlgrap-filename
default 'C:\My Documents\InputFile.txt'
obligatory,
bdc session name prefix
p_bdcpfx(6) default 'ZPVCRT'
obligatory,
number for transction per BDC session
p_trnssn type i
default 2000 obligatory,
retain the BDC session after successfull execution
p_keep like apqi-qerase
default 'X',
user who will be executing BDC session
p_uname like apqi-userid
default sy-uname
obligatory.
selection-screen: end of block 1.
possible entry list (F4 dropdown) for input file name
at selection-screen on value-request for p_name.
*-SELECT FILE FROM USERS LOCAL PC
call function 'WS_FILENAME_GET'
exporting
DEF_FILENAME = ' '
def_path = 'C:\Temp\'
mask = ',.,..'
mode = 'O'
title = 'Select File '(007)
importing
filename = p_name
RC =
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5.
if sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
begin the show
start-of-selection.
read data from input file
perform transfer_xcel_to_itab.
loop at itab_xcel.
hang on to xcel line num
l_tabix = sy-tabix.
each line in the xcel file marks begining of new prod.version defn
if num-of-trnas-in-session = 0, create new BDC session
if v_trans_in_ssn is initial.
perform bdc_session_open.
endif.
begin new bdc script for rtg create trans
fill in bdc-data for prod.version maintenance screens
perform bdc_build_script.
insert the bdc script as a BDC transaction
perform bdc_submit_transaction.
keep track of how many BDC transactions were inserted in the BDC
session
add 1 to v_trans_in_ssn.
if the user-specified num of trans in BDC session is reached OR
if end of input file is reached, close the BDC session
if v_trans_in_ssn = p_trnssn or
l_tabix = v_lines_in_xcel.
perform bdc_session_close.
clear v_trans_in_ssn.
endif.
endloop.
top-of-page.
call function 'Z_HEADER'
EXPORTING
FLEX_TEXT1 =
FLEX_TEXT2 =
FLEX_TEXT3 =
FORM TRANSFER_XCEL_TO_ITAB *
Transfer Xcel Spreadsheet to SAP Internal Table *
form transfer_xcel_to_itab.
Read the tab-delimited file into itab
call function 'WS_UPLOAD'
exporting
filename = p_name
filetype = 'DAT'
IMPORTING
filelength = flength
tables
data_tab = itab_xcel
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
if sy-subrc = 0.
sort the data
sort itab_xcel by matnr werks.
clear v_lines_in_xcel.
if no data in the file - error out
describe table itab_xcel lines v_lines_in_xcel.
if v_lines_in_xcel is initial.
write: / 'No data in input file'.
stop.
endif.
else.
if file upload failed - error out
write: / 'Error reading input file'.
stop.
endif.
endform.
FORM BDC_SESSION_OPEN *
Open BDC Session *
form bdc_session_open.
create bdc session name = prefix-from-selectn-screen + nnnn
add 1 to v_ssnnr.
concatenate p_bdcpfx v_ssnnr into v_ssnname.
open new bdc session
call function 'BDC_OPEN_GROUP'
exporting
client = sy-mandt
group = v_ssnname
keep = p_keep
user = p_uname
exceptions
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
others = 11.
endform.
FORM BDC_BUILD_SCRIPT *
Build BDC *
form bdc_build_script.
data: l_arbpl like crhd-arbpl,
l_text1 like mkal-text1,
l_mdv01 like mkal-mdv01,
l_mapl like mapl.
clear bdc-data itab - begin of new bdc transaction
clear itab_bdc_tab.
refresh itab_bdc_tab.
read material cross reference tables to determine sap part#
clear : v_matnr, v_plnnr, v_plnal.
perform read_matnr_cross_ref using itab_xcel-matnr
itab_xcel-werks
changing v_matnr.
determine the version description to use
if itab_xcel-text1 is initial.
l_text1 = itab_xcel-verid.
else.
l_text1 = itab_xcel-text1.
endif.
determine the routing group# and group ctr# to use
perform read_routing .
determine the production line to use
if itab_xcel-mdv01 is initial.
if not provided in the file then:
prod line = work ctr on the last PP04 op of the rtg determined above
perform read_wc_on_last_pp04 using v_plnnr v_plnal
changing l_mdv01.
NOTE: when executing the above form\routine, if v_plnnr is initial
or v_plnal is initial, THEN l_mdv01 will automatically be
returned blank (ie initial)
else.
l_mdv01 = itab_xcel-mdv01.
endif.
build bdc script
perform bdc_build_script_record
fill in initial screen
using: 'X' 'SAPLCMFV' '1000',
' ' 'BDC_OKCODE' '=ENTE',
' ' 'MKAL-WERKS' itab_xcel-werks,
' ' 'MKAL-MATNR' v_matnr,
' ' 'MKAL_ADMIN-DISPO' space,
' ' 'MKAL-PLNNR' space,
' ' 'MKAL_ADMIN-STTAG' space,
' ' 'MKAL-PLNNG' space,
' ' 'MKAL-MDV01' space,
' ' 'MKAL-PLNNM' space,
click create button on initial screen and go to detail screen
'X' 'SAPLCMFV' '1000',
' ' 'BDC_OKCODE' '=CREA',
fill in the detail screen and go back to initial screen
'X' 'SAPLCMFV' '2000',
' ' 'BDC_OKCODE' '=CLOS',
' ' 'MKAL_EXPAND-MATNR' v_matnr,
' ' 'MKAL_EXPAND-VERID' itab_xcel-verid,
' ' 'MKAL_EXPAND-TEXT1' l_text1,
' ' 'MKAL_EXPAND-BSTMI' itab_xcel-bstmi,
' ' 'MKAL_EXPAND-BSTMA' itab_xcel-bstma,
' ' 'MKAL_EXPAND-ADATU' itab_xcel-adatu,
' ' 'MKAL_EXPAND-BDATU' itab_xcel-bdatu,
' ' 'MKAL_EXPAND-PLTYG' v_plnty,
' ' 'MKAL_EXPAND-PLNNG' v_plnnr,
' ' 'MKAL_EXPAND-ALNAG' v_plnal,
' ' 'MKAL_EXPAND-STLAL' itab_xcel-stlal,
' ' 'MKAL_EXPAND-STLAN' itab_xcel-stlan,
' ' 'MKAL_EXPAND-SERKZ' itab_xcel-serkz,
' ' 'MKAL_EXPAND-MDV01' l_mdv01,
' ' 'MKAL_EXPAND-ELPRO' itab_xcel-elpro,
' ' 'MKAL_EXPAND-ALORT' itab_xcel-alort,
save the production version from initial screen
'X' 'SAPLCMFV' '1000',
' ' 'BDC_OKCODE' '=SAVE'.
endform.
FORM BDC_SUBMIT_TRANSACTION *
Submit BDC Session *
form bdc_submit_transaction.
Load BDC script as a trqansction in BDC session
call function 'BDC_INSERT'
exporting
tcode = v_tcode
tables
dynprotab = itab_bdc_tab
exceptions
internal_error = 01
not_open = 02
queue_error = 03
tcode_invalid = 04.
endform.
FORM BDC_BUILD_SCRIPT_RECORD *
form bdc_build_script_record using dynbegin name value.
clear itab_bdc_tab.
if dynbegin = 'X'.
move: name to itab_bdc_tab-program,
value to itab_bdc_tab-dynpro,
'X' to itab_bdc_tab-dynbegin.
else.
move: name to itab_bdc_tab-fnam,
value to itab_bdc_tab-fval.
shift itab_bdc_tab-fval left deleting leading space.
endif.
append itab_bdc_tab.
endform.
FORM BDC_SESSION_CLOSE *
Close BDC Session *
form bdc_session_close.
close the session
call function 'BDC_CLOSE_GROUP'
exceptions
not_open = 1
queue_error = 2
others = 3.
skip 2.
if sy-subrc ne 0.
write: / 'Error Closing BDC Session ' , 'RETURN CODE: ', sy-subrc.
else.
write : / 'Session created:', v_ssnname,
50 '# of transactions:', v_trans_in_ssn.
endif.
endform.
*& Form read_routing_cache
*FORM read_routing_cache USING pi_matnr
pi_werks
pi_alnag
pi_verid
pi_mdv01.
DATA: BEGIN OF lt_plpo OCCURS 0,
vornr LIKE plpo-vornr,
objty LIKE crhd-objty,
objid LIKE crhd-objid,
arbpl LIKE crhd-arbpl,
END OF lt_plpo,
l_mapl_plnnr LIKE mapl-plnnr.
determine the routing group#
CLEAR lt_pp04_cache.
chk if its in the cache first, if not then get it from MAPL table
and put it in the cache
READ TABLE lt_pp04_cache WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
IF sy-subrc = 0.
do nothing - lt_pp04_cache header line has rtg#
ELSE.
get the routing group # from MAPL
SELECT plnnr INTO l_mapl_plnnr
FROM mapl UP TO 1 ROWS
WHERE matnr = pi_matnr AND
werks = pi_werks AND
plnty = 'R' AND
plnal = pi_alnag AND
loekz = space.
ENDSELECT.
put it in the cache internal table
IF NOT l_mapl_plnnr IS INITIAL.
lt_pp04_cache-matnr = pi_matnr.
lt_pp04_cache-werks = pi_werks.
lt_pp04_cache-alnag = pi_alnag.
lt_pp04_cache-plnnr = l_mapl_plnnr.
APPEND lt_pp04_cache.
ENDIF.
ENDIF.
if the rtg# was determined AND
-- the work center was not determined yet AND
-- work center was really needed for this line in the input file
then
-- read the work center from last PP04 operation on the routing
-- update the cache accordingly
IF NOT lt_pp04_cache-plnnr IS INITIAL AND
lt_pp04_cache-arbpl IS INITIAL AND
( pi_verid IS INITIAL OR
pi_mdv01 IS INITIAL ).
read the last PP04 operation
CLEAR lt_plpo.
REFRESH lt_plpo.
SELECT vornr eobjty eobjid e~arbpl
INTO CORRESPONDING FIELDS OF TABLE lt_plpo
FROM plas AS b
INNER JOIN plpo AS c
ON bplnty = cplnty AND
bplnnr = cplnnr AND
bzaehl = czaehl
INNER JOIN crhd AS e
ON carbid = eobjid
WHERE b~plnty = v_plnty AND
b~plnnr = lt_pp04_cache-plnnr AND
b~plnal = lt_pp04_cache-alnag AND
c~loekz = space AND
c~steus = v_plpo_steus AND
e~objty = v_objty AND
e~werks = lt_pp04_cache-werks AND
e~verwe = v_verwe.
SORT lt_plpo BY vornr DESCENDING.
READ TABLE lt_plpo INDEX 1.
IF NOT lt_plpo-arbpl IS INITIAL.
lt_pp04_cache-arbpl = lt_plpo-arbpl.
read work center description
SELECT SINGLE ktext INTO lt_pp04_cache-ktext
FROM crtx WHERE objty = lt_plpo-objty AND
objid = lt_plpo-objid AND
spras = sy-langu.
the following read will get the index of the correct record to be
updated in the cache
READ TABLE lt_pp04_cache
WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
MODIFY lt_pp04_cache
INDEX sy-tabix
TRANSPORTING arbpl ktext.
ENDIF.
ENDIF.
*ENDFORM. " read_last_pp04_operation_cache
*& Form read_routing
form read_routing.
data: begin of lt_mapl occurs 0,
plnnr like mapl-plnnr,
plnal like mapl-plnal,
end of lt_mapl,
l_arbpl like crhd-arbpl.
get all the rtg# and grp ctr# from MAPL
select plnnr plnal
into corresponding fields of table lt_mapl
from mapl
where matnr = v_matnr and
werks = itab_xcel-werks and
plnty = v_plnty and "Rate Routing
loekz = space. "with del flag = OFF
sort lt_mapl by plnal.
if not itab_xcel-verid is initial.
if the verid=0001 then use the 1st good rtg-grp# and grp-ctr#
if itab_xcel-verid = '0001'.
read table lt_mapl index 1.
v_plnnr = lt_mapl-plnnr.
v_plnal = lt_mapl-plnal.
else.
if the verid0001 then use the rtg-grp# and grp-ctr# of the routing
whose work center on the last PP04 operation matches the given verid
loop at lt_mapl.
clear l_arbpl.
get the work center from the last PP04 operation
perform read_wc_on_last_pp04 using lt_mapl-plnnr
lt_mapl-plnal
changing l_arbpl.
if itab_xcel-verid = l_arbpl.
v_plnnr = lt_mapl-plnnr.
v_plnal = lt_mapl-plnal.
exit.
endif.
endloop.
endif.
else.
do nothing
endif.
For version IDs that are other then '0000' or 'ZWIP' :--
if itab_xcel-verid NE '0000' and
itab_xcel-verid NE 'ZWIP'.
if routing group# or group counter was not determined, make the
valid-to date 99/99/9999 so that the BDC, on execution, errors out.
if v_plnnr is initial or
v_plnal is initial.
itab_xcel-bdatu = '99/99/9999'.
endif.
endif.
determine the routing group#
CLEAR lt_pp04_cache.
chk if its in the cache first, if not then get it from MAPL table
and put it in the cache
READ TABLE lt_pp04_cache WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
IF sy-subrc = 0.
do nothing - lt_pp04_cache header line has rtg#
ELSE.
get the routing group # from MAPL
put it in the cache internal table
IF NOT l_mapl_plnnr IS INITIAL.
lt_pp04_cache-matnr = pi_matnr.
lt_pp04_cache-werks = pi_werks.
lt_pp04_cache-alnag = pi_alnag.
lt_pp04_cache-plnnr = l_mapl_plnnr.
APPEND lt_pp04_cache.
ENDIF.
ENDIF.
if the rtg# was determined AND
-- the work center was not determined yet AND
-- work center was really needed for this line in the input file
then
-- read the work center from last PP04 operation on the routing
-- update the cache accordingly
IF NOT lt_pp04_cache-plnnr IS INITIAL AND
lt_pp04_cache-arbpl IS INITIAL AND
( pi_verid IS INITIAL OR
pi_mdv01 IS INITIAL ).
read the last PP04 operation
CLEAR lt_plpo.
REFRESH lt_plpo.
SELECT vornr eobjty eobjid e~arbpl
INTO CORRESPONDING FIELDS OF TABLE lt_plpo
FROM plas AS b
INNER JOIN plpo AS c
ON bplnty = cplnty AND
bplnnr = cplnnr AND
bzaehl = czaehl
INNER JOIN crhd AS e
ON carbid = eobjid
WHERE b~plnty = v_plnty AND
b~plnnr = lt_pp04_cache-plnnr AND
b~plnal = lt_pp04_cache-alnag AND
c~loekz = space AND
c~steus = v_plpo_steus AND
e~objty = v_objty AND
e~werks = lt_pp04_cache-werks AND
e~verwe = v_verwe.
SORT lt_plpo BY vornr DESCENDING.
READ TABLE lt_plpo INDEX 1.
IF NOT lt_plpo-arbpl IS INITIAL.
lt_pp04_cache-arbpl = lt_plpo-arbpl.
read work center description
SELECT SINGLE ktext INTO lt_pp04_cache-ktext
FROM crtx WHERE objty = lt_plpo-objty AND
objid = lt_plpo-objid AND
spras = sy-langu.
the following read will get the index of the correct record to be
updated in the cache
READ TABLE lt_pp04_cache
WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
MODIFY lt_pp04_cache
INDEX sy-tabix
TRANSPORTING arbpl ktext.
ENDIF.
ENDIF.
endform. " read_last_pp04_operation_cache
*& Form read_wc_on_last_pp04
form read_wc_on_last_pp04 using pi_plnnr
pi_plnal
changing pe_arbpl.
data: begin of lt_plpo occurs 0,
vornr like plpo-vornr,
objty like crhd-objty,
objid like crhd-objid,
arbpl like crhd-arbpl,
end of lt_plpo.
get all the PP04 operations for the given rtg# & grp-ctr#
select vornr eobjty eobjid e~arbpl
into corresponding fields of table lt_plpo
from plas as b
inner join plpo as c
on bplnty = cplnty and
bplnnr = cplnnr and
bzaehl = czaehl
inner join crhd as e
on carbid = eobjid
where b~plnty = v_plnty and "Rate Routing
b~plnnr = pi_plnnr and
b~plnal = pi_plnal and
c~loekz = space and "Oper Del Flag = OFF
c~steus = v_plpo_steus and "PP04
e~objty = v_objty. "WC Obj Type = 'A'
read the last operation
sort lt_plpo by vornr descending.
read table lt_plpo index 1.
pe_arbpl = lt_plpo-arbpl.
endform. " read_wc_on_last_pp04
Goto LSMW-> Select Direct Input method in 1st step. These are the standard programs for data transfer.
Otherwise goto SPRO->SAP Reference IMG-> Under this you'll find standard data transfer programs module wise.
Reward points,
Shakir -
Spring factory-method and factory-bean
I have a singleton class which returns a Connection object by getDbConnection() method. I have created the bean of this class and declared getDbConnection() as a factory method. How do i access this factory method from other classes. No doubt I have created a second bean which uses the factory method of the first bean. How do i get the connection in my second class namely DbConnectionSingletonTest
package ioc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;
public class DbConnectionSingleton{
public static Connection con = null;
private DbConnectionSingleton(){
public static Connection getDbConnection(){
if(con == null){
con = createConnection();
return con;
// public static void main(String[] args) {
// createConnection();
public static Connection createConnection() {
BeanFactory factory = new XmlBeanFactory(new FileSystemResource("springfile.xml"));
DbConnection dbConnection = (DbConnection) factory.getBean("dbConnection");
HashMap dbProperties = dbConnection.getDbProperties();
try {
// con = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:bob", "scott", "tiger");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String host = (String) dbProperties.get("host");
String port = (String) dbProperties.get("port");
String dsn = (String) dbProperties.get("dsn");
String username = (String) dbProperties.get("username");
String password = (String) dbProperties.get("password");
Connection con = DriverManager.getConnection ("jdbc:oracle:thin:@"+host
+":"+port+":" +dsn, username, password);
if(con != null){
System.out.println("Connection established Successfully at port : "+port);
}else{
System.out.println("Could not establish Connection");
} catch (SQLException e) {
e.printStackTrace();
return con;
My springfile.xml code
[CODE]<?xml version="1.0"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework..org/dtd/spring-beans.dtd">
<beans>
<bean id = "point" class="ioc.Point">
<property name="x" value="10" />
<property name="y" value="-23" />
</bean>
<bean id = "dbConnectionSingleton" class="ioc.DbConnectionSingleton" factory-method="getDbConnection">
<property name="dbProperties">
<map>
<entry key = "username" value="scott" />
<entry key = "password" value="tiger" />
<entry key = "host" value="localhost" />
<entry key = "port" value="1521" />
<entry key = "dsn" value="bob" />
</map>
</property>
</bean>
<bean id = "dbConnectionSingletonTest" class="ioc.DbConnectionSingleton" factory-bean="dbConnectionSingleton" factory-method="getDbConnection">
</bean>
</beans>Message was edited by:
hemanthjava
Message was edited by:
hemanthjava
Message was edited by:
hemanthjavaOne of the goals of Spring is to help you eliminate the use of singletons. You might want to try looking for help on the Spring forums (http://forum.springframework.org) since there is no JSF-related content to your post.
-
Device does not work when I connect it to your computer to the iTunes program update requests and then gives me an error No. 21
Device does not work when I connect it to my computer to the iTunes program update requests and then gives me an error No. 21
-
How to call a web service from a session bean's business method???
Hi Experts,
Can anybody help in calling a web serivce frm a session bean's business method??
Hw do we do that?
I have one requirement where i want to send emails to set of users for which i have email sending web service ready.. How can i call it thru a session bean's business method???
Pls help,
Regards,
AmeyHi Amey,
You can achieve this using the followin 2 Step implementation:
1. [Creating a Deployable Proxy|http://help.sap.com/saphelp_nw70/helpdata/EN/2d/b9766df88f4a24967dae38cb672fe1/frameset.htm]
2. [Create a Client Bean|http://help.sap.com/saphelp_nw70/helpdata/EN/45/029840cf43495195da923f32262911/frameset.htm]
Hope it helps.
Regards,
Alka. -
my itunes says it can not sync my ipod touch key in password on the device but my ipod touch says ipod disabled connect to itunes and doesnt give a option for my password how do I unlock my ipod
See Here > http://support.apple.com/kb/HT1808
You may need to try this More than Once... Be sure to Follow ALL the Steps...
Take your time... Pay particular attention to Steps 3 and 4.
After you have Recovered your Device...
Re-Sync your Content or Restore from the most recent Backup...
Restore from Backup > http://support.apple.com/kb/ht1766 -
I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.
You can connect via a cable or wireless using an Apple TV.
http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
Connect an iPad to a Television or Projector
http://www.everymac.com/systems/apple/ipad/ipad-faq/how-to-connect-ipad-to-tv-te levision-projector.html
Connecting iPad iPhone or iPod to TV or Projector
http://www.disabled-world.com/assistivedevices/computer/ipad-tv.php
iPad Accessories: Connections for a TV or Projector
http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
You may be interested in AirPlay on the Apple TV:
http://www.apple.com/airplay/
http://www.apple.com/airplay/
Alternately, there are Apple Digital AV Adapters for hardwired connections:
http://support.apple.com/kb/ht4108
http://support.apple.com/kb/ht4108
Cheers, Tom
Maybe you are looking for
-
Changed jvmEntry to use JDK14Logger in WAS 6.1.0.3 but Log is not generat
Hi, 1) I have installed WAS 6.1.0.3 2) Created App Server Profile 3) Added the following java option in <jvmEntry> <systemProperty> of sever.xml <systemProperties xmi:id="Property_1187707290069" name="java.util.logging.config.file" value="C:/PT850-10
-
HT4859 How do you read or see the "stuff" / document in iCloud ?
I want to see/read the documents that are backed up in iCloud so I can clean out some of them. I would appreciate any help. Thank you.
-
How to validate SMP Users against Gateway using OData
Hello Experts , Could you please let me know the procedure for validating SMP users via gateway . Do we need to create any OData service for validating SMP Users . If we need to do so, where do we provide SMP Connection details to get user related in
-
Mixing CS 5 and CS 5.5 installations
I currently have Adobe CS5 Design Premium installed. I need to have my ancient copy of Flash CS3 installed *alongside* the CS5 installation. I also now have standalone copies of Flash CS 5.5, Flash Catalyst CS 5.5 and Flash Builder 4.5 that I would a
-
Downgrading from iOS 4 back to 3.12, possible??
I have an 3GS, which I updated to iOS 4 yesterday. Can I restore or downgrade back to 3.12? The multitasking seems to eat my battery, and there are a few things I don't like about the universal inbox, function & look Or can I leave iOS 4 but turn off