"Use one as many "function

Hi All
I have a scenario from RFC to WSDL in which if certain conditions fulfil only then can I pass the value to the target field "SERVCODE".
The problem is there are many conditions which are to be fulfilled to have the value passed.
I tried using the function "use One As Many" but I got stuck at the "OR" condtion because its taking only boolean values.
Please have a look at the scenario and help me!!
Also I am preferring to have a graphical mapping but if nothing works out User defined function would do.
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS <> BLANK & MARA-MATKL = 800001031----
then  SERVCODE = 400 (400 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS<> BLANK & MARA-MATKL <> 800001031 & VBAK u2013AUART = Z000 & MVKE u2013 MVGR2 = 001 -
then   SERVCODE= 201(201is the Value to be passed to the target field  to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS <> BLANK & MARA-MATKL <> 800001031 & VBAK u2013AUART = Z000 & MVKE u2013 MVGR2 = 002 -
then  SERVCODE= 202 (202 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS <> BLANK & VBAK u2013AUART = Z001& MVKE u2013 MVGR2 = 001 -
then SERVCODE= 301(301 is the value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS <> BLANK& VBAK u2013AUART = Z001 & MVKE u2013 MVGR2 = 002 -
then SERVCODE= 302 (302 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV <> Z004 VBAP-AUART = Z000 -
then  SERVCODE = 1 (1 is the Value to be passed to the target field to SERVCODE)     
u2022     IF VBAP-PSTYV <> Z004 VBAP-AUART = Z001 -
then  SERVCODE = 101(101 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS = BLANK &VBAP-AUART = Z000 & MVKE-MVGR2 = 001 -
then SERVCODE = 201(201 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS = BLANK & VBAP-AUART = Z000 & MVKE-MVGR2 = 002 -
then SERVCODE = 202(202 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS = BLANK & VBAP-AUART = Z001 & MVKE-MVGR2 = 001 -
then SERVCODE = 301(301 is the Value to be passed to the target field to SERVCODE)
u2022     IF VBAP-PSTYV = Z004 & VBAP-UEPOS =BLANK & VBAP-AUART = Z001 & MVKE-MVGR2 = 002----
then SERVCODE = 302 (302 is the Value to be passed to the target fieldto SERVCODE)
Thanks a lot in advance !!

You may post it on a wrong forum.  Here is SAP Business One Core forum, a forum dedicate to SAP Business One - a solution to SME.  Please close your thread and try this forum to start:
Process Integration (PI) & SOA Middleware
Thanks,
Gordon

Similar Messages

  • Message mapping: one as many, function node

    hi
    how to use - one as many - function node in mapping. i want to mapping one value from source structure to many fields in target structure. but i dont know the exact functionality of - one as many -
    kindly solve my issue
    regards
    mano

    Hi,
    Check out this example from SAP, which demos the use of the function oneAsMany:
    [http://help.sap.com/saphelp_nw04/helpdata/en/38/85b142fa26c811e10000000a1550b0/frameset.htm]
    Hope this helps,
    Sumant.

  • Context Problem when using Use One As Many

    Hi SapGuru's.
    i have got a requirement in an IDOC To File Interface where the segments in the IDOC are like E1LFA1M->E1LFM1M->E1WYT3M
    THE Test data is like below
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:IDOC_Test_Mt xmlns:ns0="urn:sap.shoprite.co.za:ecc.md">
       <ZCREMAS>
          <IDOC>
             <E1LFA1M>
                <LIFNR>0000641065</LIFNR>
                <E1LFM1M>
                   <EKORG>1001</EKORG>
                   <E1WYT3M>
                      <PARVW>BA</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>LF</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>RS</PARVW>
                   </E1WYT3M>
                </E1LFM1M>
             </E1LFA1M>
             <E1LFA1M>
                <LIFNR>0000641065</LIFNR>
                <E1LFM1M>
                   <EKORG>1002</EKORG>
                   <E1WYT3M>
                      <PARVW>BA</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>RS</PARVW>
                   </E1WYT3M>
                </E1LFM1M>
             </E1LFA1M>
             <E1LFA1M>
                <LIFNR>0000641065</LIFNR>
                1002
             </E1LFA1M>
             <E1LFA1M>
                <LIFNR>0000641065</LIFNR>
                <E1LFM1M>
                   <EKORG>1004</EKORG>
                   <E1WYT3M>
                      <PARVW>BA</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>LF</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>RS</PARVW>
                   </E1WYT3M>
                </E1LFM1M>
                <E1LFM1M>
                   <EKORG>1005</EKORG>
                   <E1WYT3M>
                      <PARVW>BA</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>LF</PARVW>
                   </E1WYT3M>
                   <E1WYT3M>
                      <PARVW>RS</PARVW>
                   </E1WYT3M>
                </E1LFM1M>
             </E1LFA1M>
          </IDOC>
       </ZCREMAS>
    </ns0:IDOC_Test_Mt>
    the Target xsd is like below :
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="urn:sap.shoprite.co.za:demo.trans" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap.shoprite.co.za:demo.trans" xmlns:p1="urn:sap.shoprite.co.za:bluecube">
       <xsd:import namespace="urn:sap.shoprite.co.za:bluecube"/>
       <xsd:element name="Vendor_masterTest1" type="p1:Vendor_masterTest"/>
    </xsd:schema>
    the EKORG Field from source is mapping to Purchase Organisation(field) in target file .
    so here when i use one as many and iam mapping EKORG->MAP WITH DEFAULT ->USE ONE AS MANY and as in the above test data if there are multiple E1LFM1M's the first paramter of Use one as many is getting 2 ekorg's in only one context but here i want them to be created on separate context(please have a look at 4th E1LFA1M in the test data to get clear idea.
    can any of you help me in this.
    regards.
    Varma

    Hi,
    Try this.
    Source Code:
    IDOC
    --->E1LFA1M
                    -->E1LFM1M
                          --> EKORG = 1000
                          --> E1WYT3M
                          --> E1WYT3M
                    -->E1LFM1M
                    -->E1LFM1M
                          --> EKORG = 1001
                          --> E1WYT3M
                          --> E1WYT3M
                    -->E1LFM1M
                          --> EKORG = 1006
                          --> E1WYT3M
                          --> E1WYT3M
    Output:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:target xmlns:ns0="http://test">
    <Data>
       <M>1000</M>
    </Data>
    <Data>
       <M>1000</M>
    </Data>
    <Data>
       <M></M>
    </Data>
    <Data>
       <M>1001</M>
    </Data>
    <Data>
       <M>1001</M>
    </Data>
    <Data>
       <M>1006</M>
    </Data>
    <Data>
       <M>1006</M>
    </Data>
    </ns0:target>
    Use below Mapping:
    Use If then Else Function.
    1. If condition: E1WYT3M Exists
    2. Then pass E1WYT3M
    3. Else Pass E1LFM1M with "Map with Default"
    Lets Consider Output of this step as "A".
    Use One As Many.
    First Input: E1LFM1M to exists to Split By Each Value
    Second and Third Input will be Out Put of "A" (Above Step).
    Lets Consider Out put of this Step as "B"
    Use If without Else.
    If "B" is true then pass "A"  to exists.
    Out put  of this to Remove context to Target Vendor Master Node. In my sample it will be Node "Data"
    Now for Mapping of Field Purch Org/In my case field "M"
    Use If without Else.
    If "B" is true then Pass "C". Output of this to Split by each value to target.
    For C:
    Use if then else
    if E1WYT3M exists then pass EKORG else pass constant blank.
    Hope its clear!!
    -Gouri

  • Difference between copy value and use one as many

    hi
    what  is the difference between copy value and use one as many?
    thanks

    [http://help.sap.com/saphelp_nw2004s/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm]
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm]
    Much better understanding of UseOneAsMany: [http://help.sap.com/saphelp_nw2004s/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm]
    Edited by: Praveen Gujjeti on Feb 18, 2010 11:42 AM

  • How to use one ResultSet many times in a jsp page ?

    Hi all,
    I have .jsp page and I have used it to get data from DB and display them to users. So I have to get data from DB in number of places in this particular jsp.
    I thought that it is better to have one ResultSet for entire page and once it is done its job, the ResultSet will be closed and I can use it again and again like this.
    Resultset rs = new ResultSet();
    try{
        //My operations
    }catch(Exception ex){
       //Handle Exceptions
    }finally{
       rs.close();
    }After above code snippet I can use same ResultSet again below the page.
    I just want to know this,
    1. is this a good coding practice?
    2. Should i put rs = null; within finally clause?
    any help will be appreciated
    thank in advance,
    Dilan.

    Ok, Finally I switched my coding to use DAO and DTO, and I learned it through internet.
    I removed all of data access codes from my jsp file(lets say 'functions.jsp'). I then created one interface and two clasess.
    here is my DAO interface.
    public interface UserFunctionsDAO{
        public List<UserFunctionsDTO> selectUserList();
    }here is DTO class
    public class UserFunctionsDTO{
        private String category = "";
        private String sub_category = "";
        private int cat_id = 0;
        private int sub_cat_id = 0;
        public UserFunctionsDTO(){}
        public UserFunctionsDTO(String category, String sub_category, int cat_id, int sub_cat_id){
            this.category = category;
            this.sub_category = sub_category;
            this.cat_id = cat_id;
            this.sub_cat_id = sub_cat_id;
        //Setters and getters will go here.
    }my concrete data access class is like this.
    public class UserFunctionsDataAccess implements UserFunctionsDAO{
        MyDB dbObject = null;
       private static final String SQL_GET_DISTINCT_CAT= "SELECT DISTINCT cat FROM cat_table";
       public List<UserFunctionsDTO> selectUserList(){
           dbObject = new MyDB();
           dbObject.sqlSelect(SQL_GET_DISTINCT_CAT);
           ResultSet rs = dbObject.getResultSet();
           ArrayList list = new ArrayList();
           while(rs.next()){
               list.add(new UserFunctionsDTO(rs.getString('category'), .......................));
           return list;     
    }I think now im following good coding practices, but I have one problem.
    1. How do I retrieve this userlist from my jsp page?
    2. Should I include UserFunctionsDTO in my jsp page as a bean?
    3. If I include it, how can I get the list from it?
    thanks in advance,
    Dilan.

  • Use one as Many

    Hi
    When we use this node function why we need the third parameter ? We already mentioned the parameter to be used many times and the number of times it should appear by the first two parameters itself ? So why we need the third paramter ? I went through help website but couldn't make out
    Radhika

    this standard SAP example should clarify your doubt.
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm]
    Third parameter is useful, for getting the same context changes from source to target.
    Edited by: Praveen Gujjeti on Mar 24, 2010 12:14 PM

  • Use on as many ----Function.

    Hi,
      Can one one explanins me USEONEASMAny function.
    also please advice me can i use this function for below mentioned purpose.
    I have scnerio like  this.
    Source --- IDOC
    Target -
       <Message_List>
                      <Message>
                       </Message>
                       </Message_ List>
    If in source E1DB02-FIIKWAER gets 2 different currencies i need to get to Message tabs in target  Liek this
                       <Message_List>
                      <Message>----
    Currency 1
                       </Message>
                       <Message>----
    Currency 2
                       </Message>
                       </Message_ List>

    Hi
      useOneAsMany function
    refer the link
    http://help.sap.com/saphelp_nw04/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/frameset.htm
    regards
    yugapreetha

  • One to many relationships

    Hi I have a big problem :)
    I want to use one to many relationships.
    One yable with primary key, foreign key view_id. The second table on the many side with primary key view_id and another primary key.
    The problem is that ejbc gives the followin error:
    " [java] In relationship 'ViewType-SView', role 'ViewType-Has-SView', a weblogic-relationship-role element contains the wrong number of column mappings. A single column mapping must be given for each primary key column in the bean referenced by the mapping."
    And that makes no sense for me. Any ideas?

    weblogic-relationship-role element column mappings should be the same as defined in
    <ejb-relationship-role>
    <multiplicity></multiplicity>
    </ejb-relationship-role>
    Erno wrote:
    Hi I have a big problem :)
    I want to use one to many relationships.
    One yable with primary key, foreign key view_id. The second table on the many side with primary key view_id and another primary key.
    The problem is that ejbc gives the followin error:
    " [java] In relationship 'ViewType-SView', role 'ViewType-Has-SView', a weblogic-relationship-role element contains the wrong number of column mappings. A single column mapping must be given for each primary key column in the bean referenced by the mapping."
    And that makes no sense for me. Any ideas?

  • One to many subqueries?

    Hi,all
    I have two tables:
    CREATE TABLE UserInfoTable (
    loginId VARCHAR(32) CONSTRAINT pk_userLoginId
    PRIMARY KEY,
    regionId NUMBER(12),
    accountId NUMBER(12) NOT NULL)
    CREATE TABLE AccountTable
    accountId NUMBER(12) NOT NULL PRIMARY KEY)
    i have established the two master tables on the master site,but
    when i create snapshot as:
    CREATE SNAPSHOT test.AccountTable ON PREBUILT TABLE
    REFRESH FORCE
    START WITH to_date('20/12/2001 07:39:49 am','dd-Mon-yyyy
    HH:MI:SS am')
    NEXT /*1:Hr*/ sysdate + 1/(30*24)
    FOR UPDATE
    AS select * from [email protected] A where
    exists (select 1 from [email protected] B
    where A.accountId = B.accountId and B.regionId = 2)
    i got the following error:
    ORA-12013:updatable snapshots must be simple enough to do
    fast refresh!
    i have create snapshot log on userinfotable.accountId and
    userinfotable.regionid on master site.but if i get rid of the
    above "FOR UPDATE",then it works well.
    this subquery is one to many subqueries?
    the document of oracle 9i said:
    Note: The materialized view site must have a compatibility level
    of 9.0.0 or higher because fast refresh of materialized views
    with one to many subqueries was not supported prior to release
    9.0.0 of Oracle. The compatibility level is controlled by the
    COMPATIBLE initialization parameter.
    i use Oracle enterprise edition 8.1.7.so it can't do updatable
    snapshots while using one to many subqueries?
    Anybody can help me?i have wandered on this problem serveral
    days.
    thanks in advance!

    .. do you know if there are firewalls that can implement one-to-many nat ? tipically one private ip statically natted to many public ip .. checkpoint, fortigate ..

  • One to many problem onan existing shema

    I'm trying to do an insert in a database using one-to-many mapping.
    I have two tables on an existing schema.
    The two tables are:
    ANAG
    | ID_ANAG     | RAG_SOC |
    |-------------------------|
    |     1     | a name |
    |-------------------------|
    | ...     | .....     |
    |-------------------------|
    INDI
    | ID_INDI     | ID_ENTITA     | INDIRIZZO|
    |-------------------------------------------
    | 101          | 1          | address 1|
    |------------------------------------------|
    | 102          | 1          | address 2|
    |------------------------------------------|
    | 103          | ....          | ....     |
    |------------------------------------------|
    One ANAG can have m INDI. Given an ANAG I can find the related INDI(s)
    with the relation
    ANAG.ID_ANAG=INDI.ID_ENTITA
    My two java classes are:
    package domain;
    import java.util.*;
    public class Anagrafica
    private int idAnag; //ID_ANAG
    private String ragSoc;
    private HashSet indis;
    // default constructor
    //get and set methods
    package domain;
    public class Indi
    private int idIndi; //ID_INDI
    private long idAnag; //ID_ENTITA
    private String indirizzo; //INDIRIZZO
    private Anagrafica anagrafica;
    // default constructor
    //get and set methods
    Anagrafica.jdo:
    <?xml version="1.0"?>
    <!-- This JDO Metadata file was auto-generated on 08/10/02 17.44.
    See http://www.solarmetric.com for Kodo JDO Documentation and examples. -->
    <jdo>
    <package name="domain">
    <class name="Anagrafica"
    identity-type="application"
    objectid-class="domain.AnagraficaPK">
    <extension key="table" value="ANAG" vendor-name="kodo"/>
    <extension key="class-column" value="none" vendor-name="kodo"/>
    <extension key="lock-column" value="none" vendor-name="kodo"/>
    <field name="idAnag" primary-key="true">
    <extension key="data-column" value="ID_ANAG"
    vendor-name="kodo"/>
    </field>
    <field name="ragSoc">
    <extension key="data-column" value="RAG_SOC"
    vendor-name="kodo"/>
    </field>
    <field name="indis">
    <collection element-type="domain.Indi"/>
    <extension vendor-name="kodo" key="inverse"
    value="anagrafica"/>
         </field>
    </class>
    </package>
    </jdo>
    Indi.jdo
    <?xml version="1.0"?>
    <!-- This JDO Metadata file was auto-generated on 08/10/02 17.21.
    See http://www.solarmetric.com for Kodo JDO Documentation and examples. -->
    <jdo>
    <package name="domain">
    <class name="Indi"
    identity-type="application" objectid-class="domain.IndiPK">
    <extension key="table" value="INDI" vendor-name="kodo"/>
    <extension key="class-column" value="none" vendor-name="kodo"/>
    <extension key="lock-column" value="none" vendor-name="kodo"/>
    <field name="idIndi" primary-key="true">
    <extension key="data-column" value="ID_INDI"
    vendor-name="kodo"/>
    </field>
    <field name="idAnag">
    <extension key="data-column" value="ID_ENTITA"
    vendor-name="kodo"/>
    </field>
    <field name="indirizzo">
    <extension key="data-column" value="INDIRIZZO"
    vendor-name="kodo"/>
    </field>
    <field name="anagrafica"/>
    </class>
    </package>
    </jdo>
    When I run the test program and I try to insert a new Anagrafica object I
    get the exception:
    [ C:3974641; S:1673361; T:3317565; D:09/10/02 16.03 ] INSERT INTO
    ANAG(ID_ANAG, RAG_SOC) VALUES
    (-914917554, 'A NEW RAGSOC')[ C:3974641; S:7389395; T:3317565; D:09/10/02
    16.03 ] INSERT INTO
    INDI(INDIRIZZO, IDANAG_ANAGRAFICAX, ID_INDI, ID_ENTITA) VALUES ('via 25
    dicembre', NULL,
    -914917554,0)javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=INSERT INTO
    INDI(INDIRIZZO,
    IDANAG_ANAGRAFICAX, ID_INDI, ID_ENTITA) VALUES ('via 25 dicembre', NULL,
    -914917554,0)] ORA-00904:
    invalid column name
    [code=904;state=42000]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=INSERT INTO
    INDI(INDIRIZZO,
    IDANAG_ANAGRAFICAX, ID_INDI, ID_ENTITA) VALUES ('via 25 dicembre', NULL,
    -914917554, 0)] ORA-00904:
    invalid column name
    [ C:3974641; T:3317565; D:09/10/02 16.03 ] roll back data store
    transaction     at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:17)     at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.insert(JDBCStoreManager.java:421)     at
    com.solarmetric.kodo.runtime.StateManagerImpl.insert(StateManagerImpl.java:1783)     at
    com.solarmetric.kodo.runtime.PNewState.flush(PNewState.java:31)     at
    com.solarmetric.kodo.runtime.StateManagerImpl.flush(StateManagerImpl.java:372)     at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:426)     at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:295)     at
    test.AnagraficaJdo.main(AnagraficaJdo.java:49)NestedThrowablesStackTrace:java.sql.SQLException:
    ORA-00904: invalid column name
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)     at
    oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)     at
    oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)     at
    oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)     at
    oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)     at
    oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)     at
    oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)     at
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)     at
    oracle.jdbc.driver.OracleStatement.doScrollStmtExecuteQuery(OracleStatement.java:5290)     at
    oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:697)     at
    com.solarmetric.kodo.impl.jdbc.datasource.StatementImpl.executeUpdate(StatementImpl.java:78)     at
    com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL.execute(NonSelectingSQL.java:40)     at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.insert(ClassMapping.java:391)     at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.insert(JDBCStoreManager.java:416)     at
    com.solarmetric.kodo.runtime.StateManagerImpl.insert(StateManagerImpl.java:1783)     at
    com.solarmetric.kodo.runtime.PNewState.flush(PNewState.java:31)     at
    com.solarmetric.kodo.runtime.StateManagerImpl.flush(StateManagerImpl.java:372)     at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:426)     at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:295)     at
    test.AnagraficaJdo.main(AnagraficaJdo.java:49)
    How can I resolve the problem of the presence of IDANAG_ANAGRAFICAX and
    have the 1-m relation?
    Thank you in advance.
    Mirko

    I've changed the Indi class and the metadata but I still get an exception:
    javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=INSERT INTO INDI
    (INDIRIZZO, IDANAG_ANAGRAFICAX, ID_INDI, IDANAGX) VALUES
    ('via 25 dicembre', NULL, -847766554, 0)]
    ORA-00904: invalid column name
    I know I'm missing something but I don't know what.
    I can't find any simple example of a one-to-many mapping of two tables on
    an existing schema.
    The final SQL should be: INSERT INTO INDI(INDIRIZZO, ID_ENTITA, ID_INDI)
    VALUES ('via 25 dicembre', -847766554, -847766554)
    thank you in advance for help
    Fred Lucas wrote:
    You should not have both primitive fields for the data in the tables and
    relations to other persistence-capable objects. So, your Indi class and
    metadata should probably look something like this:
    package domain;
    public class Indi
    private int idIndi; //ID_INDI
    private String indirizzo; //INDIRIZZO
    private Anagrafica anagrafica;
    // default constructor
    //get and set methods
    Indi.jdo
    <?xml version="1.0"?>
    <!-- This JDO Metadata file was auto-generated on 08/10/02 17.21.
    See http://www.solarmetric.com for Kodo JDO Documentation and examples. -->
    <jdo>
    <package name="domain">
    <class name="Indi"
    identity-type="application" objectid-class="domain.IndiPK">
    <extension key="table" value="INDI" vendor-name="kodo"/>
    <extension key="class-column" value="none" vendor-name="kodo"/>
    <extension key="lock-column" value="none" vendor-name="kodo"/>
    <field name="idIndi" primary-key="true">
    <extension key="data-column" value="ID_INDI"
    vendor-name="kodo"/>
    </field>
    <field name="indirizzo">
    <extension key="data-column" value="INDIRIZZO"
    vendor-name="kodo"/>
    </field>
    <field name="anagrafica">
    <extension key="data-column" value="ID_ENTITA"
    vendor-name="kodo"/>
    </field>
    </class>
    </package>
    </jdo>
    -Fred
    In article <[email protected]>, Mirko wrote:
    I'm trying to do an insert in a database using one-to-many mapping.
    I have two tables on an existing schema.
    The two tables are:
    ANAG
    | ID_ANAG     | RAG_SOC |
    |-------------------------|
    |     1     | a name |
    |-------------------------|
    | ...     | .....     |
    |-------------------------|
    INDI
    | ID_INDI     | ID_ENTITA     | INDIRIZZO|
    |-------------------------------------------
    | 101          | 1          | address 1|
    |------------------------------------------|
    | 102          | 1          | address 2|
    |------------------------------------------|
    | 103          | ....          | ....     |
    |------------------------------------------|
    One ANAG can have m INDI. Given an ANAG I can find the related INDI(s)
    with the relation
    ANAG.ID_ANAG=INDI.ID_ENTITA
    My two java classes are:
    package domain;
    import java.util.*;
    public class Anagrafica
    private int idAnag; //ID_ANAG
    private String ragSoc;
    private HashSet indis;
    // default constructor
    //get and set methods
    package domain;
    public class Indi
    private int idIndi; //ID_INDI
    private long idAnag; //ID_ENTITA
    private String indirizzo; //INDIRIZZO
    private Anagrafica anagrafica;
    // default constructor
    //get and set methods
    Anagrafica.jdo:
    <?xml version="1.0"?>
    <!-- This JDO Metadata file was auto-generated on 08/10/02 17.44.
    See http://www.solarmetric.com for Kodo JDO Documentation and examples. -->
    <jdo>
    <package name="domain">
    <class name="Anagrafica"
    identity-type="application"
    objectid-class="domain.AnagraficaPK">
    <extension key="table" value="ANAG" vendor-name="kodo"/>
    <extension key="class-column" value="none" vendor-name="kodo"/>
    <extension key="lock-column" value="none" vendor-name="kodo"/>
    <field name="idAnag" primary-key="true">
    <extension key="data-column" value="ID_ANAG"
    vendor-name="kodo"/>
    </field>
    <field name="ragSoc">
    <extension key="data-column" value="RAG_SOC"
    vendor-name="kodo"/>
    </field>
    <field name="indis">
    <collection element-type="domain.Indi"/>
    <extension vendor-name="kodo" key="inverse"
    value="anagrafica"/>
         </field>
    </class>
    </package>
    </jdo>
    Indi.jdo
    <?xml version="1.0"?>
    <!-- This JDO Metadata file was auto-generated on 08/10/02 17.21.
    See http://www.solarmetric.com for Kodo JDO Documentation and examples. -->
    <jdo>
    <package name="domain">
    <class name="Indi"
    identity-type="application" objectid-class="domain.IndiPK">
    <extension key="table" value="INDI" vendor-name="kodo"/>
    <extension key="class-column" value="none" vendor-name="kodo"/>
    <extension key="lock-column" value="none" vendor-name="kodo"/>
    <field name="idIndi" primary-key="true">
    <extension key="data-column" value="ID_INDI"
    vendor-name="kodo"/>
    </field>
    <field name="idAnag">
    <extension key="data-column" value="ID_ENTITA"
    vendor-name="kodo"/>
    </field>
    <field name="indirizzo">
    <extension key="data-column" value="INDIRIZZO"
    vendor-name="kodo"/>
    </field>
    <field name="anagrafica"/>
    </class>
    </package>
    </jdo>
    When I run the test program and I try to insert a new Anagrafica object I
    get the exception:
    [ C:3974641; S:1673361; T:3317565; D:09/10/02 16.03 ] INSERT INTO
    ANAG(ID_ANAG, RAG_SOC) VALUES
    (-914917554, 'A NEW RAGSOC')[ C:3974641; S:7389395; T:3317565; D:09/10/02
    16.03 ] INSERT INTO
    INDI(INDIRIZZO, IDANAG_ANAGRAFICAX, ID_INDI, ID_ENTITA) VALUES ('via 25
    dicembre', NULL,
    -914917554,0)javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=INSERT INTO
    INDI(INDIRIZZO,
    IDANAG_ANAGRAFICAX, ID_INDI, ID_ENTITA) VALUES ('via 25 dicembre', NULL,
    -914917554,0)] ORA-00904:
    invalid column name
    [code=904;state=42000]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=INSERT INTO
    INDI(INDIRIZZO,
    IDANAG_ANAGRAFICAX, ID_INDI, ID_ENTITA) VALUES ('via 25 dicembre', NULL,
    -914917554, 0)] ORA-00904:
    invalid column name
    [ C:3974641; T:3317565; D:09/10/02 16.03 ] roll back data store
    transaction     at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:17)     at
    >>
    >>
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.insert(JDBCStoreManager.java:421)     at
    >>
    >>
    com.solarmetric.kodo.runtime.StateManagerImpl.insert(StateManagerImpl.java:1783)     at
    >>
    com.solarmetric.kodo.runtime.PNewState.flush(PNewState.java:31)     at
    com.solarmetric.kodo.runtime.StateManagerImpl.flush(StateManagerImpl.java:372)     at
    >>
    >>
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:426)     at
    >>
    >>
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:295)     at
    >>
    >>
    test.AnagraficaJdo.main(AnagraficaJdo.java:49)NestedThrowablesStackTrace:java.sql.SQLException:
    >>
    ORA-00904: invalid column name
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)     at
    oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)     at
    oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)     at
    oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)     at
    oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)     at
    oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)     at
    >>
    >>
    oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)     at
    >>
    >>
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)     at
    >>
    >>
    oracle.jdbc.driver.OracleStatement.doScrollStmtExecuteQuery(OracleStatement.java:5290)     at
    >>
    >>
    oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:697)     at
    >>
    >>
    com.solarmetric.kodo.impl.jdbc.datasource.StatementImpl.executeUpdate(StatementImpl.java:78)     at
    >>
    >>
    com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL.execute(NonSelectingSQL.java:40)     at
    >>
    >>
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.insert(ClassMapping.java:391)     at
    >>
    >>
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.insert(JDBCStoreManager.java:416)     at
    >>
    >>
    com.solarmetric.kodo.runtime.StateManagerImpl.insert(StateManagerImpl.java:1783)     at
    >>
    com.solarmetric.kodo.runtime.PNewState.flush(PNewState.java:31)     at
    com.solarmetric.kodo.runtime.StateManagerImpl.flush(StateManagerImpl.java:372)     at
    >>
    >>
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:426)     at
    >>
    >>
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:295)     at
    >>
    test.AnagraficaJdo.main(AnagraficaJdo.java:49)
    How can I resolve the problem of the presence of IDANAG_ANAGRAFICAX and
    have the 1-m relation?
    Thank you in advance.
    Mirko
    Fred Lucas
    SolarMetric Inc.
    202-595-2064 x1122
    http://www.solarmetric.com

  • Using translate function for one to many character translation

    Hi friends!
    Can anybody tell me whether it is possible to use built in translate function for converting some text from a one alphabet to another one, if these alphabets are of different length. Something like
    SELECT TRANSLATE('текст',
    'АБВГДЕЕЖЗИКЛМНОПРСТУФХЦЧШЩЭЮЯ',
    'ABCGDEF"*GH*"HIJKLMNOPQRSTYVWXYZ') FROM dual;
    Or there is another function for this, or it is impossible?
    Thanks

    Hi,
    Maybe you could use REPLACE just once, and then TRANSLATE the rest?
    Something like:
    SELECT TRANSLATE(REPLACE('ABcDE', 'c', 'xz'),
                     'ABCDE',
                     'abcde')  from dual;
    TRANSLATE(REPLACE('ABCDE','C','XZ'),'ABCDE','ABCDE')
    abxzde                                             
    1 row selected.Regards
    Peter

  • Achieving functionality of many preferences using one context index

    Hi Gurus,
    We have a table of following format
    SCOTT@orcl_11gR2> insert all
    2 into test_sh values (1, 'Mark Antony')
    3 into test_sh values (2, 'Mark-Antony')
    4 into test_sh values (3, 'markantony' )
    5 into test_sh values (4, 'markantony' )
    6 into test_sh values (5, 'Cleopatra' )
    7 select * from dual
    8 / We need to achieve following functionality in this table
    1) fuzzy
    2) stem
    3) synonym
    4) near
    5) soundex
    6) As mentioned in thread Text Search help using ndata section
    7) As mentioned in thread Re: Phrase Serach with special charaters in between using a lexer preference
    Please guide me as to how to achieve everything in one shot.
    I was thinking to write individual select statement and then do a distinct of id as given below but if we need to achieve #6 and #7 we need to add
    a preference and other queries for sundex,stem etc will not work properly. Please guide me how I can achieve all functionality using one index.
    > select * from test_sh where id in
    select distinct id from (
    select id from test_sh where contains (text_nm ,'markantony') > 0
    union
    select id from test_sh where contains (text_nm ,fuzzy('markantony')) > 0
    union
    select id from test_sh where contains (text_nm ,fuzzy('!markantony')) > 0
    select id from test_sh where contains (text_nm ,fuzzy('$markantony')) > 0
    ) Thanks & Regards,
    Vikas Krishna

    I do not get the errror that you get and I get the correct results, as shown below. Please post a copy and paste of a complete test case, run from SQL*Plus, as I have done below.
    SCOTT@orcl_11gR2> create table test_sh
      2    (text_id  number,
      3       text      clob)
      4  /
    Table created.
    SCOTT@orcl_11gR2> insert all
      2  into test_sh values (1, 'Mark Antony')
      3  into test_sh values (2, 'MARK ANTONY')
      4  into test_sh values (3, 'mark antony')
      5  into test_sh values (4, 'MarkAntony')
      6  into test_sh values (5, 'MA RK ANTONY')
      7  into test_sh values (6, 'm a r k antony')
      8  into test_sh values (7, 'Cleopatra' )
      9  select * from dual
    10  /
    7 rows created.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('nd_mcds', 'multi_column_datastore');
      3    ctx_ddl.set_attribute ('nd_mcds', 'columns', 'text nd, text text');
      4    ctx_ddl.create_section_group ('nd_sg', 'basic_section_group');
      5    ctx_ddl.add_ndata_section ('nd_sg', 'nd', 'nd');
      6    ctx_ddl.create_preference ('test_lex', 'basic_lexer');
      7    ctx_ddl.set_attribute ('test_lex', 'whitespace', '/\|-_+');
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> create index ix_test_sh
      2  on test_sh (text)
      3  indextype is ctxsys.context
      4  parameters
      5    ('datastore  nd_mcds
      6        section    group nd_sg
      7        lexer         test_lex')
      8  /
    Index created.
    SCOTT@orcl_11gR2> variable search_string varchar2(100)
    SCOTT@orcl_11gR2> column text format a30
    SCOTT@orcl_11gR2> exec :search_string := 'Mark Antony'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> select * from test_sh
      2  where  contains
      3             (text,
      4              'ndata (nd,' || :search_string || ') or
      5            syn (?!$' || replace (:search_string, ' ', ';?!$') || ')') > 0
      6  /
       TEXT_ID TEXT
             1 Mark Antony
             2 MARK ANTONY
             3 mark antony
             4 MarkAntony
             5 MA RK ANTONY
             6 m a r k antony
    6 rows selected.
    SCOTT@orcl_11gR2> exec :search_string := 'MARK ANTONY'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> /
       TEXT_ID TEXT
             1 Mark Antony
             2 MARK ANTONY
             3 mark antony
             4 MarkAntony
             5 MA RK ANTONY
             6 m a r k antony
    6 rows selected.
    SCOTT@orcl_11gR2> exec :search_string := 'mark antony'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> /
       TEXT_ID TEXT
             1 Mark Antony
             2 MARK ANTONY
             3 mark antony
             4 MarkAntony
             5 MA RK ANTONY
             6 m a r k antony
    6 rows selected.
    SCOTT@orcl_11gR2> exec :search_string := 'MarkAntony'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> /
       TEXT_ID TEXT
             1 Mark Antony
             2 MARK ANTONY
             3 mark antony
             4 MarkAntony
             5 MA RK ANTONY
             6 m a r k antony
    6 rows selected.
    SCOTT@orcl_11gR2> exec :search_string := 'MA RK ANTONY'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> /
       TEXT_ID TEXT
             1 Mark Antony
             2 MARK ANTONY
             3 mark antony
             4 MarkAntony
             5 MA RK ANTONY
             6 m a r k antony
    6 rows selected.
    SCOTT@orcl_11gR2> exec :search_string := 'm a r k antony'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> /
       TEXT_ID TEXT
             1 Mark Antony
             2 MARK ANTONY
             3 mark antony
             4 MarkAntony
             5 MA RK ANTONY
             6 m a r k antony
    6 rows selected.

  • To find Function Module is used for How many times

    Hi Gurus.
    How to find a Function module is used for how many times since it is created.. we went through the Tcode STAT , ST03, STAD, STATTRACE but in ST03 we can find it for Program but we could not find it for Function module , So can any one please suggest us . we are using ECC 6.0 version.
    Thanks and Regards,
    Chaitanya.

    Hi Chaithu,
    Go to SE37,enter your function module, click on where used list button on the application bar.
    All the program used your function module used is displayed.
    Regards,
    Venkat.

  • Helper Function Module; one or many

    I have been doing all my function development in individual ps1 files for ease of testing. I.e. I have a Reg-Functions file, which contains all my Registry manipulation functions, and I have some script level code at the bottom to test the functions. I had
    planned to then put all the helper functions together in a single module, but smaller files are a little easier to get around in, so now I wonder if having 10 or 12 different modules is a better way to go?
    Also, I can see some of them having shared dependencies. So A.psm1 & B.psm1 both depend on Z.psm1. Can I load Z.psm1 in both without trouble when I then load both into script.ps1? Or is there bad juju there? I know, this is one I should just test rather
    than asking the question, but I am away from the Windows VM at the memento and just had the thought.
    Gordon

    Attempting to import a module that is already loaded a second time will not affect anything.
    As for one big module versus 12 smaller ones, I would really see that as personal preference on how you want to manage them.  How many functions are we talking about total?  I have seen some modules with hundreds of functions, I guess it can also
    come down to how long you want the import process to take especially if you have a large number of seldom used functions.

  • One to many merge/concat using pl/sql

    Problem Description:
    For every STAGEDBAGTAB.CLS_FIRSTPART, there's can be more than one values in LONGSTRINGELEMENTTAB.LSE_STRING. The column LONGSTRINGELEMENTTAB.LSE_INDEX gives out the indicator as to how many values there can be.
    Now, I need to take the 1st value of STAGEDBAGTAB.CLS_FIRSTPART and megre/concat it with all the corresponding values of LONGSTRINGELEMENTTAB.LSE_STRING.
    CREATE TABLE STAGEDBAGTAB
    ROOTID VARCHAR2(40 BYTE) NOT NULL,
    CLS_REST VARCHAR2(40 BYTE),
    CLS_FIRSTPART VARCHAR2(3000 BYTE),
    SB_CRC NUMBER(20),
    SB_KEY VARCHAR2(768 BYTE) NOT NULL,
    SB_OVERWRITTEN NUMBER(1) NOT NULL,
    SB_CONTAINER VARCHAR2(40 BYTE),
    SB_ACTIVE NUMBER(1),
    SB_PURGESTATE INTEGER NOT NULL,
    SB_TIMECREATED DATE,
    SB_TIMEUPDATED DATE
    CREATE TABLE LONGSTRINGELEMENTTAB
    ROOTID VARCHAR2(40 BYTE) NOT NULL,
    MYID VARCHAR2(40 BYTE) NOT NULL,
    LVID VARCHAR2(40 BYTE),
    LSE_INDEX INTEGER,
    LSE_STRING VARCHAR2(765 BYTE),
    LSE_DEFAULTINGSETBITS INTEGER
    Query used:
    SELECT Sta1.sb_Key, Sta1.sb_CRC,Sta1.cls_FirstPart, Lon2.lse_Index, Lon2.lse_String
    FROM StagedBagTab Sta1, LongStringElementTab Lon2
    WHERE Sta1.ls_Strings = Lon2.lvId AND Sta1.rootId = Lon2.rootId
    AND (Sta1.sb_OverWritten = 0
    AND Sta1.sb_ComplexTypeInstanceName <> 'itemdelete'
    AND Sta1.sb_Container IN ('1w52exgc.fi'))
    AND (Sta1.sb_Active = 1)
    AND (Sta1.sb_PurgeState = 0)
    UNION ALL
    SELECT Sta101.sb_Key, Sta101.sb_CRC, Sta101.sb_ComplexTypeInstance, Sta101.cls_FirstPart, -1, ' '
    FROM StagedBagTab Sta101
    WHERE (Sta101.cls_Rest IS NULL
    AND Sta101.sb_OverWritten = 0
    AND Sta101.sb_ComplexTypeInstanceName <> 'itemdelete'
    AND Sta101.sb_Container IN ('1w52exgc.fi'))
    AND (Sta101.sb_Active = 1)
    AND (Sta101.sb_PurgeState = 0)
    ORDER BY 2 ASC, 1 ASC, 5 ASC;
    Sample Output: the above query gives me all the records, i need but the column STAGEDBAGTAB.CLS_FIRSTPART is repeated, as there are more than one corresponding values of LONGSTRINGELEMENTTAB.LSE_STRING.
    I need only 1 value of STAGEDBAGTAB.CLS_FIRSTPART with all corresponding values of LONGSTRINGELEMENTTAB.LSE_STRING. Possibly, merged in some temporary variable etc.
    If someone can point me in the right direction, that would be great help.
    Thanks a lot in advance.

    What version of Oracle are you using? If you're using 11.2, you can use the LISTAGG analytic function
      1  select listagg( dname, ',' ) WITHIN GROUP( order by dname )
      2*   from dept
    SQL> /
    LISTAGG(DNAME,',')WITHINGROUP(ORDERBYDNAME)
    ACCOUNTING,OPERATIONS,RESEARCH,SALESto do something like
    listagg( lse_string, ',' ) within group( order by lse_string )In earlier versions, Tom has a STRAGG user defined analytic function that can be used on askTom.
    Justin

Maybe you are looking for

  • Cisco WRV210 vpn troubles + firmware mismatch?

    Have a customer with 3xWRV210 routers VPN'd in a hub & spoke design. We are frequently having issues with the vpn where they seems to stall -- the VPN Summary screen says 'C'onnected, but data will not pass over the tunnel. The solution is to restart

  • My iPod 5th gen won't charge:'(

    As stated in the tittle my iPod won't charge. I have looked at a lot of the similar posts but none of them are helpful. I can NOT get into DFU mode, I HAVE read both iPod touch: Hardware troubleshooting and iPhone and iPod touch: Charging the battery

  • Two different Pricing date

    Hi Gurus, can pricing date in billing document be different for different line items? The scenario is two Sales orders having  two different pricing dates is combined into one delivery document. Next Invoice  is generated from that delivery document.

  • Deploy TS to Known & Unknown devices

    Is it possible to pxe boot to both known and unknown computers in a domain? I work in a school environment and we have been using WDS to deploy our images. I recently was able to get SCCM up and running in our environment, and created a working TS to

  • Oracle Restore

    Dear Gurus, Issue: Unable to recover database from an online backup We have a production Oracle 10 G database ; Solaris. An online backup is performed everyday (No offline backups as it a HA environment). We are trying to validate the online backup o