Mapping of Multiple occurences of source field to target

hi,
my scenario is flat file to idoc.
my flat file structure is as below:
docheader
product1
product description1
product2
product description2
in idoc,i need to map product to E1EDP01 and product description to E1EDP19 which occurs inside E1EDP01.
now if i directly map product node to E1EDP01 node and product description to E1EDP19,
Product                     --> E1EDP01
Product description      --> E1EDP19
i will get 2 E1EDP01 nodes .but each E1EDP01 node will be having two E1EDP19 nodes corresponding to incoming 2 product description.
E1EDP01     -->  Product1
E1EDP19     -->  Product description1
E1EDP19     -->  Product description2
E1EDP01     -->  Product2 
E1EDP19     -->  Product description1
E1EDP19     -->  Product description2
how to do the mapping such that my first product description goes into first product target mapping and my second product description goes into second product mapping?
E1EDP01     -->  Product1
E1EDP19     -->  Product description1
E1EDP01     -->  Product2
E1EDP19     -->  Product description2
thanks,
Anuradha

Could you give us more information posting the MT used for the file?
Do you have always only 2 products in the file?
About mapping I suggest you to see the following blogs:
/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
/people/sravya.talanki2/blog/2006/12/26/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-ii

Similar Messages

  • Picking up required Characteristics from my Source field to Target field!!

    Hi ,
    I need to pick up data from  a source field that is 35 characters long to a target field in my Cube that is only 4 char long. But the data that will be fed into this source field will be 4 char long only, so can anyone help me with picking up only the 4 char I need into my target field.
    Is this possible, If yes kindly post the routine that will allow me to concatenate the remaining characteristics and pick up only the 4 char I need.
    Thanks,
    Guru.

    Also, if this is the behaviour of the infoObject at all the places it is to be used, you can created Global Transfer Routine at infoObject level.
    Otherwise you can write the routine in transformations, rule type "Routine" and then the avaiable source field can be used.
    A simple example:
    I needed to build a character date field for a cross-platform integration project I was working on. First, I defined the date field:
    data: datechar(10).
    To build the date lets use sy-datum, which has the current system date.
      write SY-DATUM+4(2) to datechar+0(2).
      write '/' datechar+2(1).
      write SY-DATUM+6(2) to datechar+3(2).
      write '/' TO datechar+5(1).
      write SY-DATUM+0(4) to datechar+6(4).
    Value of SY-DATUM 20010616
    Here's how the field changes with the execution of each line.
    06________
    06/_______
    06/16_____
    06/16/____
    06/16/2001
    Hope this helps.
    Cheers,
    Sumit

  • How to map multiple occurrences of a source field into a target field

    Hi friends
    I need multiple occurences of  MATNR field, of idocs collected, to be concatenated into a single field on target side.
    Warm Regards
    Arjun Ghose

    Hi Priyanka
    I am using the below code
    String material ="";
    for(int i=0; i<MATNR.length();i++)
                   material = material +MATNR<i>;     //var(i)
    result.addVAlue(material);
    But I am getting the below errors:
    Activation of the change list canceled Check result for Message Mapping COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse | urn:bp:xi:dwn:lu:common:Logistics:100:  Starting compilation  Source code has syntax error:  C:/usr/sap/IXV/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map11a81744fef611e0a49b000000aa1a4a/source/com/sap/xi/tf/_COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse_.java:123: array required, but java.lang.String found material = material +MATNR<i>; //var(i) ^ C:/usr/sap/IXV/DVEBMGS01/j2ee/cluster/server0/./temp/classpath_resolver/Map11a81744fef611e0a49b000000aa1a4a/source/com/sap/xi/tf/_COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse_.java:126: cannot resolve symbol symbol : variable result location: class com.sap.xi.tf._COND_A_COND_A01_TO_File_PriceDataIntermediate_Warehouse_ result.addVAlue(material); ^ 2 errors
    Edited by: GhoseArjun on Oct 25, 2011 12:57 PM

  • Counting the Multiple Occurence of a record in the internal Table-Urgent

    Hi,
    I have an internal table with the following values
    a
    a
    a
    b
    b
    b
    c
    c
    I need to print a-2
                         b-3
                         c-2
    How do i accomplish this? i.e.,I need to count the multiple occurence of a field.Any input on this will be of great help.
    Thanks and Regards,
    Pavithra

    Hi,
    Find the piece of code below it can help you:
    data: begin of itab occurs 0,
               field1 type c,
               field2 type i,
            end of itab.
    data: itab2 like table of itab occurs 0 with header line.
    data: count type i.
    start-of-seleciton.
    itab-field1 = a.
    append itab.
    itab-field1 = a.
    append itab.
    itab-field1 = a.
    append itab.
    itab-field1 = b.
    append itab.
    sort itab by field1.
    loop at itab.
      count = count + 1.
    at end of field1.
      clear itab2.
      itab2-field1 = itab-field1.
      itab2-field2 = count.
      append itab2.
    endat.
    endloop.
    Dispaly output table.
    loop at itab2.
      write:/ itab2-field1, itab2-field2.
    endloop.
    Reward the points if it is helpful.

  • Mapping Multiple Source fields to Single Target Fields with differnt Values

    Hello Friends,
    I am having a senario  where I have to mapped multiple fileds from source str. to same Idoc Fields with ( differnt default values )
    E.g Source Str.
    - ShopNO
    - OrderTyp
    Has to mapped to Idoc Str E1EDK14-Orgid.
    E.g Mapping:
    So when ShopNo will mapped to E1EDK14-Orgid the default value should be "MOP" & E1EDK14-Qualf should be 019
    and when OrderType will be mapped to E1EDK14-Orgid the default value should be "STD" & E1EDK14-Qualf should be 012
    So I tried of using node "UseOneAsMany".....but there I cant define the vaule of field orgid, and seconly how to specify the values of field Qualf?
    Do i need to write my own specify function ? or I can sovle this issue using standard avaiable functions ?
    Regards,

    Hi Ravi,
    Thanks for your reply....
    I am facing following problem... when I try to duplicate the segment and do mapping....... and then when I save, I got following error msg:
    The source or target structure has been changed or could not be found in the Integration Repository. The mapping definition contains elements or attributes that do not exist in the changed structure. The relevant entries will be deleted
    Target structure has no such path: /ZARVO_ORD/IDOC/E1EDK05[1]/KSCHL. Skipping mapping
    Target structure has no such path: /ZARVO_ORD/IDOC/E1EDK05[1]/KRATE. Skipping mapping
    Any suggestion ?
    in other words, when I do duplicate it creates me the segment, but when I save it, it gets disappered .........
    Regards,
    Edited by: Shah H on Oct 26, 2009 3:17 PM

  • How to remove target node if source field value is empty SAP PI Mapping

    Hello,
    how to remove target node if source field value is empty in graphical Mapping.
    Like if
    MIddle name in source filed is empty, I would like to eliminate target field from out put XML.
    Thank you
    John

    Hi Jhon,
    If you want to remove all empty tags and you dont to complicate your message mapping, you can use a XSL, after the message mapping,  to remove all the empty tags:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="node()|@*">
            <xsl:copy>
                <xsl:apply-templates select="node()|@*"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="*[not(@*|*|comment()|processing-instruction())
         and normalize-space()='' ]"/>
    </xsl:stylesheet>
    Regards

  • Mapping with source fields

    We are having characteristics keyfigures in SAP BW.We have to identify these fields in R/3 i.e. source fields and source tables.But we are unable to match some keyfigures and characteristics in R/3.What approach we have do.Mean if we are unable to find some characteristics and keyfigures in R/3 what we have to do and how to we mapping?what extraction we have to take?what approach we have to do

    Hi Sam and Ramesh,
    These reports are coming to Portal via Bw only.
    And we dont have access other client (X client) BW systems and they are not giving design document also.They are giving only R/3 sytem copy and we are able to see reports in web based portal.Based on Portal reports we identified Characteristics and Keyfigures.And some characteristics and keyfigures we are mapped with R/3 source fields and Source tables.And these are not standard reports and all are custom report.And there is no use of businee content.Based on these information we have to develop reports from scratch mean from starting i.e. identifying KFs and char's and mapping fields with R/3 here I have doubt we are unable to map some fields with R/3 what we have to do?what approach we have to take.How we identify datasource.what extractor method we have to follow.
    Please give ur suggestions.What we have to approach

  • Searching Web Apps with Data Source fields containing multiple values

    I have a Web App with a field allowing multiple values to be entered similar to the checkbox list. I need to restrict allowed values to a large, finite list of values currently stored in another Web App as the data source. I can't apply the Data Source field type as that only allows single value selection. I also need to be able to use the Web App Search form to search for items containing 1 OR more values in this field (the search functionality of a checklist field type). Here's what I've tried for field types:
    Text (string) or Text (multiline) field type - By saving a list of comma separated values (the same way that checkbox list outputs) to a text input or textarea, the search logic only searches for exact string (including commas) and doesn't parse the individual values.
    List (checkbox list) field type - This allows me to search multiple values using OR logic, but the web app will only store values that have been entered as options in the actual web app field setup. I tried using a checkbox list with minimal or empty options hoping that whatever values I sent over in a comma separated string value would still get stored, but because the values came from my Web App data source and not the list of options stored with the field, they were not saved.
    Has anyone found a way to do this?
    My other question is about how I might use a similar multi-value field as described above but return search results containing items with ALL selected values for that field (AND logic).
    Can anyone enlighten me to the inner workings of BC web app search logic?

    Thanks Robert.
    You'll need to create your own interface to the webapp database for those kind of data operations
    by this, are you speaking of the internal BC database which stores web app schema data? That would be great if it were possible to update that programmatically because I need to use the List (Checkbox List) field type (for the search functionality), but I need to supply the checkbox options from a web app rather than by manually updating the list entered in the Fields view of the web app settings (shown below).
    I'm curious if anyone else has tried this?
    Again, my reason for needing to use the List (Checkbox List) field type is that the page which processes searches knows to expect a comma separated list for this field type and then appears to be parsing out the individual values for searching out web app items with 1 or more matching values. You're right that text fields (string and multiline) just check for 'string contains' matches, and this would be ok if I was only ever needing to search just one value at a time. Here's an example of what I might do:
    Web App item field value (as recorded against the List (Checkbox List) field type:
    8294877,8294878
    Web App Search value (for this same field):
    8294879,8294877,8294885
    The search would return this web app item because the field contains 2 (1 or more) individual values even though they were entered into the search field in a different order. If this web app item were just a Text (string or multiline) field, the searched value is not a substring of the web app item's stored value, so it would not find a match. Hence the need to use Checkbox List field type.
    The web app will have thousands if not 10s of thousands of records, so dumping them all into one big array or object and searching on the front-end won't be practical (though it works great on smaller datasets).

  • Mapping JDBC lookup: Passing values to multiple fields at target

    Hi all
    i my scenario  i am using mapping JDBC lookup ,and it is working sucessfully.
    but i need to select 4 fields from lookups select query and passing it to 3 different target field at target MT.
    if i use Global container object methods,than only 1 field i can store inglobal container variable..
    and return it 1 the target fields...
    BUT how do i pass 4 fields ,result of the select query to 4 different fields at target MT..
    query :"
    Select BPNO,emp,BENR,bacepack from Ztable where BPNO='"+BPNO[0]+"'";
    Regards
    AjayP

    Hi,
    I have to fetch 3 values and populate it to the 3 fields in the target. The UDF am using is as attached. This UDF is for fetching one value. Kindly tell me about the changes I will have to make to fetch 3 values instead of 1 value.
    String Query = " ";
    Channel channel = null;
    DataBaseAccessor accessor = null;               
    DataBaseResult resultSet = null;                
    // Query to retrieve the PROP value for the particular source value passed.
    Query ="Select PROP from TANKS where ID='" + ID[0] + "' ";
    try{
    //Determine a channel, as created in the Configuration
    channel = LookupService.getChannel("<Business Service>","<Communication Channel>");
    //Get a system accessor for the channel. As the call is being made to an DB, an DatabaseAccessor is obtained.
    accessor = LookupService.getDataBaseAccessor(channel);
    //Execute Query and get the values in resultset
    resultSet = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();                      
    result.addValue((String)rowMap.get("PROP"));       
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!=null) accessor.close();
    catch(Exception e){
    result.addValue(e.getMessage());

  • Best Practive - One mapping reading multiple source files

    I want to develop a solution for one single mapping reading multiple similar source files that are stored on different directories on my OWB server. I want to be able to determine on runtime of my mapping from what location to load the source file from.
    Example:
    Mapping: Load_test_data
    source file 1: c:\input\loc1\test.dat
    source file 1: c:\input\loc2\test.dat
    When I run the mapping I would like to use an input parameter specifying the location loc1 or loc2. I would also like to use this input parameter in my mapping to populate one column in my target table with the value of this input parameter. This design would make it possible to dynamically load source files from different directories and also being able to see after loading where the data came from.
    Questions:
    - Is there a way to create such a design
    - If not, what alternative would be appropriate.
    Thanks in advance for the feedback

    Thanks for the feedback. Unfortunately I do not use workflow together with my OWB.
    I now indeed specified the file name and file location in the configuration of my mapping. However I am not able to change then upon executing the mapping. Data file name and file location are empty and greyed out when I execute my mapping. It always takes the values I specified in the configuration of my mapping
    What I would like to do is specify the location upon runtime when I execute my mapping, but I don't know if this is possible. In addition I'd also want to use the data file location as an input parameter for one of the columns I populated in my target table.
    Then in the end I would be able to use one mapping and read multiple sources files from different locations and also be able to check in the end where the data was loaded from.
    Hope you can give me some more feedback on how to set this up in OWB.
    Many Thanks!
    data file name parameter to ma

  • Transforming multiple occurence source element to target

    hi,
    i need help in mapping multiple occurrence source elements in source schema to target...
    unable to add for each in source...
    i need to map between an source schema and database schema
    this source schema has elemnts which is of multiple occurrence. so how do i insert records?? looping the entire transformation is an overhead to database.
    can many to one mapping be done in BPEL..??
    please help...
    Edited by: 870953 on Jul 7, 2011 4:27 AM

    Hi,
    this is forum for problems with Oracle SQL Developer Data Modeler. You need to find the right forum for your tool.
    Philip

  • Deleting the source field in the mapping sector in LSMW....

    hi experts...
    i ve mapped two souce field in same target str...but i cannot delete the one souce field...how i can delete the one source field....
    regards,
    velu...

    IF you have two different Software Component versions.
    Then in SLD , you should Create Dependencies/ PreRequesties.
    By assigning appropriate depencies and Prerequesties , you can see the object of one SWCV in Other SWCV also.
    Lets Say .
    A SWCV has
    DT
    MT
    SI
    ACTION
    B SWCV has
    MM
    as MM on B SWCV needs to access the Objects(DT,MT,SI,Action) from A SWCV ,
    Now on SLD, SWCV A should be add on prerequesties of B SWCV.
    or
    Now on SLD , SWCV B Should add dependent A SWCV.
    Regards
    PS

  • When defining copy rules, only one source field allowed

    Our users have requested the facility to allow them to copy pricing condition records when in in VK12 transaction. But when configuring the copy rules, we have come across the following problem:
    When configuring copying rules for copying pricing condition records,
    there is no possibility to use more than one source/target fields.
    In our example, the condition table created for a certain pricing
    access sequence contains keys such as Sales Organization, Sold-to Party
    "and" Product Hierarchies level 1 to level 9 (e.g. PH1 - PH9) .
    In the condition table definition, fields PH1 to PH9, although key
    fields, are also defined as footer fields. This means that per sales
    organization and sold-to party, we can create more than one condition
    record based on different combinations of PH1 to PH9.
    However when setting up copy rules for conditions in SPRO (SD -
    Pricing Control - Copy Control for Conditions) to allow our users to copy the condition records, for a given Source /
    Target table, the standard selection screen only allows us to define one Source / Target field.
    In our case, this is not helpful. The configurator should be allowed
    to select more than one source field (i.e. PH1 and PH2 and ..... PH9). At this moment,
    we can only select as source field PH1 or PH2 or PH3., etc..
    Steps for the Reconstruction:
    - Run Spro.
    - Select SD --> Pricing --> Pricing control --> Copy control for conditions -- > Copying rule for conditions
    - Select 'New Entries'. Selection screen is displayed. The issue is that in this selection screen, the configurator is allowed to select only one source field. He should be allowed to select multiple fields.
    Can you help us with this problem please?
    Your help is much appreciated!
    Edited by: C. Hassink on Feb 2, 2008 3:50 PM
    Edited by: C. Hassink on Feb 2, 2008 3:52 PM
    Edited by: C. Hassink on Feb 2, 2008 3:53 PM
    Edited by: C. Hassink on Feb 2, 2008 3:55 PM
    Edited by: C. Hassink on Feb 2, 2008 3:56 PM

    Hi Ralph,
    I don't like that methode. Importing the same transport 15 times, each time changing the source-system mapping and making sure, that source-system gets the changes seems to be a huge source of errors, which will be hard to find.
    What do you think of the following idea to solve the issue a totally different way:
    All transfer-rules directly connected to the source-systems are stripped of all Coding, so there is a plain 1 by 1 transformation including 0logsys.
    The InfoSources attached all lead to one ODS-Object, which has the only purpose to collect the data from the source-system without any transformation. So some fields a filled by a system and other fields maybe not.
    The coding specific for source-systems is moved to transfer- / update-rules from that ODS-Object to the original ODS-Objects / Cubes and the "collecting" ODS-Object is emptied after every loading process.
    This will result in a single point of change. It will be quite a huge program (maybe in startroutine) but it's the one and only point, where changes and corrections have to be made.
    Regards
    Robert

  • Open Hub - Data from multiple sources to single target

    Hello,
    I am using Open Hub to send the data from SAP BI to Flat files. I have a requirement where I want to create a single destination from multiple sources. In other words in BI we have different tables for attributes and text. I would like to combine the data from attributes  and text into a single file. For eg. I want to have material attributes and text in the same single file as output.
    Is this possible in Open Hub? If yes could you please help me to understand the process.
    Thanks,
    KK

    Hi,
    1. Create the Info Spoke and activate it
    2. Change it and go to transformation
    3. Check the box InfoSpoke with Transf. Using BAdI
    4. You are asked if you want to generate the spoke. Say yes & Simply set some texts and activate here, then return.
    5. You can now change the target structure. Simply create a Z structure with all the attributs & text field in it in the SE11 and enter it here.
    6. Double click on BAdI implementation & then double click again on "TRANSFORM" method of the implementation. It will take you to method  
    "IF_EX_OPENHUB_TRANSFORM~TRANSFORM"
    7. Write a code to select & fill the text field & map other filed with the attribute fields.
    Example:
    ZEMPLOYEE_ATTR_STRU - Target Structure for InfoSpoke EMPLOYEE_ATTR
    EMPLOYEE     /BI0/OIEMPLOYEE     NUMC     8     0     Employee
    DATETO     /BI0/OIDATETO     DATS     8     0     Valid to
    DATEFROM     /BI0/OIDATEFROM     DATS     8     0     Valid from
    COMP_CODE     /BI0/OICOMP_CODE     CHAR     4     0     Company code
    CO_MST_AR     /BI0/OICO_MST_AR     CHAR     4     0     Controlling Area of Master Cost Center
    HRPOSITION     /BI0/OIHRPOSITION     NUMC     8     0     Position
    MAST_CCTR     /BI0/OIMAST_CCTR     CHAR     10     0     Master Cost Center
    TXTMD     RSTXTMD     CHAR     40     0     Medium description
    Note: Text and attribute are in same structure.

  • Handeling mapping with multiple nodes

    Hi,
                We are doing an IDOC to SOAP scenario, in which we have multiple nodes in source structure. In destination structure we have one node having multiple occurences (1..99). We are trying to do the mapping in such a way that on the basis of no. of nodes at source side, nodes at destination side should be created.
                                  Any idea how to perform this mapping? Is it necessary to use BPM for this?

    1. Node 1 -> count ->
    2. Node 2 -> count ->
    3. Use ADD(std function) 1 and 2
    4. then after step 3 use UDF given below and then mapp to target node
    create advance UDF function and click on radio button "Queue".
    in the imports section enter java.lang.;java.util.;java.lang.reflect.;java.io.;
       //write your code here
    String e = a[0];
      int b = Integer.parseInt(e);
    for(int i=0;i<b;i++)
    result.addValue("1");
    result.addContextChange();
    This is working for me...
    suppose node1 occurs 3 times and node2 occurs 2 times the target node will occur 3 + 2 = 5 times
    Giving points is another way to say thanks
    Edited by: Tarang Shah on Mar 4, 2009 2:06 PM

Maybe you are looking for