Advanced mapping from IDOC to SOAP with reversed 3 level context change

Hi everyone.
I am having a though time mapping the HRMD_A01 IDOC into a SOAP message. The reason is that the reciever expects an xml structure where the root node is cost center instead of employee which is the case in the IDOC.
Mapping from:
IDOC (1..1)
   E1PLOGI (1..unb)
     SEGMENT (String)
     OBJID (String)
     E1PITYP (1..unb)
       E1P0001 (1..unb)
         SEGMENT (String)
         KOSTL (String)
To this structure:
List (1..1)
  CostCenters (1..unb)
    KOSTL (String)   ----> Mapped against KOSTL above
    Employees (1..unb)
      OBJID (String)   ----> Mapped against OBJID above  
I expect several occurances of E1PLOGI which states multiple employees sent in the IDOC. I also expect several occurences of E1P0001 containing cost centers.
My conclusion is that I need an advanced mapping and I have created one which collects all KOSTL for the IDOC context, deletes duplicates, and creates the CostCenters segment. This is now working. But my problem is that I can't create the employees segment in the right place. They are only created once under the first CostCenters node.
Here's the java-code for mapping between KOSTL and CostCenters/KOSTL:
public void costCenters(String[] var1, ResultList result, Container container) throws StreamTransformationException{
  Set set = new HashSet(Arrays.asList(var1));
  String[] array2 = (String[])(set.toArray(new String[set.size()]));
  Arrays.sort(array2);
  for (int i = 0; i < array2.length; i++) {
    result.addValue(array2<i>);
Any ideas on how to proceed?
Best Regards

Hi,
  Do the mapping like below.
  UDF should be select as context.
List (1..1)
  CostCenters (1..unb)
    KOSTL (String)   ----> Mapped against KOSTL above
    Employees (1..unb)
      OBJID (String)   ----> Mapped against OBJID above
Mapping:
KOSTL(RightSelectChange the context to E1PITYP)--UDF--Removecontext--CostCenters
KOSTL(RightSelectChange the context to E1PITYP)--UDF--SplitbyValue(Each Value)--KOSTL
constant---Employees
OBJID----------------------------------------------Use One As Many---SplitByValue (EachValue)----------OBJID
KOSTL(RightSelectChange the context to E1PITYP)--UDF---
KOSTL(RightSelectChange the context to E1PITYP)--UDF---
Regards,
Prakasu.M
Edited by: prakasu on May 20, 2009 3:28 PM

Similar Messages

  • IDoc to Soap, with BPM - Permanent error in BPE inbound processing

    Hi Experts,
    IDoc to Soap, with BPM - > Permanent error in BPE inbound processing
    How to rectify this any issue???
    Thanks-
    sk

    Hi,
    The inbound processing encountered a permanent error and the queue therefore stopped.
    The error message "Permanent error in BPE inbound processing" may be caused by the following:
    - At the start or when you process a process instance, the inbound processing encounters an exception that was not handled. This exception is triggered, for example, by a transformation step, a synchronous send step or a control step but it was not caught in an exception handler branch. If the exception that was not handled occurs in the first transaction of the started process instance, the system does not write the process instance to the database but it sets the queue that has this error message to the error status.
    Refer to the help in Note 1082099
    - The inbound processing triggers this error if the correlation evaluation shows that a message should be delivered to a process instance that has the status "error". Since delivery to process instances that contain errors is not permitted, the queue is stopped.
    Use the simulation of the message delivery in the detail view of the relevant queue LUW to determine the relevant process instance for the affected message and use transaction SXMB_MONI_BPE "Continue Process Following Error" (or transaction SWF_XI_SWPR) to continue. If you cannot continue the process instance, check whether you can logically delete the instance. In this case, use the method that is described in Note 807906 to logically delete a process instance.
    Check whether your system contains other process instances that have errors in order to detect similar problems. Use transaction SXMB_MONI_BPE "Continue Process Following Error" or transaction SWF_XI_SWPR.
    Use the report RSWF_CRL_MAINTAIN to check all of the correlation instances in question or the relevant process instances that you can reach using "Display Work Item".
    - Messages that cannot be delivered because no correlation instance can be found may lead to the error that is mentioned here. Check whether the causes that are outlined in Note 1094028 affect your case.
    Hope this will help you.
    Regards
    Aashish Sinha
    PS : reward points if helpful.

  • While Mapping from Idoc to Oracle Structure

    Hi Guys,
    while we  From IDOC to Oracle..
    when we follow the  store procedure method to update the data  in oracle.
    statement
      tablename
    action
       table
          access
      Field1
      Field2
      Key
      Field1
      field2
    Here where should we need to map the from soucre Structure to Target structure..
    what i mean should i need to map in the fields under access or Key..
    can some help me in these
    Regard's
    raj

    OK, you are using Stored Procedures right ? Then your action will be inside the stored procedure.. Not in the xml data/message type..
    It is like calling a function from the program. When you call a function from a program, you just pass the values right ? and logic to insert/update/delete is written inside the function right ? similarly here you need to do the same. In this case, XI is calling stored Procedures with all the input values from the idoc ( i.e mapping) and the attribute value is "EXECUTE" not INSERT/UPDATE etc..
    That's the reason , I told, ignore current structure and just go thru the blog once, without considering current structure.. Then you can find the exact answer..
    Regards,
    Moorthy

  • From IDoc to SMTP with XML attachment.

    Hi,
    I'm looking for some info to guide me up how to split and IDOC structure into an email message that contents an XML file attached and a NFS repository.
    I mean, i need to create an XML FIle from the IDOC and i need to post it into a NFS directory and also send it attached into an email message.
    May i create both messages in a single process?
    This is my scenario:
    <R/3 Sales IDoc> TO <SMTP/FTP Business partners> and <local file system>.
    Thnx in advanced.
    Gerardo.
    Ps. I will post reward points.

    Bhavesh/Krishna,
    Thank you guys for your helpful comments, just to acknowledge you i have gathered all the links that i found in these forums in order to help other people in this issue:
    <b>Introduction to IDoc-XI-File scenario and complete walk through for starters</b>
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    <b>IDOC to XML</b>
    IDOC to XML
    <b>Send a XML file using the mail adapter</b>
    Send a XML file using the mail adapter
    <b>Example: Multicast – Multiple Receivers (with Response Message)</b>
    http://help.sap.com/saphelp_nw2004s/helpdata/en/11/13283fd0ca8443e10000000a114084/content.htm
    <b>Multi-Mapping without BPM - Yes, it’s possible!</b>
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    <b>Mail Adapter scenarios – SAP Exchange Infrastructure</b>
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    <b>XI: Dynamic name in the mail attachment - pseudo "variable substitution"</b>
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    <b>XI: HTML e-mails from the receiver mail adapter ?</b>
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    <b>Receiving Mail attachments using additional files of file adapter.</b>
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    Best regards,
    Gerardo.

  • Need help on Inbound Delivery - Mapping from IDoc to LIKP Table

    Hi,
    For the DESADV IDoc (Inbound Delivery) we are currently mapping data to the LIKP table for a subset of fields via  function module INPUT_IDOC_DESADV.  If I wanted to map the ABLAD - Unloading Point field from the IDoc to the LIKP - ABLAD - Unloading Point field is this possible and if yes, what work would be required? 
    And could you please let me know how to find out an user exit for the message type? (message type = desadv)

    Hi Murphy,
    Try this custom function '002'.
    CALL CUSTOMER-FUNCTION '002'
           EXPORTING
                xekko     = ekko
                xlfa1     = lfa1
                xlfb1     = lfb1
                dobject   = object
           TABLES
                int_edidd = int_edidd
                xekpo     = xekpo
                xeket     = xeket
                dvbak     = xvbak
                dvbap     = xvbap
                dvbkd     = xvbkd
           EXCEPTIONS
                error_message_received        = 1
                data_not_relevant_for_sending = 2.
    Hope this will help.
    Regards,
    Ferry Lianto

  • Problem with queue and context change JAVA udf

    Hi all,
    MY scenorio is from source i get multiple instances and each instance i need to pass to different fields od target
    in one source instance i may get multiple values which i have to create multple nodes under one target instance.
    my source xml looka like below:
    - <CustomFieldsSegment>
    - <CustomFields Name="ForeignLanguageonPackaging">
      <Value Qualifier="en">English</Value>
      <Value Qualifier="fr">French</Value>
      </CustomFields>
    - <CustomFields Name="LayerHeight">
      <Value>5.0</Value>
      </CustomFields>
    - <CustomFields Name="LayerHeightUOM">
      <Value Qualifier="IN">Inches</Value>
      </CustomFields>
      </CustomFieldsSegment>
      </TargetMarketData>
      </ItemRegistration>
      </Payload>
      </ns:MT_TradeItemsExport>
    in the above xml the first custom field has qualifier "en' and "fr"
    i need to create 2 nodes under one target field.
    example:
    <AttrMany Name="ForeignLanguageonPackaging">
      <Value ="en">en</Value>
      <Value ="fr">fr</Value>
      </AttrMany>
    int eh source node <CustomFields Name="ForeignLanguageonPackaging"> may come in any matter .doesnt come always first
    and i wrote udf like below:
    public void queue(String[] a,String[] b,String[] c,ResultList result,Container container){
        // write your code here
    AbstractTrace traceObj = container.getTrace();
        int baseArrayIndex = 99;
        int ccCount = 0;
        boolean isfound = false;
        for (int i = 0; i < a.length; i++) {
               isfound = false;
            if (a<i>.equals(c[0])) {
            baseArrayIndex = i;
      traceObj.addInfo("initial  "+ i);
            for (int j = 0; j < b.length; j++) {
                if (b[j].equals(ResultList.CC)) {
                ccCount++;
                } else {
                if ( baseArrayIndex == ccCount ) {
                   result.addValue(b[j]);
      traceObj.addInfo("result  "+ b[j]);
                    isfound = true;
            break;
    if (!isfound)
    result.addSuppress();
      traceObj.addInfo("final result  "+ result);
    Please can anyone help me.
    Regards,
    jyothi

    Hi all,
    MY scenorio is from source i get multiple instances and each instance i need to pass to different fields od target
    in one source instance i may get multiple values which i have to create multple nodes under one target instance.
    my source xml looks like below:each ItemRegistration is one item at target
    -<ItemRegistration>
    - <CustomFieldsSegment>
    - <CustomFields Name="ForeignLanguageonPackaging">
    <Value Qualifier="en">English</Value>
    <Value Qualifier="fr">French</Value>
    </CustomFields>
    - <CustomFields Name="LayerHeight">
    <Value>5.0</Value>
    </CustomFields>
    - <CustomFields Name="LayerHeightUOM">
    <Value Qualifier="IN">Inches</Value>
    </CustomFields>
    </CustomFieldsSegment>
    </TargetMarketData>
    </ItemRegistration>
    -<ItemRegistration>
    - <CustomFieldsSegment>
    - <CustomFields Name="ForeignLanguageonPackaging">
    <Value Qualifier="en">English</Value>
    <Value Qualifier="fr">French</Value>
    </CustomFields>
    - <CustomFields Name="LayerHeight">
    <Value>5.0</Value>
    </CustomFields>
    - <CustomFields Name="LayerHeightUOM">
    <Value Qualifier="IN">Inches</Value>
    </CustomFields>
    </CustomFieldsSegment>
    </TargetMarketData>
    </ItemRegistration>
    </Payload>
    </ns:MT_TradeItemsExport>
    in the above xml the first custom field has qualifier "en' and "fr"
    i need to create 2 nodes under one target field.
    example:
    <AttrMany Name="ForeignLanguageonPackaging">
    <Value ="en">en</Value>
    <Value ="fr">fr</Value>
    </AttrMany>
    int eh source node <CustomFields Name="ForeignLanguageonPackaging"> may come in any matter .doesnt come always first
    and i wrote udf like below:
    public void queue(String] a,String[ b,String[] c,ResultList result,Container container){
    // write your code here
    AbstractTrace traceObj = container.getTrace();
    int baseArrayIndex = 99;
    int ccCount = 0;
    boolean isfound = false;
    for (int i = 0; i < a.length; i++) {
    isfound = false;
    if (a.equals(c[0])) {
    baseArrayIndex = i;
    traceObj.addInfo("initial "+ i);
    for (int j = 0; j < b.length; j++) {
    if (b[j].equals(ResultList.CC)) {
    ccCount++;
    } else {
    if ( baseArrayIndex == ccCount ) {
    result.addValue(b[j]);
    traceObj.addInfo("result "+ b[j]);
    isfound = true;
    if (!isfound)
    result.addSuppress();
    traceObj.addInfo("final result "+ result);
    if i have only one item at the source it is working but when 2items are comming from the source my udf is not working.
    can anyone help me if you have faced the similar problem or who is fimilar like this kind.
    Regards,
    jyothi
    Edited by: jyothi vonteddu on Oct 21, 2009 9:14 PM
    Edited by: jyothi vonteddu on Oct 21, 2009 9:22 PM

  • IDoc - XI - SOAP - XI - Mail

    Hi all,
    I want to do the following scenario:
    IDoc is sent to XI, Xi is doing a Soap call with information from the Idoc, from the soap call I receive a response code. This response code will be sent by mail TOGETHER with info from the Idoc.
    I've made the scenario from Idoc to Soap call. I also know how to sent information out with the mail adapter.
    Where the problem is for me, is the combination of this all together.
    I guess I have to use BPM for this?
    Can anyone point me into the right directions for this problem?
    Thinks like wich message types, interface mappings etc?
    Thnx in advance!

    I guess I have to use BPM for this?
    Not necessary.
    U may perform a Idoc - Xi - Mail scenario with Soap lookup in mapping
    Webservice Calls From a User Defined Function.
    Regards,
    Prateek

  • Mapping from nested to one table (sales order) XML to IDOC

    Hello,
    I have to map a xml file to the IDOC SALESORDER_CREATEFROMDAT2.SALESORDER_CREATEFROMDAT202.
    How I can map the the longtext from the XML file to the IDOC struktur.
    Part of the XML file, there could be n times BPosition with n times longtext. The longtext must be map with a table. I some case its a mapping from nested to mornal table.
        <BPosition>
             <lpos>1</lpos>
             <bbl_sap_nr/>
             <milvonr/>
             <kurztitel/>
             <anzbest/>
             <anzliefer/>
             <kostenpflichtig/>
             <longtext>
                <line>pos1 zeile1</line>
                <line>pos1 zeile 2</line>
             </longtext>
          </BPosition>
    thanks for your help.

    Hi, I have to map this 1 XML to 1 IDOC
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Milver xmlns:ns0="http://ccssap.bfi.admin.ch/milver">
       <bestellung>
          <besteller>
             <bestellnr/>
             <auftragdefit/>
             <wempfdebit/>
             <bestelldat/>
             <lieferdat/>
             <anzpos/>
             <language/>
             <adrzeile1/>
             <adrzeile2/>
             <adrzeile3/>
             <adrzeile4/>
          </besteller>
          <Kopf>
             <Lkopf>Kopf1 zeile1</Lkopf>
             <Lkopf>Kopf1 zeile2</Lkopf>
          </Kopf>
          <BPosition>
             <lpos>1</lpos>
             <matnr/>
             <milvonr/>
             <kurztitel/>
             <anzbest/>
             <anzliefer/>
             <kostenpflichtig/>
             <bemerkung>
                <line>pos1 zeile1</line>
                <line>pos1 zeile 2</line>
             </bemerkung>
          </BPosition>
          <BPosition>
             <lpos>2</lpos>
             <matnr/>
             <milvonr/>
             <kurztitel/>
             <anzbest/>
             <anzliefer/>
             <kostenpflichtig/>
             <bemerkung>
                <line>pos2 zeile1</line>
                <line>pos2 zeile 2</line>
             </bemerkung>
          </BPosition>
       </bestellung>
    </ns0:MT_Milver>
    IDOC:
    The Idoc have a segment for the longtext (table).I have to map, lpos, line into  E1BPSDTEXT from SALESORDER_CREATEFROMDAT2. Its now more clear?

  • Multi Mapping - Receiver IDOC & Mail with BPM

    Hi,
    Is it possible to use BPM with Multi Mapping for IDOC & Mail receivers sent parallely..
    Appreciate your help ..
    Thanks,
    vasanth.

    Hi Michal,
    Thanks Michal,
    We are using PI 7.1, Our Scope to do File to IDOC & Mail scenario in between we have to do RFC Lookups..
    Could you pls guide me thru the steps fo BPM,
    1 SA -> OB to AA
    2 ID  -> OB to AA & AA to Recv
    3.RD -> OB to AA & AA to Recv
    4.RA -> AA to IB & AA to IB
    Correct me if i'm wrong..
    Clarification : Is there is any way out to implement this scenario with out BPM.
    We already implemented this scenario with 2 MM & 2 OM, Scenario works fine...but we have to use 1 Mapping..
    Appreciate your help in advance..
    Thanks,
    vasanth.

  • Mapping from PEXR2002 iDoc to EDI 820

    We are planning to use XI to map from the payment advice (PEXR2002) iDoc to EDI 820. 
    We have 2 options: (1) Use XI and an EDI adapter (e.g. Seeburger); or (2) Use XI's own mapping functionality.
    If you have done iDoc to EDI mapping with either of the above 2 options, please briefly advise about your experiences and how much efforts it took to develop the mapping.
    Thank-you
    Bac Quan

    Hi Bac,
    Although it is possible to create an EDI message in an XI mapping (or XSLT), this is not very nice.  The use of an EDI adapter (iWay or SeeBurger) is strongly recommended.
    The other way around (rom EDI to XML) is hardly feasiable without an EDI adapter.  Although I haven't worked the SeeBurger adapter, it looks quite nice.
    Kind regards, Guy Crets

  • Calling IDoc structure from IDOC metadata into Java mapping.

    Hi All,
    I have a requirement where we need to post an IDOC on target side, We are having to go for  a Java Mapping ,so  I need to create a Target XML with IDOC Structure, So i need to understand if we could import the structure from IDOC Meta Data  in to the Java Mapping insted of creating the IDOC Structure, I am using DOM parser for my Java Mapping,
    Really appreciate your response in this regard.
    Best Regards
    Jayaram

    Hi Jayram,
    In your requirement, get the xsd format of the idoc from idoc structure and using String xsdFormat ="xsd retrieved";  in the java mapping, you can create the xml structure using DOM parse APIs and then you can put values into the structure and pass it.
    Thanks,
    RK

  • Problem with reverse mapping

    Hi!
    I am having a problem with reverse mapping. Here's what I do (copying the
    generated files to a correct directory omitted):
    % rd-schemagen -properties jdo.properties -file schema.xml
    % rd-reversemappingtool -properties jdo.properties -package testi
    schema.xml
    % javac -d build/classes src/testi/*.java
    % rd-importtool -properties jdo.properties src/testi/testi.mapping
    Here's a part of the output:
    <clip>
    2958 INFO [main] jdbc.Schema - Found existing table "Kirja" for schema
    "null".
    3002 INFO [main] jdbc.Schema - Found existing table "Kustantaja" for
    schema "n
    ull".
    3047 INFO [main] jdbc.SQL - [C: 5948361; T: 15336018]close
    3125 INFO [main] jdbc.SQL - [C: 2478770; T: 15336018]open:
    jdbc:mysql://localh
    ost/kirjakauppa (root)
    3129 INFO [main] jdbc.Schema - Found existing table "Kirjailija" for
    schema "n
    ull".
    3140 INFO [main] jdbc.SQL - [C: 2478770; T: 15336018]close
    3187 INFO [main] jdbc.SQL - [C: 7529545; T: 15336018]open:
    jdbc:mysql://localh
    ost/kirjakauppa (root)
    3193 INFO [main] jdbc.Schema - Found existing table "Kirjoittaja" for
    schema "
    null".
    3225 INFO [main] jdbc.SQL - [C: 7529545; T: 15336018]close
    Exception in thread "main" javax.jdo.JDOFatalInternalException:
    java.lang.Illega
    lArgumentException: You are attempting to link to a primary key column in
    table "Kirja" in a foreign key that is already linked to primary key
    columns in table "Kirjailija".
    NestedThrowables:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Kirja" in a foreign key that is already linked to
    primary key c
    olumns in table "Kirjailija".
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.Mappings.createClassMapping(Ma
    ppings.java:160)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:279)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(
    MappingRepository.java:147)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:158)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(I
    mportTool.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
    gs(ImportTool.java:57)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTo
    ol.java:408)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportT
    ool.java:385)
    NestedThrowablesStackTrace:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Kirja" in a foreign key that is already linked to
    primary key c
    olumns in table "Kirjailija".
    at
    com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey.join(ForeignKey.j
    ava:238)
    at
    com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGenerator.generateFore
    ignKeys(SchemaGenerator.java:625)
    at
    com.solarmetric.rd.kodo.impl.jdbc.schema.DynamicSchemaFactory.findTab
    le(DynamicSchemaFactory.java:111)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.map.BaseClassMapping.fromMappi
    ngInfo(BaseClassMapping.java:113)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.Mappings.createClassMapping(Ma
    ppings.java:144)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:279)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(
    MappingRepository.java:147)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:158)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(I
    mportTool.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
    gs(ImportTool.java:57)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTo
    ol.java:408)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportT
    ool.java:385)
    </clip>
    Here's what MySQLCC gives for creation statement of the tables:
    <clip>
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Asiakas'
    # CREATE TABLE `Asiakas` (
    `Asiakas_id` int(11) NOT NULL auto_increment,
    `Nimi1` varchar(50) default NULL,
    `Nimi2` varchar(50) default NULL,
    `KatuOsoite` varchar(50) default NULL,
    `Postiosoite` varchar(50) default NULL,
    `Email` varchar(50) default NULL,
    `Puhelin` varchar(50) default NULL,
    `Fax` varchar(50) default NULL,
    `Salasana` varchar(50) default NULL,
    `ExtranetTunnus` varchar(50) default NULL,
    PRIMARY KEY (`Asiakas_id`),
    KEY `Asiakas_id` (`Asiakas_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kirja'
    # CREATE TABLE `Kirja` (
    `Kirja_id` int(11) NOT NULL auto_increment,
    `Kustantaja_id` int(11) default NULL,
    `Nimi` varchar(60) default NULL,
    `Nimi2` varchar(60) default NULL,
    `ISBN` varchar(50) default NULL,
    `Kieli` varchar(50) default NULL,
    `Kansi_URL` varchar(50) default NULL,
    `Sisalto_URL` varchar(50) default NULL,
    `Tukkuhinta` decimal(10,2) default NULL,
    `Kuluttajahinta` decimal(10,2) default NULL,
    `Varastokpl` int(11) default NULL,
    PRIMARY KEY (`Kirja_id`),
    KEY `Kirja_id` (`Kirja_id`),
    KEY `Kustantaja_id` (`Kustantaja_id`),
    FOREIGN KEY (`Kustantaja_id`) REFERENCES `kirjakauppa.Kustantaja`
    (`Kustantaja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kirjailija'
    # CREATE TABLE `Kirjailija` (
    `Kirjailija_id` int(11) NOT NULL auto_increment,
    `Sukunimi` varchar(50) default NULL,
    `Etunimi` varchar(50) default NULL,
    `Maa` varchar(50) default NULL,
    `Kirjailija_URL` varchar(50) default NULL,
    PRIMARY KEY (`Kirjailija_id`),
    KEY `Kirjailija_id` (`Kirjailija_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kirjoittaja'
    # CREATE TABLE `Kirjoittaja` (
    `Kirjoittaja_id` int(11) NOT NULL auto_increment,
    `Kirjailija_id` int(11) NOT NULL default '0',
    `Kirja_id` int(11) NOT NULL default '0',
    PRIMARY KEY (`Kirjoittaja_id`),
    KEY `Kirjailija_id` (`Kirjailija_id`),
    KEY `Kirja_id` (`Kirja_id`),
    FOREIGN KEY (`Kirjailija_id`) REFERENCES `kirjakauppa.Kirjailija`
    (`Kirjailija_id`),
    FOREIGN KEY (`Kirja_id`) REFERENCES `kirjakauppa.Kirja` (`Kirja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Koodi'
    # CREATE TABLE `Koodi` (
    `Koodi_id` int(11) NOT NULL auto_increment,
    `Koodi` varchar(50) default NULL,
    `Tyyppi` varchar(50) default NULL,
    `Arvo` varchar(50) default NULL,
    PRIMARY KEY (`Koodi_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kustantaja'
    # CREATE TABLE `Kustantaja` (
    `Kustantaja_id` int(11) NOT NULL auto_increment,
    `Nimi` varchar(80) default NULL,
    `Maa` varchar(50) default NULL,
    `Kustantaja_URL` varchar(50) default NULL,
    `KirjaLkm` int(11) default NULL,
    PRIMARY KEY (`Kustantaja_id`),
    KEY `Kustantaja_id` (`Kustantaja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Luokittelu'
    # CREATE TABLE `Luokittelu` (
    `Luokittelu_id` int(11) NOT NULL auto_increment,
    `Luokka_id` int(11) NOT NULL default '0',
    `Kirja_id` int(11) NOT NULL default '0',
    PRIMARY KEY (`Luokittelu_id`),
    KEY `Luokka_id` (`Luokka_id`),
    KEY `Kirja_id` (`Kirja_id`),
    FOREIGN KEY (`Luokka_id`) REFERENCES `kirjakauppa.Luokka` (`Luokka_id`),
    FOREIGN KEY (`Kirja_id`) REFERENCES `kirjakauppa.Kirja` (`Kirja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Luokka'
    # CREATE TABLE `Luokka` (
    `Luokka_id` int(11) NOT NULL auto_increment,
    `Luokka` varchar(50) default NULL,
    PRIMARY KEY (`Luokka_id`),
    KEY `Luokka_id` (`Luokka_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Myyja'
    # CREATE TABLE `Myyja` (
    `Myyja_id` int(11) NOT NULL auto_increment,
    `Myyja` varchar(50) default NULL,
    `Myyja_URL` varchar(50) default NULL,
    PRIMARY KEY (`Myyja_id`),
    KEY `Myyja_id` (`Myyja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Tilaus'
    # CREATE TABLE `Tilaus` (
    `Tilaus_id` int(11) NOT NULL auto_increment,
    `Asiakas_id` int(11) NOT NULL default '0',
    `Myyja_id` int(11) default NULL,
    `TilausPvm` timestamp(14) NOT NULL,
    `EnsimmToimitusPvm` timestamp(14) NOT NULL,
    `ViimToimitusPvm` timestamp(14) NOT NULL,
    `Tila` int(11) NOT NULL default '0',
    `Mk` decimal(10,2) default NULL,
    PRIMARY KEY (`Tilaus_id`),
    KEY `Asiakas_id` (`Asiakas_id`),
    KEY `Myyja_id` (`Myyja_id`),
    KEY `Tilaus_id` (`Tilaus_id`),
    FOREIGN KEY (`Asiakas_id`) REFERENCES `kirjakauppa.Asiakas`
    (`Asiakas_id`),
    FOREIGN KEY (`Myyja_id`) REFERENCES `kirjakauppa.Myyja` (`Myyja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Tilausrivi'
    # CREATE TABLE `Tilausrivi` (
    `TilausRivi_id` int(11) NOT NULL auto_increment,
    `Tilaus_id` int(11) NOT NULL default '0',
    `Kirja_id` int(11) NOT NULL default '0',
    `TilausLkm` int(11) default NULL,
    `Ahinta` decimal(10,2) default NULL,
    `Alepros` float default NULL,
    `Mk` decimal(10,2) default NULL,
    `ToimitettuLkm` int(11) default NULL,
    `ToimitusPvm` timestamp(14) NOT NULL,
    `ViimToimitusPvm` timestamp(14) NOT NULL,
    `Tila` int(11) NOT NULL default '0',
    PRIMARY KEY (`TilausRivi_id`),
    KEY `Tilaus_id` (`Tilaus_id`),
    KEY `Kirja_id` (`Kirja_id`),
    FOREIGN KEY (`Tilaus_id`) REFERENCES `kirjakauppa.Tilaus` (`Tilaus_id`),
    FOREIGN KEY (`Kirja_id`) REFERENCES `kirjakauppa.Kirja` (`Kirja_id`)
    ) TYPE=InnoDB;
    </clip>
    I can find the original creation script if it is necessary.
    My guess was that I need to define the foreign keys myself into the
    generated schema.xml This is stated in the manual. However, this did not
    help, although it changed the stack trace a little (it complains about
    different classes than before):
    <clip>
    Exception in thread "main" javax.jdo.JDOFatalInternalException:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Myyja" in a foreign key that is already linked to
    primary key columns in table "Asiakas".
    NestedThrowables:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Myyja" in a foreign key that is already linked to
    primary key columns in table "Asiakas".
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.Mappings.createFieldMapping(Mappings.java:208)
    </clip>
    I don't think I fully understand the error message, what exactly is wrong
    here? How can I fix it?
    Here's a sample of the changes I made to schema.xml:
    - added the name - attribute to schema (it was missing)
    <schema name="kirjakauppa">
    - added the foreign key elements according to the table creation statements
    given above
    <fk name="Kustantaja_id" to-table="Kustantaja" column="Kustantaja_id"/>
         etc...
    -Antti

    On Mon, 16 Jun 2003 17:55:35 -0500, Abe White <[email protected]>
    wrote:
    It seems the last three options are being ignored - I still get a
    mapping
    file with schema names in front of tables (e.g. kirjakauppa.Asiakas, not
    Asiakas),That, unfortunately, is impossible to turn off. The -useSchemaName
    option controls whether the schema name is included as part of the
    generated class name; it doesn't affect the mapping data that is
    generated. What problems does including the schema name in the mapping
    data cause?
    rd-importtool -properties jdo.properties gensrc/testi/testi.mapping0 INFO [main] kodo.MetaData - Parsing metadata resource
    "file:/home/akaranta/work/kurssit/jdo/Harjoituskoodi/kirjakauppa/gensrc/testi/testi.mapping".
    Exception in thread "main"
    com.solarmetric.rd.kodo.meta.JDOMetaDataNotFoundException: No JDO metadata
    was found for type "class testi.Asiakas".
    FailedObject:class testi.Asiakas
    at
    com.solarmetric.rd.kodo.meta.JDOMetaDataRepositoryImpl.getMetaData(JDOMetaDataRepositoryImpl.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:184)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:197)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(ImportTool.java:128)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappings(ImportTool.java:60)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTool.java:400)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportTool.java:377)
    This exception goes away if I edit the schema name out of the mapping
    file from all classes.
    separate classes are being generated for join tables with
    primary keysDo these join tables have an extra primary key column? TheYes, they do. Ok, now I know where the problem is.
    -primaryKeyOnJoin flag tells Kodo to ignore a join table with a primary
    key on the join columns. But Kodo can't handle join tables with extra
    column(s) just for a primary key identifier. This isn't a limitation of
    the reverse mapping tool, it's a limitation of Kodo. Kodo wouldn't know
    what to insert in those extra primary key column(s) when adding membersWhy not? If it can handle single numeric pk columns when making the
    generated classes use data store identity, it has to generate something to
    those columns. I can't see why this is different.
    That is simply out of curiosity - the next thing fixed my problem:
    to the join table. Of course, if the primary key is an auto-increment or
    something where Kodo can ignore it for inserts, you can just remove the
    <column> elements and the <pk> element from your .schema file and the
    reverse mapping tool will map it as a join table appropriately.It is auto-increment, so I did this and it worked. Thanks.
    , and application id is used for all classes.Are your primary keys on single, numeric columns? Kodo uses Java longsYes (int in MySQL), so that should not be a problem. They are also auto-
    incremented. This seems to be the only real problem remaining with this
    schema.
    -Antti

  • How do I retrieve the icons in the download map of my 2009 iMac with Maverick. They show up in the finder, but not when I open downloads from the dock.

    I have a 2009 iMac running on Mavericks. Since a few days, when I open the Download Map from the dock, I only see "empty" icon symbols. When I leave the map open the icons re-appear after some 20 seconds. When I re-open the downloads, the icons are empty again.
    How do I get the icons to behave in a normal way again?

    bro I just had this issue its as simple as swiping to the right of each album artwork that does not display in the list view (On your Iphone.) Once you swipe to the right on every album that does not display in the list view you will see the delete option come up. Hit delete! Dont be scared. Do this with every album art that does not show up and then resync your Iphone. Go to the list view again and all of your missing album artwork will be displayed in both the list overview and close up landscape mode.

  • Integrate data from SAP R/3 with iDOC

    Hi,
    I need extract data from SAP R/3 with the iDoc method, but I can't found documentation from oracle where explain it how do it?, just I know that for this method ODI use two agent (OdiSAPALEServer and OdiSAPALEClient) and they are part of Open Connector for SAP R/3, so anybody that can help me with this issue?, I will be very grateful, just I need some orientation about how to do it?, for example, I need to be clear if the Open Connector for SAP R/3 is part of ODI or I need iinstall other special connector, etc.
    I will be expecting for any answer that can help me.
    Best regards

    Hi Rodrigoalegrem,
    Below llink will helps you for
    *Oracle Data Integrator
    Getting Started with SAP ABAP ERP Adapter
    10g Release 3 (10.1.3)*
    URL: http://www.oracle.com/technetwork/middleware/data-integrator/overview/odigs-sapabap-168070.pdf
    Regards,
    Phanikanth

  • Context Mapping Problem from IDoc to EDI

    Hi,
    I'm trying to map an IDoc to an EDI and I get this problem.
    In my IDoc, I have segment E1ADRM1 (1:N)
    My mapping condition is if E1ADRM-PARTNER_Q = OSP then copy E1ADRM-REGION into x (EDI field)
    So here is my problem:
    In my IDoc test, the segment E1ADRM1 is repeated 6 times and the field REGION is not populated in all iterations so the wrong
    REGION is being copied to my EDI field.
    If I do a display queue on E1ADRM-PARTNER_Q, the value OSP is at the 5th position
    AG
    SP
    VE
    WE
    OSP  ***
    OSO
    If I do a display queue on E1ADRM-REGION, since only 5 segment E1ADRM have the field REGION populated, I get
    KS
    VA
    KS
    ON
    VA
    **(E1ADRM-PARTNER_Q = SP do not have the RIGION populated so not showing in the IDoc)
    So now, since E1ADRM-PARTNER_Q = OSP is at the 5th position, it is copying the 5th E1ADRM-REGION from the list but it should be the 4th.
    How can I do that?
    Rgds,
    Yves

    Hi,
    For the mapping to work as you are expecting the queue should look like this(<b>CC</b> denotes context change)..
    KS
    <b>CC</b>
    <b>CC</b>
    VA
    <b>CC</b>
    KS
    <b>CC</b>
    ON
    <b>CC</b>
    VA
    If you are not having the context changes, check at what level is field REGION at, right click on REGION in graphical mapping and choose menu item context, the 1st entry should have the tick mark(same should be for the PARTNER_Q field also).
    Thanks,
    Renjith.

Maybe you are looking for

  • Airport symbol no longer appears

    When I select "Airport" in System Profiler I get info about the software installed but nothing about the Airport card.  Also the airport symbol disappeared from the menu bar at the top of my desktop.  Do I have to replace the airport card or could th

  • Character mode report printing

    hi everyone, When I am running report in character mode, it is working fine in previewer. But as soon as I am giving the printing from there, it is giving Rbe ERROR dialog box and runform is getting hanged. How can I get report printed directly from

  • How to register dll file

    Hi how i can use JNIregistry Project at: www.trustice.com to check registry for my dll and register if it isn't i uesd JACOB project for this dll please i need help as i don't know a lot about registry thanks alot

  • How do I make Finder columns auto-fit width of filenames?

    This is a tiny irritant, as such things go, but maybe one with an easy fix, if I only knew it. I normally use the Finder window in column view. Longer filenames are truncated by dots in the middle. In order to see the entire filenames, I have to go t

  • I sign in my ipad by using my id, but when i want to update as show others people id

    i try log out before, and sign in back but the same problem still happens