How to design CAF Entity service?
hello,
here is my question.
how to design CAF Entity service?
i got employees data and departments data.
an employee can join over one department, and of course, a department had many employee.
in tradition RDBMS(relational database management system), i'll create three tables and named "Employee", "Department" and "DepEmp". the table "DepEmp" is a kind of table for N to N relaction.
but when i use CAF's entity service, i can't do like RDBMS.
i can create three entity services, named "Employee", "Department" and "DepEmp". i can make service refence(pull service from left side of windows), but the information about Key(in properties) cannot be "true".
how can i do?
is there a different normalization way i have to learn.
thank you so much, it really help.
but when the issue more complicated.
a employee can join multiple departments, and he/she got different job title in each department. case will like fallow.
Vic is a software engineer in XX company's IT department, and he is a MIS engineer in XX company's HR department.
the db( i'm sorry for take this for example) structure will like..
=======================================
table:employee
column:
employeeCode PK
name
phone
table:department
column:
departmentCode PK
name
location
table:jobTitle
column:
titleCode PK
name
description
table:deptEmployee
column:
employeeCode PK FK
departmentCode PK FK
titleCode PK FK
=======================================
my SAP NetWeaver Developer Studio is version 7.0
1. how i make sure that three keys be mapped each other?(empCode,deptCode,titleCode)
2. is there have any "IUD abnormality" risk?
3. if there have, how can i avoid it?
thank you again, i'm sorry for ask much, because the way to design CAF Entity Service is that i didn't learn before. it really make me confused.
have a nice day
Similar Messages
-
How to read CAF entity services in BCO
Hello,
I try to read an entity service out of an background callbale object.
For this i added the the public part of the webdynpro DC of the entity service as used DC to my bco. I did this as well with the library, including my bco.
The problem is, that the included class cant be found in the deployed bco.
I get the NoClassDefFoundError while executing the bco.
Any hints how to reference my entity service?
Regards
RobertHi,
If I understand your problem then I can tell that you are trying to make a link in between two Entity service of two different projects. If I am correct then I can tell you that please publish the DC part of your EJB project not the Web Dynpro. Then you use that in another projects (ejb sub project) DC dependency part. Then try it.
If any problem please let me know.
Thanks
Chandan -
How to use a structure in CAF entity service
Hi All
I want to use a structure as datatype of a complex attribute in a CAF entity service. I tried to use a dictionary structure created in the dictionary part
of the CAF project and added it to the public part of this DC.But I can't find it in the list of data structures while trying to mention datatype for a complex attribute in an entity service. Can any body suggest how to do it.
Cheers
SudipHello Sudip,
You can create a complex structure by doing the following:
1. From the Attributes Tab, right click on your Entity and select "Create Attribute"
- Enter an attribute name and description
- select "Complex Attribute" checkbox
- select "Finish"
2. Right click on the newly created complex attribute and select "Create Sub Attribute". Do this for each attribute in your structure.
This complex structure can now be used in your CAF application and also CAF UI patterns.
Creating complex attributes from the data dictionary is only usually used for creating enumeration types. When doing this, you have to use the CAF enumeration editor to populate the values. The "How to guide" that Jan refers to describes this.
Regards,
Austin. -
Removing/updating data through CAF entity service
Does anyone know a way to remove/update data through a CAF entity service from a web dynpro which uses the webdynpro model of the CAF project ?
Hi Nicolaij,
This example describes how UPDATE and DELETE works under SP8.
Hopefully it helps.
Regards
Kamil
UPDATE of entity called "Bank"
=======================
ABank recordBank;
recordBank = BankServiceProxy.read(000000024);
recordBank.setCountryId(Germany);
IAspect aspectList = recordBank.getAspect();
aspectList.sendChanges();
DELETE from entity called "TransferID"
============================
ATransferID recordTransferID;
recordTransferID = TransferIDServiceProxy.read(123115651);
IAspect aspectList = recordTransferID.getAspect();
IAspectRow aspectRow = aspectList.getAspectRow(0);
aspectList.removeAspectRow(aspectRow);
aspectList.sendChanges(); -
How to call other Entity service
Hi,
How to call other Entity service to our entity service?
Regards
AshifHi,
I mean, need to call the other project entity service to my project application service, for example, am having the project with the name "aaa", and i wanna to get the entity services of the other project "xxx" to my project "aaa".
Can you please, let me know how to call the same.
provide me some links for the same.
Thanks -
How to create index attributes in CAF Entity Service
When one creates an entity service with external persistency (local persistency on the persistency tab is unchecked) you have to create at least one "key" attribute. However, how do you create "index" attributes to improve performance. Currently, if you add custom key you must select "key" checkbox in attribute wizard when creating an attribute and this key field must be unique. This is not what I am looking for. I'd like to create a few custom keys that the contents allow duplicate.
Hi Tom,
This is a very valuable question. Yes, you can add an index for specific fields to the generated database table. You can do in the NWDS, navigate to the dictionnary view and open the corresponding database table. Now you can add an index and assign database field(s) to this index.
However: you must be aware that, if the entity is changed (i.e. new parameters are added), the database table is re-generated and the indices are lost.
Regards,
Jan -
How to sort web dynpro table wich data bind to CAF Entity Service
Hi
I created UI Table based on Model Node (CAF Entity).
When I try to sort this Table with using TableSorter, I get following in the trace log:
The error is: com.sap.caf.rt.exception.CAFBaseRuntimeException: Aspect does not support changing rows via its list interface
Have I met CAF limitation, or do I do something wrong?Hi Nikolai,
if you use the implementation
<code>
IServiceFacade serviceFacade = CAFServiceFactory.getServiceFacade(ts2Definition.class);
</code>
it means you use the typed access.
Possible in this sneak the
<code>
IServiceFacade serviceFacade = CAFServiceFactory.getServiceFacade();
</code>
does not work.
Try the following way - it must work.
<code>
private IServiceFacade getServiceFacade() {
final String method = "getServiceFacade()";
entering(method);
if (m_serviceFacade==null) {
try {
CoolConnectionProperties properties = new CoolConnectionProperties()
public String getCoolHost()
return "caf";
m_serviceFacade = CoolUtils.getServiceFacade(properties);
} catch (CoolConnectionPropertiesException e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
CAFUIPublicLogger.traceThrowable(Severity.ERROR, method, e) ;
} catch (CoolUtilsException e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
CAFUIPublicLogger.traceThrowable(Severity.ERROR, method, e) ;
exiting(method) ;
return m_serviceFacade;
</code>
Also do not sort in query. Sort the model node after you aspect binded. Use the method
node.sort(your_comparator) ;
the comparator like this:
<code>
public class YourComparator implements Comparator
public int compare(Object o1, Object o2)
IWDNodeElement nodeElement1 = (IWDNodeElement) o1 ;
IWDNodeElement nodeElement2 = (IWDNodeElement) o2 ;
String name1 = nodeElement1.getAttributeAsText(_attrName) ;
String name2 = nodeElement2.getAttributeAsText(_attrName) ;
if (name1 == null)
return -1 ;
if (name2 == null)
return 1 ;
if (_direction == "up")
return name1.compareToIgnoreCase(name2) ;
else if (_direction == "down")
return -name1.compareToIgnoreCase(name2) ;
return 0 ;
public void initilize(String attrName, String direction)
_attrName = attrName ;
_direction = direction ;
private String _attrName ;
private String _direction ;
</code>
Best regards,
Aliaksei. -
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 -
Table Name Issue of CAF Entity Service
Hi All
I have a problem in the following scenario :--
I have created a CAF project named xflit_01 in local development. Another CAF project xflit_02 is created in local development of another machine's NWDS but both the project has a same entity service name,'Flight'. But one interesting observation from persistency tab of the entity service'Flight' is that for tables generated for both the entity services are same name, 'XAP_XFL_FLIGHT0001' where "XAP_XFL_" is namespace and "FLIGHT0001" is names. Both entity services are mapped with same external service.
Next I have deployed that two projects such as xflit_01 and xflit_02 in same central WAS from different machine's NWDS one by one. but how two tables with same name, 'XAP_XFL_FLIGHT0001' would be handle by WAS? But after the deployment we need to configure external service. So in External Service configuration window we are getting error when the link Service Registry is clicked.
Any idea will highly be appreciated.
Thanks
ChandanSolved by myself. Reason is for same db and CAF table naming convention
-
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 -
Error while building the DC for CAF 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 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. -
Problem when creating CAF Entity Service finder Methods
Guys,
Can any one please suggest me appropriatly to the below problem.
I am using NWDS 7.06. I have no problem when creating CAF project, Application Service and Entity Service even.
But in the Entity Service:
1. Add a string or longtext attribute.
2. try to create a custom finder method in operations tab, during that operation i am not finding the attribute which i have created in step1.
That means i am not able to create the my own finder methods with parameters.
I was able to do that in some version long ago but i have forgotten that NWDS version.
summary of Problem Is: " Cannot create custom methods with custom parameters in Entity Service"
Can you please suggest me the right version or a solution to this problem on urgent basis please.
I promise you that i will give you full points to you who ever gives me the right solution.
Please mail your suggestions to [email protected]Guys,
I have solved the problem successfully. Thanks for your attention. -
Problem in data source mapping - CAF entity service.
Hi,
I created an external service for the bapi given below.
It has 2 tables as input parameters.
In entity service I created attributes(for input parameters) for table1 and table2. but in data source i couldn't map more than one attribute to the MATNRSELECTION and PLANTSELECTION.The attributes of the bapi are under the same collection.
I'm using NWDS version 7.0.06.
BAPI_MATERIAL_GETLIST (To List all Materials for a Particular Plant)
Input Parameters:
Table1: MATNRSELECTION
MATNRSELECTION-SIGN
MATNRSELECTION-OPTION
MATNRSELECTION-MATNR_LOW
Table 2: PLANTSELECTION
PLANTSELECTION-SIGN
PLANTSELECTION-OPTION
PLANTSELECTION-PLANT_LOW
Regards,
Shobhendrain your entity if you did create 2 attributes for one material number and one for plant, you can map them to the corresponding MATNRSELECTION-MATNR_LOW and PLANTSELECTION-PLANT_LOW.
For the sign and option, you should uncheck the IsNull parameter in the "Entity to External Operation parameters" mapping window of the Datasource Tab of your entity. And you should set default values like sign = I and option = EQ or something like that.
But if you want to pass a list of material numbers or plants, I do have a recollection from last year experiments of some limitation using collections as input parameters. maybe somebody else had better success with that -
How to Trigger CAF web services from java Job schedulers?
Hi Experts,
I am in need of calling CAF based web services from custom Job scheduler.
Could you please provide your idea and input if anyway we can call such web service by java api in custom jobs development?
Thing is that we have CAF BO which hold around 1 million record (master data) and based on approval scenario (developed in WDJ apps) we will have to move this record to another business object for further manipulation?
Hence due to huge number of record in BO, I would like to automate this activity by calling Jobs from WDJ apps and then Job will trigger the CAF web service which would create record into the BO object.
Please share your idea and let me if it can be achievable by java apis to trigger Jobs by WDJ apps & webservice by jobs?
Thanks & Regards,
PankajHi Experts,
I am in need of calling CAF based web services from custom Job scheduler.
Could you please provide your idea and input if anyway we can call such web service by java api in custom jobs development?
Thing is that we have CAF BO which hold around 1 million record (master data) and based on approval scenario (developed in WDJ apps) we will have to move this record to another business object for further manipulation?
Hence due to huge number of record in BO, I would like to automate this activity by calling Jobs from WDJ apps and then Job will trigger the CAF web service which would create record into the BO object.
Please share your idea and let me if it can be achievable by java apis to trigger Jobs by WDJ apps & webservice by jobs?
Thanks & Regards,
Pankaj -
How to make Web Dynpro Search work using CAF Entity Service Method
Hallo everybody,
I'm facing a problem regarding CAF Method and I really need some help.
The Method I want use is a "Search by Key" method, which I already testet in Composite Application and it has worked.
But wenn I try to add the CAF Model in Web Dynpro and Apply the template in Component Controller, there was no input value there to be selected but only the return values. How can I make the method work?
Thanks a lot.Hallo everybody,
I'm facing a problem regarding CAF Method and I really need some help.
The Method I want use is a "Search by Key" method, which I already testet in Composite Application and it has worked.
But wenn I try to add the CAF Model in Web Dynpro and Apply the template in Component Controller, there was no input value there to be selected but only the return values. How can I make the method work?
Thanks a lot.
Maybe you are looking for
-
Itunes is unable to load provider data from sync services
When l plug my iphone4 into my laptop ,to try and take some playlists off the phone ,l get the message itunes is unable to load provider data from sync services ,, what am l doing wrong ,,l want to sort this problem out ,,thank you Pete ,
-
Load from InfoSource 0EMPLOYEE failed
Hi all, My source data contains some special characters in field TRFKZ.I maintained special characters using RSKC. Now when I load data uptill PSA it gets uploaded.but when i try to upload it to the infoobject level,it gets failed. The monitor messag
-
"we are unable to process your request please try again later" error message after restoring my iPhone! HELP!
-
How to protect java application
Hello all, Could you give me some clues on how to protect a java application? By license keys ? how to protect application by license keys? I am not sure about Signing JAR Files, is it what I need? Any better way than using license keys to protect a
-
DV tape wasn't recorded in LP or SP. Can i still import?
I'm trying to import footage on a tape that was recorded in someone else's camera while their camera was not set in LP or SP mode. is there any way to convert it? the video will play on the LCD screen on my camera, but it is jumpy, and won't play in