Selecting Key for Entity Services in CAF
Hello All,
I have a question. While creating attributes for an entity service, we have an option to select it as key or complex. Suppose if we choose many attributes as key , then will it be a composite key ?
Like if we created Entity "project", and then create following attributes
Dept (Key)
ProjectName (Key)
Description
Then will Dept and ProjectName together form a composite key ? or they will be individual keys for the project?
Thanks
Ashutosh Rastogi
Hi Ashutosh,
I think they would form a composite key.
In fact the other day we were developing a PurchaseOrder entity service and by mistake chose poNo and vendorNo both as keys. Now we had a findByVendorNo operation which was returning a list of POs and we had only mapped the po from the BAPI to the attribute. Everything was hunky-dory during design time, we were able to build and deploy but while testing it using the service browser, on "execute query" CAF returned us an error. This was even though poNo was unique for every record.
Regards,
Parag.
Similar Messages
-
Expose the Entity Service in CAF as Web Service
Hello,
How can I expose the created Entity Services in CAF (for example xPerson) as a Web Service, for be used in other applications?
ThanksHi,
These will actually get saved in your internal SAP database. This is nothing but a MaxDB database which will be installed along with your CE. All your business objects will be saved in this in the server.
Regards,
Srinivasan Subbiah -
Problem while creating Complex Attirbutes of Entity Service in CAF Applicat
I am Creating one CAF Application.
while creating Entity Service i have Used one Complex Attribute. but in Application Services Implementation part when am assigning value to this Complex Attribute.it gives error that no method exist.
Kindly provide some information on how to use Complex Attributes while creating Entity Service.
Can i use NWDS2.0.11 for CAF Application?Guys,
I have solved the problem successfully. Thanks for your attention. -
Hi to all,
Iam new to CAF. Here Iam modeling Entity service and configured UI pattern for operations. Here Iam not using any external service..
One thing I want know is, If I perform Create,Retrieve operations, where these information will be stored?.
Thanks in advance
RoopHi,
These will actually get saved in your internal SAP database. This is nothing but a MaxDB database which will be installed along with your CE. All your business objects will be saved in this in the server.
Regards,
Srinivasan Subbiah -
Exception in inserting record for entity service
Hello Everybody,
I have created simple entity service: Employee.
I have included 3 fields in it.
Created one finder method "GetAllEmployee".
I have rebuilt and deployed project on the server.
When i tried to insert new record for this entity service from service browser:
http://<server>:<port>/webdynpro/dispatcher/sap.com/cafUIservicebrowser/ServiceBrowser?cafsource=true
I got following exception:
ERROR. Exception in method create.
What should be the reason behind this?
Regards,
BhavikHi Aliaksei,
I have changed the severity level of the trace. Then I got this exception.
Error in CAF:RT:oal:handleException(Throwable)
[EXCEPTION]
com.sap.caf.rt.exception.ServiceException: Exception in method create.
at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.handleException(ServiceWrapper.java:821)
at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.createDependentObject(ServiceWrapper.java:452)
at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.createDataContainerBean(ServiceWrapper.java:194)
at com.sap.caf.rt.services.serviceaccess.CAFServiceAccessBeanImpl.createDataObject(CAFServiceAccessBeanImpl.java:159)
at com.sap.caf.rt.services.serviceaccess.CAFServiceAccessLocalLocalObjectImpl20.createDataObject(CAFServiceAccessLocalLocalObjectImpl20.java:647)
at com.sap.caf.rt.ui.cool.generic.AspectServiceAccess.insertAspectRow(AspectServiceAccess.java:211)
at com.sap.caf.rt.ui.cool.generic.Aspect.insertRows(Aspect.java:1426)
at com.sap.caf.rt.ui.cool.generic.Aspect.sendChanges(Aspect.java:1542)
at com.sap.caf.ui.ptn.objecteditor.ObjectEditorCC.executeCoolAction(ObjectEditorCC.java:519)
at com.sap.caf.ui.ptn.objecteditor.wdp.InternalObjectEditorCC.executeCoolAction(InternalObjectEditorCC.java:243)
at com.sap.caf.ui.ptn.objecteditor.ui.OElayout.onActionGenericAction(OElayout.java:315)
at com.sap.caf.ui.ptn.objecteditor.ui.wdp.InternalOElayout.wdInvokeEventHandler(InternalOElayout.java:279)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:417)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:415)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:101)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:650)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.processRequest(ClientManager.java:155)
at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:105)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:63)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method create.
at com.lti.carpool.besrv.employee.EmployeeServiceLocalLocalObjectImpl0.create(EmployeeServiceLocalLocalObjectImpl0.java:321)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.createDependentObject(ServiceWrapper.java:430)
... 37 more
Caused by: com.sap.engine.services.ejb.exceptions.BaseRuntimeException: Cannot create an instance of the stateless bean.
at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:192)
at com.sap.engine.services.ejb.session.stateless_sp5.StatelessContainerFP.getActiveBean(StatelessContainerFP.java:183)
at com.lti.carpool.besrv.employee.EmployeeServiceLocalLocalObjectImpl0.create(EmployeeServiceLocalLocalObjectImpl0.java:312)
... 42 more
Caused by: java.lang.NoSuchFieldError: DATASOURCE_LOCAL_DA
at com.lti.carpool.besrv.employee.EmployeeServiceBean.ejbCreate(EmployeeServiceBean.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.createObject(BeanFactory.java:113)
at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.doResizeOneStepUp(ContainerPoolImpl.java:374)
at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.ensureNotEmpty(ContainerPoolImpl.java:343)
at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.pop(ContainerPoolImpl.java:291)
at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:188)
... 44 more
It cannot find field DATASOURCE_LOCAL_DA. What this field mean?
Thanks,
Bhavik -
Getting import errors while building the Dc for entity services
Hi all,
I am trying to create entity services in CAS and following the following help document from help.
http://help.sap.com/saphelp_nw04s/helpdata/en/05/3a0741b5b7ee6fe10000000a1550b0/frameset.htm
But While building I am getting following imports errors:
Error:
com.sap.caf.rt.bol.IPersistentBusinessObject cannot be resolved or is not a valid superinterface
com.sap.caf.rt.services.eventing cannot be resolved (or is not a valid type) for the field CarJDO
com.sap.caf.rt.bol.da.jdo.JDODADataAccessService cannot be resolved or is not a type
changedData cannot be resolved ,CarJDO.java
com.sap.caf.rt.bol.da.DataAccessFactory.DATASOURCE_LOCAL_DA cannot be resolved CarJDO.java
The method removeACL(String, String) is undefined for the type CAFPermission CarServiceBean.java
loadByCustomKeys(Car) is undefined for the type IDataAccessService CarServiceBean.java
Can anyone help.Hi Ritu,
The problem is due to the version of NWDS you are working on. If its an older version like 7.0.0 please try to upgrade it to 7.0.9. With this the problem would be solved.
You can try by deleting only the .metadata folder in the following path
D:\Documents and Settings\user\Documents\SAP\workspace
If still the problem exists the only thing you can do is reinstalling the IDE. before reinstalling it be sure that you completely delete all the workspace, .dtr and .dtc folders.
All the best...award if useful -
Field selection KEY for NBF.
Dear Friends
Iam cerating a STO document type with Field Selection Key NBF. and in Selection group, activated the fields Tax Code, GR/IR control, GR/IR indicator
Problem is while creating STO, Invoice tab is not appearing to enter Tax code
( VAT tax code created in ftxp). But doc type NB (Normal PO) Invoice tab is comming.
Can any body help me out how to resolve this issue. Urgent.
Thanks
sitaramDear ,
I dont think that you'll able to get the invoice tab for STO in standard, since you're not buying from vendor, but the PO is supply from a supplying plant. -
My Ipod touch froze and now the screen showa a symbol like a tiny flower. I have tried to re-start it by holding down the on/off switch and the selections key together for 10 seconds but nothing happens. Ithe Ipod does not show on Itunes but shows in My Computer. When plugged into USB the Ipod gets warm.
Basic troubleshooting steps
17" 2.2GHz i7 Quad-Core MacBook Pro 8G RAM 750G HD + OCZ Vertex 3 SSD Boot HD
Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101 -
Assign G/L Account to Account Key for External Service Management
Dear all,
Using SM30 V_T687 transaction key is maintained and it is accepted in Service Management caculation schem but now i have to assign GL accoutn to it.
Kindly guide me where i can assign GL account for this newly created transaction key as this one is not appearing in OBYC.
Thanks & Regards
Dipayan BoseHi,
In service procurement, you need to create a service master(AC03) , you need to enter valuation class for service(3200).In OBYC, you just assign need to assign GR/IR Clearing (service) with G/L account only & no valuation class for service assignment requires in OBYC setting for service. Service A/c triggered from OKB9 setting or cost element (KA01/KA02) with cost object assigned.
Service order or purchase order created with Acc. assignment ' K' and Item category 'D' , the system automatically pick UOM is "1" activity unit in Item Overview and in item details you need to maintain the service master ,UOM, quantity & price /unit and then G/L account with cost center .
During SES(ML8N), you are just recognizing vendor performed service where you can have cost object(cost center) with service master with quantity etc.....No FI document created after creating/maintaining the Service Entry Sheet in ML81N but once you release the Service Entry Sheet, then only FI documents created.
If GR valuated for service procurement: You will have accounting entries:
During SES release:
Service A/c: Dr
GR/IR(service) A/c :Cr
During IR
GR/IR(service) A/c :Dr
Vendor A/c: Cr
Service tax A/c: Dr
NOTE:
Default G/L account with cost center in Service PO can be set, check link:
http://www.bluemarlinsys.com/ns/0603-03.asp
Regards,
Biju K -
Problem with main selection key for N96
hi
the centre button on my nokia n96 acts as the downward arrow key before it selects. therefore if i want to open a particular application i have to select the one above it on the list as it will move downward. is there anything i can do to fix this problem by opening up my phone or is it a software problem???
please help
thanksThe NSP key should work for 6.40 and 7.00 systems.
Make sure that the system is started with the nspadm user rights. Although it is possible to start the system also with any other Windows admin user credentials, it is necessary to start it as nspadm to install the license.
Dirk -
Error when Building DC Project for CAF Entity Service
Hi All,
I got the following error message when Im building my CAF DC Project for Entity Services:
01.02.2008 12:09:10 /userOut/Development Component (com.sap.ide.eclipse.component.provider.listener.DevConfListener) [Thread[ModalContext,5,main]] ERROR: ewrdata/metadata: Failed to read component definition from local file MyComponents:com.cas.elisa.gp/ewrdata/metadata : Cannot read component definition. File does not exist: C:\Documents and Settings\tfelp4\.dtc\LocalDevelopment\DCs\com.cas.elisa.gp\ewrdata\metadata\_comp\.dcdef (Cannot read component definition. File does not exist: C:\Documents and Settings\tfelp4\.dtc\LocalDevelopment\DCs\com.cas.elisa.gp\ewrdata\metadata\_comp\.dcdef)
But ".dcdef" file exists, its an XML file.
My NWDS environment is 7.0.13.
I used the tutorial exactly how it was written in the tutorial from SAP:
http://help.sap.com/saphelp_nw04s/helpdata/en/05/3a0741b5b7ee6fe10000000a1550b0/frameset.htm
What could be the problem?
Thanks for helping me...
SteveHi Chandan,
Can you do person.getRelatedModelObjects() and get the contact object, to check whether it is null, also check in the CAF DB whether the data you entered is present.
I am not sure the code is actually adding the contact model object to person.
Go thru this SDN Blog on usage of the CMI API's, there is a link for CMI documentation in it which might help you get the right code for adding the contact object.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cef4f43e-0d01-0010-db84-ede25c874115.
award points if info is helpful
Regards,
Anish -
CAF DB Update for CAF Entity Service from Web Dynpro
Hi all,
I have created an entity service in CAF called Contacts which contains the following attributes.
phoneNo
cellNo
emailID.
Another entity service called "Person" is created. This contains the following attributes.
personId
personName
personAddr
contactsRef. (Cardinality -> 0..n , Relational Type -> Composition)
That means Contacts entity service is used within Person entity service. Now it is working fine within CAF service browser. Now the Web Dynpro DC of CAF application is used within another custom Web Dynpro DC project. I want to store data from Web Dynpro.
Within the context of component controller of Web Dynpro the structure is like
APerson
|_ personId
|_ personName
|_ personAddr
|_ contactsRef
|_ phoneNo (Under contactsRef)
|_ cellNo (Under contactsRef)
|_ emailID (Under contactsRef)
So I have written the following code within web dynpro custom method.
APerson person = PersonServiceProxy.create();
java.util.List ls = new ArrayList();
for(int i=0; i<4;i++)
AContacts contact = ContactsServiceProxy.create();
contact.setCellNo("9092130156");
contact.setEmailID("[email protected]");
contact.setPhoneNo("432258");
contact.getAspect().sendChanges();
ls.add(contact);
person.setRelatedModelObjects("contactsRef",ls);
person.setPersonID("9999");
person.setPersonName("xyz");
person.setPersonAddr("ABC, KOL");
wdContext.nodeAPerson().bind(person);
person.getAspect().sendChanges();
CAFServiceFactory.getServiceFacade(idendityDefinition.class);
After saving the data from Web Dynpro I am trying to test it from CAF service browser. But I am getting only the parent row. I mean only the value of personId, personName and personAddr fields which I have stored from Web Dynpro. But no value is coming within the table for Contacts entity service for composition relation.
Could anybody help me how can I solve my problem?
Thanks & Regards
Chandan
Message was edited by:
Chandan JashHi Chandan,
Can you do person.getRelatedModelObjects() and get the contact object, to check whether it is null, also check in the CAF DB whether the data you entered is present.
I am not sure the code is actually adding the contact model object to person.
Go thru this SDN Blog on usage of the CMI API's, there is a link for CMI documentation in it which might help you get the right code for adding the contact object.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cef4f43e-0d01-0010-db84-ede25c874115.
award points if info is helpful
Regards,
Anish -
Account / Transaction key for Services
Dear Sappers,
I am maintaining a condition for services. IMG MM - External Services Management -> Maintain Condition for services . Here i have created condition type and maintained in conditions: Schemas for services. But i cannot create Account key / Transaction key here. Can anyone guide me where i can create account / transaction key for external service management.
Account / Transaction key can be maintained for normal PO conditions in IMG MM -> Purchasing -> Conditions -> Price Determination but those account keys are not appearing in External Service Management calculation schema for services.
Thanks.
Shahzad ShakoorUsing OMGH the transaction key can be maintained but it doesnt appears in Service Management calculation schema.
Using SM30 V_T687 transaction key is maintained and it is accepted in Service Management caculation schem but now i have to assign GL accoutn to it.
Kindly guide me where i can assign GL account for this newly created transaction key as this one is not appearing in OBYC.
Thanks a lot. -
How to addRecord in Web Dynpro to Model node (Entity Service ref)
Hi,
1) I create Entity Service in CAF and try to write web dynpro Table UI for it.
2) is it possible with using Model Node? or I MUST use Value Node - Table must have possibilities for Add, Edit and Delete records.
Now I can edit, and delete records, but I can't add records with AddRecord method
Code below
public void NewTS( )
//@@begin NewTS()
IServiceFacade serviceFacade;
// Add new Model object TS
ATS ts = TSServiceProxy.create();
ts.setDate( new Date(System.currentTimeMillis()));
ts.getAspect().sendChanges();
serviceFacade = CAFServiceFactory.getServiceFacade(tsDefinition.class);
// try to addRecord to Controller context
IWDNodeElement n = wdContext.nodeTS().createElement(ts);
wdContext.nodeTS().addElement(n);
The error is: com.sap.caf.rt.exception.CAFBaseRuntimeException:
Aspect row is invalid for aspect: <Aspect name="TS" >
Thx for any helpHi Nikolai,
implement it in the following way:
wdInit()
IAspect originalAspect = TSServiceProxy.FindByName(employee) ;
wdContext.nodeTS().bind(originalAspect)
//just create new attribute this java native type IAspect
wdContext.currentContextElement().setOriginalAspect() ;
public void NewTS( )
//@@begin NewTS()
IAspect originalAspect = wdContext.currentContextElement().getOriginalAspect() ;
IAspectRow newTS = originalAspect.createAspectRow() ;
newTS.setAttributeValue("date", new Date(System.currentTimeMillis())) ;
or
public void NewTS( )
IAspect originalAspect = wdContext.currentContextElement().getOriginalAspect() ;
IAspectRow newTS = originalAspect.createAspectRow() ;
ITSElement tsElem = wdContext.nodeTS().getTSElementAt(originalAspect.indexOf(newTS)) ;
tsElem.setAttributeValue("date", new Date(System.currentTimeMillis())) ;
Best regards,
Aliaksei -
Entity services - complex tables joins
Hi,
is there a strategy on how to creating queries between entity services in CAF (in relation to the wellknown sql joins).
is the use of jdo query language the right way?
does anybody has a documentation or sample?
Thanks in advance.
Greetings jensHi jens,
In caf you can't directly use sql join among the two entity services. Add one entity as a child of another entity (by reference) and then add a find by method for the parent entity.
Then use the jdo query with in the find by method by QueryFilter .
http://help.sap.com/saphelp_nw04s/helpdata/en/44/6359a603b13674e10000000a114a6b/frameset.htm
Regards,
Mithu
Maybe you are looking for
-
Premier,After Effects CS5.5 or 6 MPEG 2 Problem
When using After Effects or Premier CS5.5 or 6 everytim I render an uncompressed video using MPEG2 the final product has a 1 sec pause or studder in the middle of the playback. The original video is uncompressed and looks fine. But this does not happ
-
Reference Error: Error #1065: Variable ContextMenuClipboardItems is not defined
http://img2.pict.com/27/6d/9f/3387824/0/1271788645.jpg I took a screen shot of the error i get if I use the squiggly and you can find it in the link above. I followed the same steps for the spell checker using SpellingUI.enablespelling() and it wor
-
How to load lots of images synchronously
HI all, I want to cache lots of images locally with URLLoader and need to know those fails. I can add listener to event IOErrorEvent.IO_ERROR. A variable can be used to save the file name I want to load last time. Then in the error handler I can know
-
Unable to apply syntax for upper case in pdf form
Hi All, I am unable to apply syntax in adobe livecycle design to conver the case automatic in upper case. Please help me how to do this as I am selecting form calc , clien and pasting the script but it does not work. or please share me your email id
-
MS Office Mac 2011 CD Wont Run
HI, When i insert the installation CD for MS Office Mac 2011, the CD drive runs-stops-runs-stops etc and eventually spits back out the CD; why won't it read launch the disk properly? The CD drive works as other CDs are read correctly and without issu