Creating ViewObject from Entity object

HI,
Is it possible to modify the query of the view object? And I have created that view object from EntityObject.
Regards,
Infy

Hi Arun,
Thanks for your reply. My query has union of 8 different queries. I have created Association between them. But while creating view object, I am getting struck in choosing the association & join type. Can I use expert mode? View object is getting displayed. But when I try to insert any rows, it is throwing errors. My JDev version is, 11.1.2.2.0.. Here is the query:
<SQLQuery><![CDATA[
Select * from (Select a.Appr_Comment Remarks,
a.placeholder_seq placeholder_Seq,
a.Comment_Seq comment_Seq,
b.Dph_Id Placeholder_Id,
Decode(b.Format,Null,c.default_value,To_Char(To_Date(c.Default_Value,'DD-MON-YYYY HH24:MI:SS'),b.format)) Value,
b.label_id label_Id,
b.version_no version_No,
a.user_id user_Id,
0 text_dir,
'N' is_obsolete,
'NA' Cph_Format,
b.tph_placeholder_seq Ph_Version
From Approver_Comments a,
Label_Placeholders b,
Data_Placeholders c
Where a.Label_Id=b.Label_Id
And a.Version_No=b.Version_No
And a.Placeholder_Seq=b.Placeholder_Seq
And b.Dph_Id=c.Placeholder_Id
And b.Dph_Id Is Not Null
Union
Select a.Appr_Comment Remarks,
a.placeholder_seq placeholder_Seq,
a.Comment_Seq comment_Seq,
b.Vph_Id Placeholder_Id,
c.Default_Value Value,
b.label_id label_Id,
b.version_no version_No,
a.user_id user_Id,
0 text_dir,
'N' is_obsolete,
'NA' Cph_Format,
b.tph_placeholder_seq Ph_Version
From Approver_Comments a,
Label_Placeholders b,
Visit_Ph c
Where a.Label_Id=b.Label_Id
And a.Version_No=b.Version_No
And a.Label_Id=c.Label_Id
And a.Version_No=c.Version_No
And a.Placeholder_Seq=b.Placeholder_Seq
And b.Vph_Id=c.Placeholder_Id
And b.Vph_Id Is Not Null
Union
Select a.Appr_Comment Remarks,
a.placeholder_seq placeholder_Seq,
a.Comment_Seq comment_Seq,
b.rtph_id Placeholder_Id,
c.Default_Value Value,
b.label_id label_Id,
b.version_no version_No,
a.user_id user_Id,
0 text_dir,
'N' is_obsolete,
'NA' Cph_Format,
b.tph_placeholder_seq Ph_Version
From Approver_Comments a,
Label_Placeholders b,
rtph c
Where a.Label_Id=b.Label_Id
And a.Version_No=b.Version_No
And a.Label_Id=c.Label_Id
And a.Version_No=c.Version_No
And a.Placeholder_Seq=b.Placeholder_Seq
And b.rtph_id=c.Placeholder_Id
And b.rtph_id Is Not Null
Union
Select a.Appr_Comment Remarks,
a.placeholder_seq placeholder_Seq,
a.Comment_Seq comment_Seq,
b.ftph_id Placeholder_Id,
c.placeholder_data Value,
b.label_id label_Id,
b.version_no version_No,
a.user_id user_Id,
d.text_direction text_dir,
'N' is_obsolete,
'NA' Cph_Format,
b.tph_placeholder_seq Ph_Version
From Approver_Comments a,
Label_Placeholders b,
freetext_ph c,
languages d
Where a.Label_Id=b.Label_Id
And a.Version_No=b
.Version_No
And a.Label_Id=c.Label_Id
And a.Version_No=c.Version_No
And a.Placeholder_Seq=b.Placeholder_Seq
And b.ftph_id=c.Placeholder_Id
And b.ftph_id Is Not Null
And b.LANG_CD = d.LANG_CD
Union
Select a.Appr_Comment Remarks,
a.placeholder_seq placeholder_Seq,
a.Comment_Seq comment_Seq,
b.tph_id Placeholder_Id,
c.description Value,
b.label_id label_Id,
b.version_no version_No,
a.user_id user_Id,
d.text_direction text_dir,
nvl(c.IS_OBSOLETE,'N') is_obsolete,
'NA' Cph_Format,
b.tph_placeholder_seq Ph_Version
From Approver_Comments a,
Label_Placeholders b,
phrase_translation c,
languages d
Where a.Label_Id=b.Label_Id
And a.Version_No=b.Version_No
And a.Placeholder_Seq=b.Placeholder_Seq
And b.tph_id=c.Placeholder_Id
And b.Tph_Placeholder_Seq=c.placeholder_seq
And b.Lang_Cd=c.Lang_Cd
And b.tph_id Is Not Null
And b.LANG_CD = d.LANG_CD
Union
Select a.Appr_Comment Remarks,
a.placeholder_seq placeholder_Seq,
a.Comment_Seq comment_Seq,
b.Cph_Id Placeholder_Id,
LABDB07.Cph_Value(b.Label_Id,b.Version_No,b.Cph_Id) Value,
b.label_id label_Id,
b.version_no version_No,
a.user_id user_Id,
0 text_dir,
'N' is_obsolete,
LABDB07.Cph_Format(b.Label_Id,b.Version_No,b.Cph_Id) Cph_Format,
b.tph_placeholder_seq Ph_Version
From Approver_Comments a,
Label_Placeholders b
Where a.Label_Id=b.Label_Id
And a.Version_No=b.Version_No
And a.Placeholder_Seq=b.Placeholder_Seq
And b.Cph_Id Is Not Null) order by comment_Seq
]]></SQLQuery>

Similar Messages

  • Calling database stored  function from Entity Object

    Hi,
    I want to call a database stored function from create() method of Entity Object.
    Database function returns some value.
    Can anybody suggest me some way to do it.

    You can try the following:
    make a String whit your function call, I dont know if this is the correct SQL syntax for a function, it should be for a stored procedure.
    String call = "begin; callyourfunction; end;"
    PreparedStatement ps = getDBTransaction().createPreparedStatement(call,0);
    ps.execute();
    ResultSet rs = ps.getResultSet();
    You can now read the data from the function from the rowset.
    Be sure to cleanup the PreparedStatement when your done whit it to avoid open database connections.
    ps.close();ps=null;

  • Unable to create DIR from the objects

    Hi,
    I want to create the DIR from the object  transaction, eg., Purchase Order, I have set "1" - Create Simple Document under Define Object Links for that particular Document type, But despite this config, I am not getting the "create" button. whereas I have assigned the same document type to another Object link Appropriation Request, and I am able to create DIR from the object transaction itself. Upon, exploring the system, I found that the Purchase order uses the Program "SAPLCVOB" screen"0200" whereas Appropriation request has Program "SAPLCV140" screen"0204" So, I presume that the configuration affects only SAPLCV140 and it has no affect to SAPLCVOB. Or is there any other way to create the DIR directly from the objects which uses SAPLCVOB program? My user wants to create DIR directly from PO.

    Dear Mohamed,
    To grant that allways the currenct screens and authorizations were
    called please maintain also the value "1" into the "Authorization"
    column. For further informations on this maintainance please see the
    SAP note 1066915. It's important that you not enter the mentioned
    screen number wihtout the leading "1" as this number is added
    automatically by the system (e.g. object MARA 1201 maintain like MARA
    201). You can do this in customizing under:
    Transaction SPRO
    > Cross-Application-Component
        > Document Management
             > Control Data
                 > Define screen for object links
    If you need the dynpro number or object you will find all standard SAP
    objects and their screen number in function module CV130 (Screens) by
    transaction SE80. Please maintain all necessary SAP objects.
    Best regards,
    Christoph

  • How to call Apps Module Custom Method from Entity Object / View Object ?

    Hi All,
    I create a custom method in AppsModuleImpl.java. How can I call that custom method from a setter method on Entity Object / View Object ?
    (I have tried to use Configuration.createRootApplicationModule(amDef,config); but it is not the correct way, is it? )
    Below is my code :
    The setter on MyEntityImpl.java :
    public void setKodeprd(String value) {
    setAttributeInternal(KODEPRD, value);
    if (getProduct() != null) {
    // CALL the getSalesPrice custom method from here, HOW ??
    The Application Module custom method :
    public Number getSalesPrice(String priceCode, String kodePrd) {
    Number price = new Number(0);
    String [] theKey = {priceCode, kodePrd};
    Key priceKey = new Key(theKey) ;
    ViewObject SalesPrice = getSalespricedView1();
    Row[] salesPriceRow = SalesPrice.findByKey(priceKey, 1);
    price = ((SalespricedViewRowImpl)salesPriceRow[0]).getPrice();
    SalesPrice.remove();
    return price;
    Thank you for your help,
    xtanto

    inside the EntityObjectImpl :
    YourAppModuleImpl am = (YourAppModuleImpl)getDBTransaction().getRootApplicationModule().findApplicationModule("YourAppModuleorServiceName");

  • Transient attribute  in viewobject and entity object

    i added a transient attribute to an entity object . Then, for the view object based on that entity object, i added this transient attribute. The attribute name is Department Description. When i display the record(s) from this view object, everything is cool. But, when i try to create/insert a new record, i get error:
    JBO-27019: Get method for attribute "DepartmentDescription" could not be resolved. What is going on here and what do i need to change to create/insert a new entity row which has a transient attribute?
    As well as i added trasient attribute in view object also ....same erroe is comming ..................
    Thanks inadvance

    Hello Siva,
    have you already solved your problem?
    I have a very similar error.
    Thanks.
    Peter

  • How to invoke Application Module method from entity object methods

    Hi,
    We have an existing Application Module which provides some validation logic. We are using OperatingBinding or getting the Application Module instance from the bindings and then invoking the app module methods in the view controller project.
    But in our current scenario, We need to invoke the application module method from the setAttribute method in the entity object when ever an entity attribute value is changed . I believe we can call createRootApplicationModule method to create application module instance. But this may lead to performance overhead.
    Can you please suggest, if there is any alternative to invoke the application module method inside the business components.
    What is the best way to create

    We have a pricing service, which was developed as a separate application. We need to invoke the pricing service with the change in certain attributes of the entity object and update some of the attributes of the current entity object. At present we are handling these calls to the pricing service in the ui layer in the valueChangeListener.
    But we would like to move this service call into setAttribute method as we are unable to prevent the call to the service if the model validations fail. I am looking for the best possible approach for invoking the service calls from the entity objects.
    Thanks and Regards,
    S R Prasad

  • Calling stored procedures from entity object and application module

    Hello
    I've put in place an EntiyImpl base class containg helper methods to call stored procedures.
    I now need to call stored procedures from the application module.
    Apart from creating an application module base class and duplicating the helper method code is there a way
    to share the helper methods for calling stored procedures between the entity impl and application module impl ?
    Regards
    Paul

    Does the helper code depend on features of a particular entity object instance, beyond its database transaction?
    If so, I'm not sure I see how it could be used from an application module class.
    If not, here's what you do:
    Step 1:
    Parametrize the database transaction--you might even want to. So instead of
    protected myHelperMethod(Object someParam) {
    DBTransaction trans = getDBTransaction();
    change this to
    protected myHelperMethod(DBTransaction trans, Object someParam) {
    Step 2: make the method public and static--once you parameterize the DBTransaction, you should be able to do this.
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    Step 3: Remove the method from your EntityImpl base class into a utility class:
    public abstract class PlSqlUtils {
    private PlSqlUtils() {}
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    When you want to call the method from an application module, entity object, or even view object class, call
    PlSqlUtils.myHelperMethod(getDBTransaction(), paramValue);
    Unlike Transaction.executeCommand(), this lets you provide functionality like setting procedure parameter values, retrieving OUT parameter values, etc.
    Hope this helps,
    Avrom

  • Jdev aborts when removing attribute from entity object

    Hi,
    after synchronizing my data model with my database scheme, jdeveloper 10g gave me the correct message, that there had been 1 attribute left in an entity object, that does no longer exist in the database.
    When removing the attribute from the entity object, jdev 10g aborts (first click: nothing happens, second click: abort).
    regards
    Klaus

    Thanks for bug report. This bug has been logged (3151203) and has been fixed in more recent builds.
    Ray

  • Error Extending the OAEntityImpl class when creating a BC4J  Entity Object

    I have created an EO based on an Oracle Apps table and extended the OAEntityDefImpl, OAEntityCache and OAEntityImpl classes as specified in the OA Framework Developers Guide when creating EO's via the BC4J wizard.
    When I build my Business Components package I recive an error stating that the Impl class should be declared abstract.
    Error(14,8): class oracle.apps.xxtpc.arinvoices.schema.TpcApInvoicesEO2Impl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) in class oracle.apps.fnd.framework.server.OAEntityImpl
    When I modify this class to declare it abstract and then try to test (via the AM test function) the VO that I created based on this EO - I receive an oracle.jbo.RowCreateException: JBO-25017.
    Do you think that this has anything to do with modifying the Impl class to make it abstract? I can create another VO against the same table by creating a SQL statement against it and not basing it off of the EO and this VO will run correctly via the AM tester.
    Thanks,
    Chris
    oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for TpcApInvoicesEO.
         at oracle.jbo.server.EntityDefImpl.createBlankInstance(EntityDefImpl.java:1054)
         at oracle.jbo.server.ViewRowImpl.createMissingEntities(ViewRowImpl.java:1532)
         at oracle.jbo.server.ViewRowImpl.init(ViewRowImpl.java:236)
         at oracle.jbo.server.ViewDefImpl.createBlankInstance(ViewDefImpl.java:1050)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1007)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2643)

    The problem was that there were no audit columns in the table that I was querying.

  • Create empty blob inside create method of entity object

    I would like to create an empty blob with this method:
    BlobDomain.createEmptyBLOB(java.lang.Object context)
    context - an internal framework context.
    The problem I've got it is to figure out what is the framework context and how to get one.
    thanks

    John,
    I did not try with af:popup. But I did try with custom error handler and it worked as if I thought.
    To help others I am explaining the steps below:
    1. Create the custom error handler(MyErrorHandler.java) class by extending it from oracle.adf.model.binding.DCErrorHandlerImpl. Make sure that your java class contains a no argument constructor.
    2. Override reportException() method by sending the arguments to super.report exception()
    3. write code to call javascript through Extended Render Service Kit.
    4. Open DataBindings.cpx and its property inspector
    5. Select the root node of DataBindings.cpx and add your custom error handler class (MyErrorHandler.java) to the attribute "ErrorHandlerClass"
    6. Run your code.
    Voila!!! It runs great!!!
    For more information, check http://docs.oracle.com/cd/E24382_01/web.1112/e16182/validation_model.htm
    V. Praveen

  • Need to call storeprodure from entity object model in visual webpart

    Getting error
    Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
    How to resolve it.
    Thanks,
    Siva.

    Hi,
    1. Open Toos > Nuget Package Manager > Package Manager Console
    then run
    install-package entityframework -version 6.0.0.0
    2. Try to copy EntityFramework.dll to the bin folder under Solution.
    3. Try to copy EntityFramework.dll  to SharePoint web application bin folder.
    C:\inetpub\wwwroot\wss\VirtualDirectories\<port>\bin
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Creating Entity Object from Service Interface - JDeveloper version 11.1.1.3

    In our project, we don't intend to have any JDBC connection to a database and want to create all my entity objects using SDO web services deployed in a remote server. I could create an entity object based on a SDO web service deployed in the standalone WL server successfully. But at the time of Development,when I select ADF Business Component --> Entity Object, it always takes to a screen that prompts for a JDBC connection, if you have no connection defined in the project yet. To bypass this, I need to create a valid connection to a local DB and then I can go the next page that prompts me to to choose service interface and asks for a WSDL URL. How do I get around creating a JDBC connection and create a service interface based data source directly?
    To get around this issue, I created a connection to a local DB by providing a wrong password to make sure that we don't need a valid db connection. The application module (Business Component Browser) works fine when the DB connection is broken. But when I create a JSF page and put the data control there, if we don't have the DB connection established it gives error during deployment.I tried deleting the unused connection, but that gives a lot of errors during deployment. My question is;
    1. How can I create a service interface based data source by-passing the requirement for a connection?
    2. If that's not possible - how can I cleanly delete the JDBC connection and all it's dependencies, so that, it deploys and runs without error

    Frank,
    Thanks for your response.
    I have made some progress in last two days and solved some of the original issues. I deleted the fake JDBC connection from connection.xml that I had to use to go to the second screen that lets me select the WSDL for the service interface. After that, I checked off the "Auto Generate and Synchronize ..." option from Application --> Application Properties --> Deployment. (thanks to Steve Muench's blog post on this subject). After that, I could deploy the JSF page and the page shows up with no problem.
    However, when I try to run the App Module that was created from the WSDL (service interface), it brings up a pop-up with heading "Password Required" that says "Enter the password for" and asks for a user name and password (not sure what they are as they take any value and takes me to the next screen). After that, I can open the View and navigate through it. When i change some data and try to commit - it makes the change to the data and stores in the DB but gives an error saying "(oracle.jbo.NotConnectedException) JBO-25200: Application module is not connected to a database."
    Also, the data control created from the service interface had operations called Commit and Rollback. I used the Commit on JSF page and that does the exact same thing too. Any idea?
    Also - when we consume a SDO WSDL to create the entity object - how can we access the SOAP Request and Response objects? We have to implement WS-Security by instrumenting the SOAP header and need to get a handle on that. Is there a mechanism similar to JAX-WS handler framework for SDO?
    R,
    Chandan

  • Problem with database schema objects in the entity object wizard

    Hi All,
    When creating a new entity object, I am facing a problem with database schema objects in the entity object wizard, database schema objects (check boxes for tables,synonyms...) are disabled. Actually I am using a synonym but I am not able to select the synonym check box.
    Can any of you folks tell me how to enable the database schema objects (check boxes for tables,synonyms...).
    Thanks in Advance.
    Raja.M

    Make sure your using rite version of jdeveloper..
    Make sure your using apps schema and check whether your able perform DML operations in the schema vis sql developer.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • Not able to create DIR from PR line Item

    Dear Friends,
    I have Cretaed Doc Type "CON" and entered "EBAN - Purchase Req. Item" in the object link and in Create Document I have mentioned " 1 - Create simple document".
    When I try to create a DIR from PR Line Item, there is no option or a logo in the Popup  where I can click and create DIR from The Object PR Line Item.
      I get the create Document icon in WBS element for same document type.
    Can anybody guide me the if I have missed any config.
    With Warm Regards
    Mangesh Pande
    Edited by: MANGESH PANDE on May 23, 2011 11:33 AM

    Screen calling is controlled by MM module -
    check
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=68747578
    I dont think its possible to create document from PR

  • Setting permissions at entity object level using JAAS and LDAP

    Hi,
    I am using ldap-based provider for authorizaton. Every thing works fine. Authorization works fine based on the roles created in web.xml file.
    Could you please let me know how I can define permissions at entity object level when using ldap based provider.
    Following line is the permission created for an entity object (SpcStrBdgt) when using XML-based provider.
    <permission>
         <class>oracle.jbo.server.security.jazn.JboJAZNEntityPermission</class>                    <name>model.SpcStrBdgt/READONLY</name>
    </permission>
    Above is defined in jazn-data.xml file.How can I define the same thing when using ldap-based provider?
    Thanks,
    Seatre

    Hi,
    There is an enhancement request Bug2692994 for this feature.
    Thanks,
    Yvonne

Maybe you are looking for

  • Help needed for data updation in User Defined Tables

    Hello Experts, I am developing one add-on in SAP B1 8.8 to input data in a User Defined Table described as under Table Name DriverMst UDT Type is No Object Description Stores the Driver master data which are used to get reference in Sale Delivery For

  • XI - Mail adapter scenario

    I am working on a scenario where XI will send the xml to the receiver via e-mail. I am not getting any e-mail from the XI system. Can I specify gmail or yahoo account ids along with the property settings? Do I have to do anything on the SCOT transact

  • BUG: 1.4.1 beta doesn't like to be in an IFRAME that moves.

    If you are using 1.4.1 beta in an IFRAME which position can be moved by javascript for instance, the plugin will grey out and not refresh. 1.4.0 work perferctly in this regard.

  • How do I get my music off a laptop on to iPad

    How do I get my music from ex hard drive or laptop onto my new iPad?

  • How long to repair permissions

    Got the grey screen...trying to fix with repair permissions...any idea how long it might take to run the repair....I have a 250G drive with about 120G of it used. I am asking just so I know if at some point I should give up....or just leave it for a