Number of Item segments determine number of occurences in 1:N multi mapping

I'm trying to split MATMAS05 to multiple occurences of MATMAS05 1:N. The target MATMAS05 I have duplicated it a few times depending on the number of plants.
If E1MARCM-WERKS = 1234 then assign MATMAS05 -> MATMAS05
/ns0:Messages/ns0:Message1/MATMAS05=ifWithoutElse([keepss=false]stringEquals(removeContexts(/ns0:Messages/ns0:Message1/MATMAS05/IDOC/E1MARAM/E1MARCM/WERKS=), const([value=1234])), /ns0:Messages/ns0:Message1/MATMAS05=)
The above logic gives me the error:
11:51:28 Start of test
Compilation of MM_Split_MATMAS05 successful Cannot produce target element /ns0:Messages/ns0:Message1/MATMAS05[2]/IDOC. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element /ns0:Messages/ns0:Message1/MATMAS05[2]/IDOC. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
11:51:44 End of test
Could someone kindly advice what is the mistake here?

Hi Abhishek,
The target message in the MM under the tab Messages I have changed the occurence from 1 to 0..unbounded and after that I right clicked and duplicated the subtree for MATMAS05. So now in the MM window it shows as below:
Messages            1:1
  Message1          1:1
       MATMAS05      0..unbounded
       MATMAS05      0..unbounded
       MATMAS05      0..unbounded
and my mapping condition is as follows:
/ns0:Messages/ns0:Message1/MATMAS05=ifWithoutElse([keepss=false]stringEquals(removeContexts(/ns0:Messages/ns0:Message1/MATMAS05/IDOC/E1MARAM/E1MARCM/WERKS=), const([value=4510])), /ns0:Messages/ns0:Message1/MATMAS05=)
Regards,
// Saj

Similar Messages

  • How to find the number of occurence of a string

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    here i need to find the number of occurence of the string "experience".
    how to find it out?

    String str="The AR tech seeks experienced candidates in java,jsp. The candidates should have atleast 1 year of experience in the specified skills.";
    String findStr = "experience";
    int count = 0;
    int index = 0;
    while(index != -1) {
    index = str.indexOf(findStr, (count == 0 ? 0 : index + findStr.length()));
    if(index != -1) {
    count++;

  • How to find out the number of occurence of special character

    Hi ,
    I have a string coming coming in I/p which is like '1;2;100;201;'
    I need to break up this string and run my process for each value ( i.e for 1,2,100 and 201).
    How i can know the count of number of occurences of ';' character?
    How i can loop so that it runs once for each value?

    1. Split, pre Oracle 10g...
    ===========================
    with t as (select '10,aaaa,20,vvvvv,30,xxx''xx,12,12,56' txt from dual)
    select substr( txt
                 , decode(level, 1, 1, instr(txt, ',', 1, level-1)+1)
                 , decode(instr(txt, ',', 1, level), 0, length(txt), instr(txt, ',', 1, level)
                   - decode(level, 1, 0, instr(txt, ',', 1, level-1))-1)
                 ) val
    from t
    connect by level <= length(txt)-length(replace(txt,','))+1
    VAL
    10
    aaaa
    20
    vvvvv
    30
    xxx'xx
    12
    12
    56
    9 rows selected.2. Split, 10g onwards using regular expressions
    ===============================================
    with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' as txt from dual)
    -- end of sample data
    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
    from t
    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
    REGEXP_SUBSTR(TXT,'[^,]+',1,LE
    aaaa
    bbbb
    cccc
    dddd
    eeee
    ffff
    7 rows selected.example usage with varying IN clause...
    SQL> ed
    Wrote file afiedt.buf
      1  select *
      2  from emp
      3  where ename in (
      4    with t as (select '&input_string' as txt from dual)
      5    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
      6    from t
      7    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
      8*   )
    SQL> /
    Enter value for input_string: SCOTT,JAMES
    old   4:   with t as (select '&input_string' as txt from dual)
    new   4:   with t as (select 'SCOTT,JAMES' as txt from dual)
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 19-04-1987 00:00:00       3000                    20
          7900 JAMES      CLERK           7698 03-12-1981 00:00:00        950                    30
    SQL>3. Split 10g onwards using XMLTABLE...
    ======================================
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'This is some sample text that needs splitting into words' as txt from dual)
      2  select x.*
      3  from t
      4      ,xmltable('x/y'
      5                passing xmltype('<x><y>'||replace(t.txt,' ','</y><y>')||'</y></x>')
      6                columns word varchar2(20) path '.'
      7*              ) x
    SQL> /
    WORD
    This
    is
    some
    sample
    text
    that
    needs
    splitting
    into
    words
    10 rows selected.

  • Get the number of occurences in a text

    Hi,
    Is there any way by which i can check the number of occurences of a word in a text ???
    for eg. i an have 'i am a good boy and i am a good man'
    i wnt to check the number of occurences of good in the above statemnt
    Ny way to do that..........
    Thanks

    Well, it was a silly suggestion from me regarding ";" or "." - of course they are nonword characters.
    Basically, the issue is the same as with
    SQL> with t as (
      2    select ' good good good good good good ' s from dual
      3  )
      4  select
      5  s,
      6  regexp_count(s,' good ') reg_count
      7  from t
      8  ;
    S                                REG_COUNT
    good good good good good good           3And i don't see at the moment a simple workaround...
    Best regards
    Maxim

  • Count the number of occurence in table with toplink

    Hi !
    there is no way to build a query with expressionbuilder or .... to count the number of occurences in my table ?
    i don't want use query " select count(*) from table "
    thanks

    Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
    If you are looking just to get the count from a table/class, you can use a ReportQuery:
    ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
    rquery.addCount(); //equivalent to count(*);
    session.executeQuery(rquery);
    You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
    Best Regards,
    Chris

  • Sql query: number of occurence of cellData on more thann one column in tabl

    I have employee table contains following rows.
    INSERT INTO employee VALUES (105, 'Srinath','vijay','Aeronautics', 27, 33000);
    INSERT INTO employee VALUES (105, 'Kumble','Anil','Aeronautics', 27, 33000);
    INSERT INTO employee VALUES (105, 'Prabhakar','Manoj','Aeronautics', 27, 33000);
    INSERT INTO employee VALUES (105, 'Srinath','Jawagal','Aeronautics', 27, 33000);
    INSERT INTO employee VALUES (105, 'Jawagal','Srinath','Aeronautics', 27, 33000);
    INSERT INTO employee VALUES (105, 'Mishra','Anil','Aeronautics', 27, 33000);
    INSERT INTO employee VALUES (105, 'Kumble','Prabhakar','Aeronautics', 27, 33000);select distinct first_name firstName,count(1) over (partition by first_name) firstNameCount from employee;
    and i got the follwoing result.
    (Srinath 2,Kumble 2,Prabhakar 1,Jawagal 1,Mishra 1)
    Now i want to consider second and third column both and want to number of occurence of table data on these two columns
    (Srinath 3,Kumble 2,Prabhakar 2,Jawagal 2,Mishra 1,vijay 1,Anil 2,Manoj 1)As Srinath is coming 3 times, kumble 2 times, Prabhakar 2 times,Jawagal 2 times,Mishra 1 times,vijay 1 times,Anil 2 times and Manoj 1 times.
    What will be my sql query?

    Try this
    select name, count(name) over(partition by name) cnt
      from (select first_name from employee union all select last_name from employee)

  • Count the number of occurences of a pattern in some files

    Hi,
    I am trying to extract some patterns in files using regex. I can easily extract the patterns using my program. I also wanted to count the number of occurences of the pattern in the files. For that I have written this code:
    int count=0;
              while (m.find())
                 System.out.println("Found Patterns: "+m.group());
                 count++;
           System.out.println(count);  //giving error saying identifier expectedUnfortunately I am getting an error saying identifier expected at the count line. What to do?
    Thanks

    Cheapside-Poultry wrote:
    Move the } down one line so the count is in scope.No, it looks like he just forgot the opening { with the while.                                                                                                                                                                                                                                                                                                                                       

  • I need to WAP to count the number of occurences of an alphabet in a string.

    I need to WAP to count the number of occurences of an alphabet in a string.I tried a lot and have surfed a lot regarding this problem.
    I m not the most proficient with java.but this is all i could come up with,and would appreciate some help here.I hope you guys would help me find a solution to this.
    e.g String : abcabrty
    Result should be
    a:2
    b:2
    c:1
    r:1
    t:1
    y:1
    public class chkoccurences
         public static void main(String args[ ])
              String user_Data=args[0];
              int counter=0;     
              try
                   for(int i=0;i<user_Data.length( );i++)
                        for(int j=0;j<user_Data.length( );j++)
                             if(user_Data.charAt(i) == user_Data.charAt(j))
                             counter++;
                        System.out.println(user_Data.charAt(i)+" exists "+counter+" time(s) in the word.");
                   System.out.println(" ");
              catch(ArrayIndexOutOfBoundsException e)
                   System.out.println("Check the array size.");
    }This is the output i get out of the program:
    a exists 2 time(s) in the word.
    b exists 4 time(s) in the word.
    c exists 5 time(s) in the word.
    a exists 7 time(s) in the word.
    b exists 9 time(s) in the word.
    r exists 10 time(s) in the word.
    t exists 11 time(s) in the word.
    y exists 12 time(s) in the word.What i think is i need an array to store the repeated characters because the repeated characters are getting counted again in the loop,if you know what i mean.
    Please, i would appreciate some help here.

    Criticism is welcomed
    public class tests {
         final int min = 10;
         final int max = 35;
         final char[] chars = new char[] {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
                   'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
                   'v', 'w', 'x', 'y', 'z'};
         public static void main(String[] args){
              tests t = new tests();
              String[] strings = new String[] {"aabcze", "att3%a", ""};
              for(String s : strings){
                   System.out.println(t.getAlphaCount(s));
         public String getAlphaCount(String s){
              int[] alphaCount = new int[26];
              int val;
              for(char c : s.toCharArray()){
                   val = Character.getNumericValue(c);
                   if( (val>=min) && (val<=max)){
                        alphaCount[val-min]++;
              StringBuilder result = new StringBuilder();
              for(int i=0; i<alphaCount.length; i++){
                   if(alphaCount[i] > 0){
                        result.append(chars[i] + ":" + alphaCount[i] + ", ");
              if(result.length() != 0){
                   result.delete(result.length()-2, result.length());
              return result.toString();
    }

  • Reliable detect number of occurences (table lock needed or ?)

    Hi all,
    I got an issue with detecting duplicate messages. Database clients process files and messages and create a hash value that is passed on to the database. The database should return the number of occurences of this hash value in the last (e.g) 14 days.
    create table HashHistory ( ID NUMBER,
    MESSAGEHASH VARCHAR2 (20),
    TS TIMESTAMP);
    create sequence SomeSequence;
    insert into HashHistory values (SomeSequence.nextval,'first hash', systimestamp);
    insert into HashHistory values (SomeSequence.nextval,'second hash', systimestamp);
    create or replace procedure DuplDetection  (p_HashIn varchar2,
                                         p_occurences OUT number) AS
    l_timestamp timestamp default systimestamp;                          
    begin
      -- possible exclusive table lock here... lock table HashHistory in exclusive mode;
      insert into HashHistory values (SomeSequence.nextval, p_HashIn, l_timestamp);
      select count (1)
      into p_occurences
      FROM HashHistory
      where MESSAGEHASH = p_HashIn
      and   TS < l_timestamp
      and   TS > l_timestamp-14;
      commit; --to release the table lock if applicable
    end;When this procedure is called by two different machines at the same time with the same new hash value ('third hash'). One session should return 0 while the other should return 1 as number of occurences.... With default Oracle behaviour using row level locks, and executing them in parallel both sessions will not be able to see the others sessions hash values, and both will return 0 occurences. Is an exclusive table lock my only option to enforce this behaviour or can I trust Oracle to handle this correctly?
    I expect 10^6 hashes each day and possible up to 10 or 20 clients running at the same time generating and checking these hash values. What are the changes of both sessions returning the same value without an exclusive table lock (as in this example)? What other parameters would you consider?
    I am on Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    Nicosa wrote:
    Hi,
    Wouldn'that work if you do it as follows ?insert into HashHistory values (SomeSequence.nextval, p_hashIn,...);
    commit;
    select count (1)
    into p_occurences
    FROM HashHistory
    where MESSAGEHASH = p_HashIn
    and   TS > l_timestamp-14
    and ID!=SomeSequence.currval;The second session should see that some others existing hash were inserted, and hence an be warned.No, it wouldn't work. Some kind of synchronization is required.
    In multi-threaded environment you cannot predict the order of execution of this program.
    Let say we have a server with only one processor and 3 users (sessions) connected to that server.
    Three users (let say U1, U2 and U3) call this procedure to insert the same hash. The procedure has 3 operations: insert, commit, select,
    and assume theoretically that these 3 operation are atomic (each takes only one processor cycle - in reality each of these operations can consume thousands of cycles).
    Server can execute these calls in this order:
    U1-insert (sequence + 1)
    U1-commit
    U1-select (returns 0)
    U2-insert (sequence + 1)
    U2-commit
    U2-select (returns 1)
    U3-insert (sequence + 1)
    U3-commit
    U3-select (returns 2)
    - in this scenario results will be OK.
    But the order might be:
    U1-insert (sequence + 1)
    U1-commit
    - here server decides to switch to another process/thread
    U2-insert (sequence + 1)
    U2-commit
    - server switches to proccess 3
    U3-insert (sequence + 1)
    U3-commit
    - server switches back to U2
    U2-Select (user 2 sees record commited by U1 and U3 and returns 2)
    - server switches to U3
    U3-Select (user 1 sees record commited by U1 and U2 and returns 2)
    - server switches to U1
    U1 - Select (this also returns 2)
    - results are 2,2,2, but should be 0,1,2
    If 20 users cal this procedure at the same moment with the same hash value, it is even possible that each user gets 19 as the final result,
    but proper results should be 0, 1, 2, 3 .... 19 ;)
    Without some kind of synchronization this a lottery.
    There is also another trap with the sequence - consider this example:
    Session 1
    SQL> create sequence abc;
    Sequence created.
    SQL> select abc.nextval from dual connect by level <=5;
       NEXTVAL
          1
          2
          3
          4
          5
    SQL> select abc.currval from dual;
       CURRVAL
          5Session 2
    SQL> select abc.nextval from dual;
       NEXTVAL
          6
    SQL> select abc.nextval from dual connect by level <=5;
       NEXTVAL
          7
          8
          9
         10
         11
    SQL> select abc.currval from dual;
       CURRVAL
         11Back to session 1
    SQL> select abc.currval from dual;
       CURRVAL
          5What happens in this scenario:
    - user 1 does insert (select nextval from the sequence)
    - user 2,3,4,5,6 ..... 100 call the procedure just 3 microseconds after U1 and do insert (increase the sequence)
    - user 1 retrieve currval from the sequence ?

  • Counting the number of occurences in a table column

    Hi All
    I have a table with a column that contains approx. 5000 6-digit codes. A number of these codes are duplicted in the column, and I want to count the number of occurences of each code. The column looks a bit like -
    WCID
    940042
    920012
    940652
    940199
    188949
    155146
    155196
    174196
    152148
    151281
    196209
    174015
    182163
    195465
    195318
    182008
    189589
    150675
    There can be mulitple instances of each WCID and I need to count the number of instances of each. I also have access to another table that also has a column of each WCID, but only once - ie no multiple instances. The second table is identical except that there are only single instances of each WCID.
    I thought I could either loop through on the table to be counted, from 100000 to 999999 and count each occurence that way, but it would be very inefficient. The other way I thought would be to perhaps select a WCID from the unique table, count the occurence of that, select the next WCID from the unique table, count that and so on, however I'm not sure how to do it in PL/SQL. Perhaps select the WCID from the unique table into a cursor, loop through that and compare it with the original table and count the instances?
    I hope this makes some sense, any help would be really appreciated
    Thanks
    Bill

    Hi, Bill,
    That sounds like a job for GROUP BY:
    SELECT    wcid
    ,         COUNT (*)       AS num_found
    FROM      table_x
    GROUP BY  wcid
    ORDER BY  wcid
    I hope that answers your question.
    If not, post CREATE TABLE and INSERT statements for a little sample data, and the results you want from that data.

  • How to count the number of occurences of a character

    hi
    wat command is used to count the number of occurences of a charcter in a line?
    i have to count the number of '.' in a line

    FIND
    Searches for patterns.
    Syntax
    FIND <p> IN [SECTION OFFSET <off> LENGTH <len> OF] <text>
                [IGNORING CASE|RESPECTING CASE]
                [IN BYTE MODE|IN CHARACTER MODE]
                [MATCH OFFSET <o>] [MATCH LENGTH <l>].
    The system searches the field <text> for the pattern <p>. The SECTION OFFSET <off> LENGTH <len> OF addition tells the system to search only from the <off> position in the length <len>. IGNORING CASE or RESPECTING CASE (default) specifies whether the search is to be case-sensitive. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions. The MATCH OFFSET and MATCH LENGTH additions set the offset of the first occurrence and length of the search string in the fields <p> and <l>.

  • To count the number of occurences of a character

    Hi All,
    Is there a particular function to count the number of occurences of a particular character in a string...?
    Let me know if u know the same.
    Thanx and regards
    Akshat

    A method with a test driver:
    public class a {
         public static void main(String args[]) {
              System.out.println(howmany(args[0],args[1].charAt(0)));
         public static int howmany(String what,char c) {
              String regexp = "" + c;
              String s=null;
              try     {
                   s=what.replaceAll(regexp,"");
              catch (Exception e) {          
                    regexp = "\\" + c;
                   s=what.replaceAll(regexp,"");
              return what.length() - s.length();
    }

  • Item category determination is not reflecting in item category field

    Dear Friends,
                   i have defined item category,while creating item category determination ,i am unable to see the item catogory defined by me,what should i do at this stage. can sumone plz advice me on wat to do to get it reflected.
    thanx
    Shiva.

    HI
    try to remove maximum number of hits while pressing F4 in the field item category

  • Regarding usage in item category determination

    what the use of usage in item category determination,how many types are usages are there in sap sd item category  determination

    Hi,
    An item categories usage is defined by SAP when creating a sales order. The system determines,
    for example, that the usage refers to a text item as opposed to a deliverable item when you enter test in the order item rather than a material number. Based on this usage, the system will use the item category determination to propose an item category.
    You can see all of the item category usage indicators in SPRO, SD > Sales > Sales Docs > Sales doc items > Define Item cat usage.
    Example:
    For Material Determination
    Usage we use is PSHP for Displaying Main Items
    Usage we use is PSEL for Displaying Sub Items
    This usage we use for OUTCOME
    Outcome: outcome controls whether substituted material
    Should be replaced or displayed as sub items.
    For Free Goods
    Usage is free
    Configure these usages in vov4.
    Regards,
    Abhee.

  • Configured Item -  append sequence with item segment

    Hi,
    Is there any possible to have sequence number starting from 1,2,3... for each CTO BOM?
    Say for example, there is a CTO BOM and out of which 10 possible configurations can be done and each configured item shoud have itemsegment-1, itemsegment-2...etc.
    Thanks in Advance!
    Kaveri

    Hi Sabari,
    Configurable BOM - item segment is C0200D0000XX and the setup made in BOM Parameters is 'Append sequence with Item Segment'
    The number generated for one of configuration is C0200D0000XX-6202980.
    My question is can't the sequence be started with 1 for each configurable BOM? If so how to do it?
    Example:
    Configurable BOMS - C0300D0000XX which supports five possible valid configurations and the item numbers expected are C0300D0000XX-1, C0300D0000XX-2, C0300D0000XX-3, C0300D0000XX-4, C0300D0000XX-5
    Another CTO BOM C00600D0000XX which supports 3 valid configurations and numbers would be C00600D0000XX-1, C00600D0000XX-2,C00600D0000XX-3
    Thanks,
    Kaveri

Maybe you are looking for

  • How do I combine 2 websites into one?

    I know this used to be possible, as I'd seen it posted here, but didn't take notes then background: we hold summer video camp at our church. The 2009 camp created the video and created their own web pages/site and uploaded it to the 'summercamp' webs

  • Design of Crystal Report in SAP B1 8.8 Version

    Hi,Please Tell me how can i designed & developed Crystal Report in SAP B1 8.8 version I want to display Sales Order in crystal report and work order report from screen made by screen printer

  • GPS maps on 8820 for Ukraine

    Hello! Where could I get the GPS maps for Ukraine? I see that maps for South America are very detalized since Kyiv is marked only as a dot. Please help me to obtain that maps. Thank you! WBR, Roman V. Sytnik

  • Dust under screen of Qosmio X500

    Hi I purchased a Qosmio X500 from Saudi Arabia in april last year and Ive brought it to india where I currently reside. Last week while randomly cleaning my screen I noticed few specks of dust within (underneath) the lcd/led panel. This does not hind

  • [SOLVED] How to use Linux Bash to Create an Array of Files in a Dir...

    So I created a bash script which executes at random one PHP script in a directory, scripts=( flag_videos_which_need_grabbing.php grab_video.php grab_speaker_image.php php -f /home/rt_cron/${scripts[$((RANDOM%${#scripts[*]}))]} > /dev/null 2>&1; Howev