Do I need to create a view for this?

Hi Ihave got 2 tables emp and project
In emp tabe:
emp_no
family name
given name
In porgect table:
emp_no
status(assigned,unassigned)
start_date
end_date
emp_no Family_name given_name
1 Smith John
In project table same employee can have many assigement eg
emp_no status start_date end_date
1 assigned 01-may-08 01-july-08
1 assigned 01-sep-08 01-july-09
1 unassigned 01-july-09 01-oct-09
In the form:
there are 2 querable fields "project ends between field1(date) and field2(date)" which is used to
retrive records which have end date between field1 and field2.
The following fields are needed to get from database:
emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
Requirements:
1. project.start_date and project.end_date must be the latest project_end_date for the same emp
so in the above sample date
2. No. of time assigned is a count of total of number records which have status='assign'
So for the given sample data the record expected after query would be(field1=01-jun-08 field2=02-july-09)
emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
Smith John 01-sep-08 01-july-09 2
What is the best approach to get:
1 The lastest project(latest end_date) for the emp
2. get No.of time assigned.
Do I need to create a view for this? If yes, any sample sql code this this?
Thanks for your help

Hi W1zard,
Thanks for your reply. Could you clarify the following points for me:
1.) you could create a master block basing on your emp table and a detail block basing on your project table with the relation over emp_no. set the default_where clause of your detail block programmatically using
set_block_property('project', default_where, 'status = ''assigned'' and <your_date_criteria>');
Q1: where I pit this code? in pre-query trigger in detail block?
2.) Of course you could create a view to join both of your tables if you don't want to use master detail blocks; Also do the join over emp_no
create or replace force view v_emp as
select emp.family_name, emp.given_name, project.start_date, project.end_date
from emp, project
where emp.emp_no = project.emp_no
Q2 As I mentioned before, there are multipal entries for the same emp in project table and we only need the maching record from project table which has latest end_date. So I think I need something like
max(project.end_date) somewhere in create view to make sure only one record for one employee.
Also is there possible to include the no. of assigned field(select count(*) from project where status='assigned' and emp=emp_no) into the view as well?
Q3 All the fields mentioned above are diaplay-only. So Can I create a control block which has all the fields from emp and project. Then populate them with my sql. The question is
where I put this customerised sql so when user click excute query. My sql will run and display one the form?
REally appreciated your help!
Michael

Similar Messages

  • Need to create maintenance view for a custom infotype

    A custom infotype 90XX is created. The data cannot be modified or created through PA30 in this infotype. Through PA 40 actions only we can create/change the record/data. We have created some 1000 records in it. Now can we create a maintenance view for the infotype so that we can create, delete or change the data in the infotype as and when we want.

    Hi,
    pls chk dat u have maintained the 'Infotype Charecteristics' and 'Technical Attributes' correctly.
    thanks,
    teja.

  • [ADF Help] How to create a view for multiple tables

    Hi,
    I am using Jdeveloper 11G and ADF framework, and trying to create a view to update multiple tables.
    ex:
    Table A has these fields: ID, Name
    Table B has these fields: ID, Address
    A.ID and B.ID are primary keys.
    B.ID has FK relationship with A.ID
    (basically, these tables have one-to-one relation)
    I want to create a view object, which contains these fields: B.ID (or A.ID), A.Name, B.Address.
    So I can execute C,R,U,D for both tables.
    I create these tables in DB, and create entity objects for these tables.
    So there are 2 entity objects and 1 association.
    Then I create a view object based on B and add fields of A into the view:
    If the association is not a "Composition Association",
    when I run the model ("Oracle Business Component Browser") and try to insert new data, fields of A can't edit.
    If the association is a "Composition Association", and click the insert button, I will get
    "oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity"
    If I create a view object based on A and add filed of B into the view:
    When I run the model and try to insert new data, fields of B can't edit, no matter the association is or is not a composition association.
    So... how can I create a view for multiple tables correctly?
    Thanks for any advices!
    Here are some pictures about my problem, if there is any unclear point, please let me know.
    http://leonjava.blogspot.com/2009_10_01_archive.html
    (A is Prod, B is CpuSocket)
    Edited by: user8093176 on Oct 25, 2009 12:29 AM

    Hi Branislav,
    Thanks, but the result is same ....
    In the step 2 of creating view object, I can select entity objects to be added in to the view.
    If I select A first, and then select B (the "Source Usage" of B is A), then finishing the wizards.
    When I try to create a new record in the view, I can't edit any properties of B (those files are disabled).
    If I select B first, and then select A in crating view object, the result is similar ...
    Thanks for any further suggestion.
    Leon

  • HT5622 We are a family of 4, each with their own apple device. Is it best for us to set up individual apple ID's for things like ITunes? If we do can the same e-mail address be used for all of them or do we need to create e-mails for the kids? Thank-you

    We are a family of 4, each with their own apple device. Is it best for us to set up individual apple ID's for things like ITunes? If we do can the same e-mail address be used for all of them or do we need to create e-mails for the kids?
    Thank-you

    1. Yes, it is.
    2. You may be able to use the same address by adding a plussed suffix to it, such as [email protected] If that doesn't work, create separate emails.
    (103279)

  • Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    i am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    i exported the application from apex.oracle.com and imported it to our environment
    import went fine, but when I ran the IR page I got
    ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
    evidently the problem is a lack of public execute on DBMS_LOB, which is used in the generated IR source.
    while waiting for the DBA to grant privs on DBMS_LOB, changing the dbms_lob.getlength call to length() fixes the IR.
    however, i am not getting the download link on the associated form page... changed templates, that's not the issue -- we'll see if that's a dbms_lob issue as well

  • APEX:Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    I am using Apex 4.2.2.00.11
    am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    336554,
    Looks like there is a 127-column limit on the number of report columns supported when using that wizard. Do you have more than that?
    57434

  • What is the need of creating partner functions for sales document type.

    Hi SAP (SD-GURUS),
    Actually we create partner functions  before creating customer ex: sold to party, ship to party, bill to party, and payer.
    These partner functions are going to be copied into sales order while processing sales order.
    Again what is the need of creating partner functions for sales document type.
    Thanks&Regards
    sreenivas peruru

    There are some Partners you could enter at Sales ORder Level. E.g. Sales Person, Employee Responsible, Forwarding Agent, Broker, etc.
    Thus these partner Determination need to be carried out at Sales Order Level & not at Customer Master level.
    So we have to configure partner Determination for various levels e.g. Customer Master, Sales Order, Delivery level etc...
    Hope this helps...
    THanks,
    Jignesh Mehta

  • Need to Create a Check for Plant in WBS & Plant in Network

    Dear Guru's,
    While creating Project (CJ01) my users are creating in a Plant, and while creating network for the same project/WBS, they are using different Plant Code.
    Since my Profit center is related to the plant in CJ01,
    and because of wrong Plant in network, all my PR/ PO is going in a different Profit center, which is creating a huge problem while auditing.
    I need to Create a Check for Plant in WBS & Plant in Network...!!
    Kindly suggest me the ways to do it and how to do it...

    Hi Deepa,
    The Check you are trying to create between Plant defined at Project def and network level that should be same can be achieved through validation at the network level by using a user exit at network level.
                    While creating the network you can change the plant value not equal to the value at proj def/network profile may be one of the reason is since the network type is defined for more than one plant (OPUV).
                    While creating validations at network level we do not have the option of setting the prerequisite/check  using WBS or Proj def fields (i.e. PROJ-, PRPS- fields)    so we need to create a user exit at the network level.
    I am not sure but logically u can have a user exit for both prerequisite and check steps of the validation.
    You need to create the user exit in program ZGGBR000.
    Please take help from your Abaper for the same.
    OPSI-Network header-Validation- Step - Prerequisite u2013 Check u2013 Message.
    Prerequisite
    If Proj Profile = u2018XXXu2019 and Network Profile = u2018XXu2019 (or as per your logic if need be use a exit)
    CHECK.
    PROJ-WERKS = CAUFVD-WERKS   (This logic needs to be defined in user exit and set the same user exit at the check.)
    Once you define the user exit in ZGGBR000, it will be available in the tab u2018exitsu2019 at the Prerequisite and Check levels.
    The name of the form pool (e.g., ZGGBR000) that contains your user exit must be stored in table T80D.
    It is important that you make declare the code generation program for your user exit; how many and what type of parameters you are using for the user exit. You do this by entering your newly defined user exits in the form routine GET_EXIT_TITLES. Found in program ZGGBR000.
    Check with your Abaper to check on all the aboveu2026
    Message:
    Plant at Network level should be same as at Project def level.
    Hope it helps you,All the best..
    Regards
    Vinayak.

  • Creating Classification view for material through Standard Function

    hi,
    I have created the material code through BAPI_MATERIAL_SAVEDATA. For quality inspection i have used BAPI_MATINSPCTRL_SAVEREPLICA. i have to create classification view for that material code. Can anyone suggest me which standard function helps me to create the classification view.
    Thanks in advance.
    Senjey

    hi,
    i have tried that function module. I have mentioned the code below.
    i_object = '000000151860630000'.
    i_alloc_num-CHARACT = 'THICKNESS'.
    i_alloc_num-VALUE_FROM = '5.70'.
    append i_alloc_num.
    i_alloc_char-charact = 'SHAPES'.
    i_alloc_char-VALUE_CHAR = 'PLATE'.
    append i_alloc_char.
    clear  i_alloc_char.
    i_alloc_char-charact = 'CATEGORY'.
    i_alloc_char-VALUE_CHAR = 'CS'.
    append i_alloc_char.
    clear  i_alloc_char.
    CALL FUNCTION 'BAPI_OBJCL_CREATE'
      EXPORTING
        OBJECTKEYNEW            = i_object
        OBJECTTABLENEW          = 'MARA'
        CLASSNUMNEW             = 'RAWMATERIAL'
        CLASSTYPENEW            = '001'
      STATUS                  = '1'
      STANDARDCLASS           =
      CHANGENUMBER            =
      KEYDATE                 = SY-DATUM
      NO_DEFAULT_VALUES       = ' '
    IMPORTING
      CLASSIF_STATUS          =
      TABLES
        ALLOCVALUESNUM          = i_alloc_num
        ALLOCVALUESCHAR         = i_alloc_char
        RETURN                  = i_ret.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT = 'X'.
    But i am getting the error 'Assignment exists and is valid '.
    Please help.
    Regards,
    Sengathir.J

  • Do we need to create two zones for Two HBA for a host connected with SAN ?

    Hi,While creating Zone , Do we need to create two zones for Two HBA for a host connected with SAN ? Or a zone is enough for
    a host which having Two HBAs...We have two 9124s for our SAN fabric...
    As I found like one zone  below, I little bit confused that , if a host having two HBA connected with SAN, should I expect two zones for every Host?
    from the zone set, I gave the command show zoneset
    zone name SQLSVR-X-NNN_CX4 vsan 1
        pwwn 50:06:NN:NN:NN:NN:NN:NN
        pwwn 50:06:NN:NN:NN:NN:NN:NN
              pwwn 10:00:NN:NN:NN:NN:NN:NN
    But I found only one zone for the server's HBA2:by the same time in the fabric I found switches A & B showing the WWNs of those HBAs on its
    connected N port...Its not only for this server alone, but for all hosts..Can you help me to clarify on this please..that should we need to create one zone for
    one HBA?

    if u have two independent fabrics between hosts and storage, i think the below confs are recommended.
    Scenario 1:  2 HBAs single port each ( redundancy across HBA / Storage port )
    HBA1 - port 0 ---------> Fabric A ----------> Storage port ( FAx/CLx )
    HBA2 - port 0 ---------> Fabirc B ----------> Storage port ( FAy/CLy )
    Scenario 2: 2 HBAs of dual port each
    HBA1 - port 0 -------> Fabric A ---------> Storage port ( FAx/CLx )
    HBA2 - port0 ---------> Fabric A ---------> Storage port ( FAs/CLs )
    HBA1 - port 1 --------> Fabric A --------> Storage port ( FAy/CLy )
    HBA2 - port 1 ---------> Fabric B --------> Storage port ( FAt/CLt )
    the zone which is in your output is VSAN 1. if its a production VSAN, Cisco doesn't recomends to use VSAN 1 ( default vsan ) for production.

  • Do we need to create message interfaces for idocs and rfcs thatare imported

    do we need to create message interfaces for idocs and rfcs thatare imported
    from sap server
    in scenarios from sap system to file or vice versa
    i knew that we need not create message types
    do we also skip creating message interfaces

    hi,
    you create an abstract message interface for IDOC only if you want to use
    them in a BPM (integration process)
    for more about IDOCs have a look at my book:
    <a href="/people/michal.krawczyk2/blog/2006/10/11/xi-new-book-mastering-idoc-business-scenarios-with-sap-xi"><b>Mastering IDoc Business Scenarios with SAP XI</b></a>
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Do I need to create new group for standby redo log files?

    I have 10 group of redo log files with 2 members for each group for my primary database , Do I need to create new group for standby redo log files for the standby database
    Group#     Members
    ==============
    1              2
    2              2
    3             2
    4             2
    5             2
    6             2
    7             2
    8             2
    9             2
    10           2
    If So, The following statment is correct? or nto
    ALTER DATABASE ADD STANDBY LOGFILE GROUP 1 ('D:\Databases\epprod\StandbyRedoLog\REDO01.LOG',D:\Databases\epprod\StandbyRedoLog\REDO01_1.LOG');
    please correct me if am doin mistake
    becuase when I issue the statment I getting error message sayin the group is already created.

    Thanks John
    I just find the answer
    Yes, it's recomeded to add new group , for instnace If I have 10 group from 1 to 10 then the standby shoudl be from 11 to 20
    Thanks I found the answer.

  • How  to create classification view for material?

    HI All,
    How to create classification view for material? is there any function  module?
    pls let me know.
    Bandi

    check the standard include "LCLBPAU14" this is using the following F.M
    call function 'BAPI_OBJCL_CREATE'
    exporting
    objectkeynew = l_object
    objecttablenew = l_objecttable
    classnumnew = classnum_new
    classtypenew = l_classtype
    status = status
    standardclass = standardclass
    changenumber = changenumber
    keydate = keydate
    no_default_values = no_default_values
    importing
    classif_status = classif_status
    tables
    allocvaluesnum = allocvaluesnum
    allocvalueschar = allocvalueschar
    allocvaluescurr = allocvaluescurr
    return = return.

  • Call transaction for pop2.need to create packing instructions for materials

    while assigning  packing instruction to the materials from table mara.
    its unable to create a new line item in the screen. ex: only 8 records are saved
    but needs to proceed for other materials increasing the line item no.
    options of create new material ( ok code'=INLI', , create new entry('=INMA')
    and even tried for page down option '=P++'. is not working.
    Can anyone help me in creating more than 100 line items.
    Thanks in Advance,
    Sushma

    Hi,
    Why do you want to create the varient for this?
    what is your actual requirment?
    Regards,
    Sachin

  • How to create thumbnail view for html files

    hi,
    I want to create thumbnail view for html files, not for image files.. can we treat html files as images..
    Anybody help me..

    You can right click on your Desktop and select New Folder.  In Finder File > New Folder should work too, not in front of my Mac.
    Welcome to back by the way.  You might find these websites helpful.
    Switch 101
    Mac 101

Maybe you are looking for