If without else

hi, i am trying to create a drinks machine with 8 checkboxesand 2 textfields to display the drink chosen and the price. My question is when i come to the if statements i am getting an if without else error.I will post my code if some could just see if i am on the right lines i don't want the code changing, I would like to know if i am doing it right and if not where i am going wrong, i am a novice who is wanting to learn.
thankyou.
ps. sorry for not using code tags i tried to edit but was unable.
     public void itemStateChanged(ItemEvent ie)
          if(ie.getSource()==tea)
               if(tea.getState==true)
                    tf1.setText("TEA");
               else
                    tf1.setText("");
          if(ie.getSource()==coffee)
               if(coffee.getState()==true)
                    tf1.setText("COFFEE");
                    tf1.setText("");
          if(ie.getSource()==cocoa)
               if(cocoa.getState()==true)
                    tf1.setText("COCOA");
               else
                    tf1.setText("");
          if(ie.getSource()==chocolate)
               if(chocolate.getState()==true)
                    tf1.setText("CHOCOLATE");     
Message was edited by:
fowlergod09
Message was edited by:
fowlergod09
Message was edited by:
fowlergod09
Message was edited by:
fowlergod09

i have amended the code and now i am getting the following error message: cannot find symbol variable getState.
this is my full code.
* @(#)Drinksgui.java
* Drinksgui application
* @author
* @version 1.00 2007/1/2
iimport java.awt.*;
import java.awt.event.*;
class Drinksgui extends Frame implements ItemListener
     private Panel tPanel,bPanel,lPanel,rPanel;
     private Checkbox tea,coffee,cocoa,chocolate,sugar,cream,ffmilk,semi;
     private TextField tf1,tf2;
     private Label title;     public Drinksgui()
          setLayout(new BorderLayout());
          setBackground(Color.cyan);
          tPanel=new Panel();
          bPanel=new Panel();
          lPanel=new Panel();
          rPanel=new Panel();
          tPanel.setLayout(new FlowLayout());
          tPanel.setBackground(Color.red);
          bPanel.setLayout(new FlowLayout());
          bPanel.setBackground(Color.red);
          lPanel.setLayout(new GridLayout(4,1,0,0));
          lPanel.setBackground(Color.GREEN);
          rPanel.setLayout(new GridLayout(4,1,0,0));
          rPanel.setBackground(Color.green);
          tea=new Checkbox("TEA");
          tea.addItemListener(this);
          coffee=new Checkbox("COFFEE");
          coffee.addItemListener(this);
          cocoa=new Checkbox("COCOA");
          cocoa.addItemListener(this);
          chocolate=new Checkbox("DRINKING CHOCOLATE");
          chocolate.addItemListener(this);
          sugar=new Checkbox("SUGAR");
          sugar.addItemListener(this);
          ffmilk=new Checkbox("FULL FAT MILK");
          ffmilk.addItemListener(this);
          semi=new Checkbox("SEMI-SKIMMED MILK");
          semi.addItemListener(this);
          cream=new Checkbox("CREAM");
          cream.addItemListener(this);
          tf1=new TextField(20);
          tf2=new TextField(10);
          title=new Label("DRINKS MACHINE");
          tPanel.add("Center",title);
          bPanel.add("East",tf1);
          bPanel.add("West",tf2);
          rPanel.add(tea);
          rPanel.add(coffee);
          rPanel.add(cocoa);
          rPanel.add(chocolate);
          lPanel.add(sugar);
          lPanel.add(cream);
          lPanel.add(ffmilk);
          lPanel.add(semi);
          add("North",tPanel);
          add("South",bPanel);
          add("East",rPanel);
          add("West",lPanel);
          addWindowListener(new WindowAdapter()
               public void windowClosing(WindowEvent e)
                    dispose();
                    System.exit(0);
     }                public static void main(String[] args)
           Drinksgui mainFrame=new Drinksgui();
           mainFrame.setSize(600,600);
           mainFrame.setTitle("DRINKS GUI");
           mainFrame.setVisible(true);           
      }     public void itemStateChanged(ItemEvent ie) {
     if (ie.getSource() == tea) {
          if (tea.getState == true) {
               tf1.setText("TEA");
          else {
               tf1.setText("");
     else if (ie.getSource() == coffee) {
          if (coffee.getState() == true) {
               tf1.setText("COFFEE");
          tf1.setText("");
     if (ie.getSource() == cocoa) {
          if (cocoa.getState() == true) {
               tf1.setText("COCOA");
          else {
               tf1.setText("");               
     else if (ie.getSource() == chocolate) {
          if (chocolate.getState() == true) {
               tf1.setText("CHOCOLATE");
     else if (ie.getSource() == sugar) {
          if (sugar.getState() == true){
               tf2.setText("+SUGAR");
          else {
               tf2.setText("");
     else if (ie.getSource() == cream){
          if (cream.getState() == true){
               tf2.setText("+CREAM");
     else if (ie.getSource() == ffmilk){
          if (ffmilk.getState() == true){
               tf2.setText("+FULL FAT MILK");
          else {
               tf2.setText("");
     else if (ie.getSource() == semi){
          if (semi.getState()==true){
               tf2.setText("+SEMI-SKIMMED MILK");
          else {
               tf2.setText("");
}Message was edited by:
fowlergod09

Similar Messages

  • Mapping , If condition without else values get suppressed

    Hi All,
                   I am using If condition without else , it is such that when my condition is satisfied it must pass some values to the target field, i have set the properties as True, but when i check the queque , i find that even though value is true it is suppressed ,
    please help me in this thaning you
    Sridhar

    Hi Sridhar,
    There is bug in ifwithoutElse in PI7.1.
    1) you check or or don't check the Keeps property it will always pass the SUPPRESS if the input is false
    2) If you have not mapped the output of ifWithoutElse directly to the output field it will not pass SUPPRESS(Not Change context) to the target if value is false .
    if you have used some logic between the output of ifWithoutElse and the Target then the output will not be the desired one. (And the same problem you are facing).
    There is seems to be some context change happend due to this behaviour in your case.
    As a work around create UDF to function as ifWithoutElse.
    Not Sure if SAP has Released any patches for this.
    Thanks,
    Sunil Singh

  • IF..THEN..ELSE...not working properly

    Hi experts,
    iam facing trouble with IF ..THEN..ELSE function.
    condition is  IF the salearea = 'AB'
    THEN  date trans DDMMYY------>YYYYMMDD
    ELSE date trans MMDDYY----
    >YYYYMMDD
    here always the only  ELSE part working. but if use IF WITHOUT ELSE  like below
    IF the salearea = 'AB'
    THEN  date trans DDMMYY------>YYYYMMDD
    then above condition is working
    iam really not understand the behaviour of IF..THEN..ELSE
    could please suggest how can i resolve the issue
    Thanks
    vasavi

    Hi,
    Check the OSS note 1090369.
    https://service.sap.com/sap/support/notes/1090369
    From SAP Note----
    Symptom
    The behaviour of functions 'if' and 'ifWithoutElse' in Message-Mapping has been changed. We have changed it after we've become aware of the fact that both functions behave inconsistently with the documentation.
    This change has some important consequences, which are described in this note.
    Let us consider the function 'if'. The situation with 'ifWithoutElse' is analogous to it.
    There are, in fact, two distinct use-cases for the function 'if':
    1. One is when the function is used as an if statement. For example, consider this pseudocode:
    if <condition>
      value = <expression1>
    else
      value = <expression2>
    end
    In this case, one expects that the <condition> expression is evaluated first and then, depending on the value of the condition, one of the branch expressions is evaluated and assigned to variable 'value'.
    2. The second use case is when the function is used as a procedure. In pseudocode:
    value = if (<condition>, <expression1>, <expression2>)
    In this case, all three expressions (<condition>, <expression1> and <expression2>) whould be evaluated first and the results of this expressions would be passed to function 'if', which in turn, would return one of them, depending on condition value, to be assigned to 'value' variable. This second use-case is also known in some programming languages as function 'iif'.
    In Message-Mapping, the analog of evaluating an expression is advancing a pointer on one of the argument queues of a function. It turned out that the function 'if' did not consistently work either way and that the customers need both variants of the function. The SAP Note 1053706 has delivered the first patch to the function 'if'. This patch was not functionally complete and the function 'if' was patched again. The SAP Note 1085331 has delivered the finally fixed function 'if'. With this Note, the function always works as in use-case 2 above. That is, all arguments are evaluated first, then value of one of them is returned. To minimize compatibility problems with old usages, the function makes one exception to this rule: in case when evaluating one of the branches throws an Exception, the function ignores it, if the exception is in the branch that is not selected by condition.
    This change in behaviour can lead to some of the Message-Mappings producing different results than before implementing the patch.
    One common problem situation is when one of the branches of function 'if' contains a User-Defined function that produces side-effects. Like increments and stores a counter in 'GlobalContainer', for example. Such functions will be executed more times than before and will cause the numbering to go awry.
    Other terms
    Message Mapping, XI, PI, IF,IFS IFSWIthoutElse Boolean functions
    Reason and Prerequisites
    See above.
    Solution
    To provide customers with functions to use in use-case 1 above, SAP will deliver new standard functions 'ifS' and 'ifSWithoutElse'. The 'S' in the names states for 'Statement'. The new functions will be delivered in
    Patch level 1 of SP21 of XITOOLS 3.0,
    and SP22 onwards
    Patch level 1 of SP14 of XITOOLS 7.0,
    Patch level 2 of SP15 of XITOOLS 7.0
    and SP16 onwards
    SP05 of SAPXIESR 7.1 and SAPXIPCK 7.1,
    and subsequent Support Packages of each corresponding major release.
    It is not recommended to install the patches between SAP Note 1053706 and 1085331. If you decide to install a patch from Note 1085331 or any subsequent release, carefully test Message-Mappings before deploying the patch in productive systems.
    In case the upgrade is necessary and Message-Mappings do not work as before, there is a possibility to workaround the problem. There's no known generic workaround for all kinds of problems that can arise.
    Note :
    IFS and IFSWIthoutElse functions have a Limitation.
    When the The IFS and IFSWIthoutElse functions have the UDF of type Queue or Context, it will be executed unconditionally.
    i.e the Queue UDF will be executed once even it does not have a matching condition in the input queue and the Context UDF will be executed once for every Context in the input queue, even if there is no matching condition in the input context.
    For situation with functions leaving side-effects described above, we recommend to add a new argument to the User-Defined Function and create the side-effect conditionally based on that argument. Most probably you will want to put in this additional argument the same queue that you use in condition for function 'ifS'.
    Please read the relevant Note 1158485 also.
    END of Note -
    Thanks
    SaNv...

  • Mapping Problem with IF...Else

    HI,
    im having problems with my if then else condition.
    What i want to have. (ORDERS IDOC)
    IF E1EDKA1-PARVW = WE and
        E1EDKA1-LIFNR = "XX" then CONSTANT ("true")
    else Constant ("false").
    If i use only one E1EDKA1 segment ... it works.
    If i use many E1EDKA1 segments and use if without else ... it works.
    But i cant get it with if then else. I will allways get the else value.
    any ideas ?
    Gordon
    Message was edited by:
            Gordon Breuer

    HI,
    <b>In your example data only one true and two false right?</b>
    try the below UDF
    use parvw - removecontext -- UDF -- split byvalue --target node
    use lifnr -- remove context --- /
    while creating UDF ---Input parvw,lifnr , select the queue option for User defined function
    for (int i =0;i < parvw.length;i++){
    if parvw(i).equals("WE") && lifnr(i).equals("xx"){
    result.addValue("true");
    }else
    result.addValue("false");
    Note the "true" and "false" are not equal to boolean values do not compare.
    Regards
    Chilla
    reward points...
    Message was edited by:
            Chandra Sekhar Chilla

  • My 'IF THEN ELSE' possible with graphical mapping tool ?

    Hello,
    Being new to XI I got into some issues during message mappings.
    I want to say:
    if externrole = 'BY'
       then saprole = 'AG' and sappartner = externpartner.
    else.
    if externrole = 'DP'
       then saprole = 'WE' and sappartner = externpartner.
    endif.
    I try this with the graphical mapping. Is this possible ?
    How do I link two standard 'if' functions together.
    Robert

    Hi Robert,
    This is possible by graphical mapping. Do the mapping in the following way.
    ->Use if with else
      *if--->externrole EqualsS AG
      *then->AG[Constant]
      *Else->o\p of the following IF w\o Else.
      *O\p-->saprole
    ->If without Else
      *if--->externrole EqualsS DP
      *then->WE[Constant]
    ->For sappartner map it to externalpartner.
    Hope this helps.
    Regards,
    Jesse.
    Message was edited by: Jesse George

  • Mapping Issue: How to split the value  of Lineitem

    Hi  All,
    I have issue in Mapping .XML-> BAPI Scenario
    1 line item  has the  one 50% Cost Centre , another 50% Cost centre data
    2 line item has only      100% WBS elemnt
    WBS elemnt mapping :
    If A |EQUALS (Text) | WBS_ELEMNT   |If without else|  B(WBS value)  |REmoveContexs| SplitByValue|   WBS_ELEMNT(BAPI field)
    But this supress second line item : WBS_ELEMNT data and uploads into1.Item .Hence PO is not getting created in SAP.
    Could you please giv me a logic to actaually split the value into 2 seperate so that respective data of each line item  are split properly .
    Thank you ,
    Vara

    Hi I think you need an udf for this:
    int total = Integer.parseInt(value[0]);
    result.addValue(Integer.toString(a/2));
    result.addValue(Integer.toString(a/2));
    and after it you can add a splitbyvalue

  • Help required for mapping

    Hi experts,
    i require to populate the target node based on conditions from the input fields...
    I need to check for 5 values for a field and if yes then only target node needs to be created..
    Ex: input: master
          oouput: group
    group node needs to be populated only if master is equal to 100,200,300,400..if not no node...
    how to achive this....
    Thanks in advance.

    Hi reddy,
    We have an option called <b>"fix values"</b> in mapping under conversion functions,
    map the source field to the fix values , in fix values enter the key as 100,500..... and all the corresponding values as Y,
    Then in mapping you can make a single condition "IF without Else" and check the output of the FIX values for Y, IF output is equal to Y then pass the sorce field.
    this is for simplifying your logic by using single condition in mapping.
    Contact me at [email protected] for a screenshot of this mapping
    Thanks
    Saravanan.N
    Message was edited by:
            saravanan

  • Supress Column Heading - File Content Conversion in Sender Adapter

    Hi,
    Let me give a more clear picture about my scenario.  I need to convert CSV File to XML output:-
    My source file has column heading and values.  The sample data is mentioned hereunder:-
    PERNR;KID;PNALT;NACHN;NAME2;VORNA
    ;1200;1200;Angus
    I have created a data type as under:-
    DT_LegacyEmployee (Category - Complex Type)
         Employees (Category - Element, Occurence - 1)
              Header (Category - Element, Occurence - 0...1)
                   PERNR_H
                   KID_H
                   PNALT_H
                   NACHN_H
                   NAME2_H
                   VORNA_H
              Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)
                   PERNR
                   KID
                   PNALT
                   NACHN
                   NAME2
                   VORNA
    The file conversion parameters in the file sender adapter are mentioned hereunder:-
    Document Name - MT_LegacyEmployee
    Document Namespace - http://abc.com/xi
    Recordset Name - Employees
    Rescordset Structure - Header,1,Employee,*
    Recordsets per Message - 1
    Key Field Type - String (Case Sensitive)
    Employee.fieldSeparator - ;
    Employee.endSeparator - 'nl'
    Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA
    I dont' have a key field value.  How do we remove the header and show only the values in the xml output.  I have searched the forum topics as well checked many blogs related to file content conversion, but nothing helped.  Kindly advice how to fix this issue.  Thanks in advance.
    Regards.
    Praveen

    Hi Praveen,
    Change your File Adapter as below
    Document Name - MT_LegacyEmployee
    Document Namespace - http://abc.com/xi
    Recordset Name - Employees
    Rescordset Structure - Employee,*
    Recordsets per Message - 1
    Key Field Type - String (Case Sensitive)
    Employee.fieldSeparator - ;
    Employee.endSeparator - 'nl'
    Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA
    There is no need for the Header required in the data type.
    DT_LegacyEmployee (Category - Complex Type)
    Employees (Category - Element, Occurence - 1)
    Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)
    PERNR
    KID
    PNALT
    NACHN
    NAME2
    VORNA
    Now the trick is in the mapping program
    Lets assume your mapping looks like
    MT_LegacyEmployee ---> MT_TargetEmployee
    - Employees ---> Records
       - Employee ---> Record
         - PERNR  ---> TargetPERNR
         - .. so on
    When you do a mapping from Employee ---> Record apply the following logic.
    (PERNR)--->
                 (TestEquals =) --->(NOT)--->
    (Constant) --->                                (IF)
    (PERNR)                       (IF Without Else) ---> (Record)
                                                   (THEN)
                                (Employee)--->
    When doing this make sure RightClick on PERNR and Select Context ---> Employees.
    By default context would be from Employee and it will give you an error of XSD format. So make sure you are changing the context.

  • In XML field is missed

    Hi All,
    I have query related field mapping. My field mapping is working in Development server but same mapping is not working in QA. In QA i can see all mapping. During IDOC generation in one field record is coming, but in XML particular field is not showing. Plesae suggest me. What is the problrm behind this issue?
    Thanks
    Amit

    Amit,
    try to trace the error:
    1) go to xml monitor and save the input (inbound message) as a xml file.
    2) go to Design and goto Tab Test.
    3) open your xml file and process your test.
    I think this is a good way to trace the issue.
    I think you have an empty value (maybe if without else) in your target field, and empty fileds are not shown in the xml output.
    Or try to check your xml structure in the target system. Maybe this one is different to your DEV structure.
    Good luck!,
    Gordon

  • Generating target nodes dynamically in message mapping

    Hi XI GURUS
    I am trying to generate target node using using more then source node. Is it possible to do this.
    I need this as in source I have 2 different nodes (0 to unbounded) and in target I want to create corresponding number of target nodes. For e.g if I have 2 + 1 nodes in source then I want to create 3 nodes in target
    Source as below
    <FIRSTNAME>
         <Raj>
         <Kum>
    </FIRSTNAME>
    <FIRSTNAME>
         <Naveen>
         <Kumar>
    </FIRSTNAME>
    <CITY>
    <bANGALORE>
    </CITY>
    Desired output in target as below
    <ADDRESS>
    <qwerty1>
    <ADDRESS>
    <ADDRESS>
    <qwerty2>
    <ADDRESS>
    <ADDRESS>
    <qwerty2>
    <ADDRESS>
    Can i follow an alternative approach (using java function) of counting the total number of occurences of  source nodes and generating as many number of the target node
    Thanx

    If you have a condition check for each of the source node to be mapped to the target node,
    use "create if" standard function and pass the boolean result of your Condition check as an input to this standard function. For each "true" a value would be added to the output queue. If you have a simple condition check on some source field value for each correspoding node, use "if without else" or depending on the complexity of the condition you may use a udf to get the boolean outcome.
    And for mapping from more than on type of source node, you may duplicate subtree for target node.
    Regards,
    Suddha

  • Xi  3.0 to PI 7.1 Upgrade issues

    Hi,
    We are upgrading our system from XI 3.0 to PI 7.1. There are 30-40 interfaces running in our landscape . Can anyone please tell me whether it is needed to test all these interfaces after upgrade?
    I have read many blogs about the same topic in sdn and collected few points.
    the follwoing interfaces needs to be tested :
    1.interfaces with third party adapters
    2.interfaces with adapter modules deployed  on the adapter engine
    3.interfaces using java proxy for communication
    4.interfaces having xslt mapping,java mapping in the design
    5.interfaces with user defined function in the  mapping
    6.interfaces using standard functions like ifs,if without else etc in the mapping
    7.if idoc is used, then , should be tested  towards triggering and posting of the IDOC.
    8.if XSD is used in any of the interfaces then they should be tested to see if the XSD is working fine
    9.interfaces  Using HTTPS
    please let me know if there are any other conditions missing .
    Regards
    Jagruthi

    For 30-40 interfaces, it would be better to perform tests for all of them. Only if you have say more than 100 interfaces, then you may think of eliminating few of the. This is because even if your interface does not fall into the list you have given or any new list provided by anyone on forums, you are still under risk that your interface could fail.
    e.g. say you are using file adapter without any modules. Now no1 will suggest you that you test it. But suppose you are using the feature "Msecs to Wait Before Modification Check" in XI 3.0. Now this option is no longer available in PI 7.1. Then there is no way you can confirm this without the actual testing. I hope I was able to communicate the need
    Regards,
    Prateek

  • 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

  • Help for message mapping

    Hi, I have an IDOC -> PI -> File simple scenario but I donu2019t know how to solve the following problem. I have to built my file header line with data from IDOC segments. That data comes from the same segment but different u201Cinstancesu201D and there is a field to identify the instances, something like that:
    Source IDOC
         Segment1 with parameter = 001
         Segment1 with parameter = 002
    Target FILE header line:
    [segment1.001-field1];[segment1.002-field1]
    The mapping checks the parameter value but generates an error because the 2nd field of the file is obligatory and when the mapping founds the 1st segment then it canu2019t continue searching the segment with parameter = 002 and complete the file line.
    Sorry for my bad explanation, I hope you understand the problem.
    Edited by: Marshal on May 20, 2009 12:04 PM

    to make the if condition work for all the instances of <E1ADRM1>....the only thing that you need to do is in the mapping logic suggested by ravi just increase the context of the <PARTNER_Q> node on the source side and make it to point to <E1EDL20>...this will apply the logic for all the instances of E1ADRM1 in E1EDL20.....no need of any UDF
    Hi abhishek,
    I've done this but know the IF without els doesn't work. All the fields from the first E1ADRM1 instance are mapped to the file 2 times, and the 2nd E1ADRM1 data is not mapped right.
    Here I post an example of target XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OL_MT_Entrega xmlns:ns0="urn:general-optica-es:ol:entrega">
       <Entrega>
          <header>
             <tipreg>01</tipreg>
             <nument>vbeln</nument>
             <codol>OSP_Partner</codol>
             <nomol>OSP_NAME1</nomol>
             <domol>OSP_STREET1</domol>
             <pobol>OSP_CITY1</pobol>
             <cpol>OSP_COD1</cpol>
             <coddes>WE_Partner</coddes>
             <nomdes>WE_NAME1</nomdes>
             <domdes>WE_STREET1</domdes>
             <pobdes>WE_CITY1</pobdes>
             <cpdes>WE_COD1</cpdes>
          </header>
       </Entrega>
    </ns0:OL_MT_Entrega>
    PD: There is another positions part on target XML but 1st I have to solve the header mapping

  • Help needed on Mapping logic

    Hi guys,
    I have logic like,
    pernr>logic>pernr.
    Pernr is the first field.
    Whenever the logic fails, it should not process rest of the below fields.
    it should directly go to next record.
    Any ideas.......
    santosh.

    You can achieve this using gloval variable.
    1. right click on the parent node  of pernr. -
    >Add Variable (say ifPernrTrue)
    2. Map this variable with the same logic and give value "true" if logic successful and "false" if logic fails
    Whenever the logic fails, it should not process rest of the below fields.
    3.Map rest of fields as :
    ifPernrTrue (the variable u created) \
    >   if  (without else )  -
    > fields...
                   source filed     /

  • Problem in mapping of conditional tag.

    Hi Experts,
    I have the following problem:
    Source tag:
    <A>
    <FIELD1>DATUM1</FIELD1>
    <STATUS> X</STATUS>
    </A>
    <A>
    <FIELD1>DATUM2</FIELD1>
    <STATUS> </STATUS>
    </A>
    <A>
    <FIELD1>DATUM3</FIELD1>
    <STATUS> </STATUS>
    </A>
    Target Tag:
    <C>
    <FIELD1>DATUM1</FIELD1>
    </C>
    <D>
    <FIELD1>DATUM2</FIELD1>
    </D>
    <D>
    <FIELD1>DATUM3</FIELD1>
    </D>
    So, In Source Tag A, if Status =X =>Target Tag = C
          In Source Tag A, if Status =empty =>Target Tag = D.
    My mapping is as following:
    Source Tag A->exists AND Status=X => CreateIF=>Tag C
    Source Tag A->exists AND Status=empty=> CreateIF=>Tag D.
    The problem is that I get in Target only Tag C:
    <C>
    <FIELD1>DATUM1</FIELD1>
    </C>
    <C>
    <FIELD1>DATUM2</FIELD1>
    </C>
    <C>
    <FIELD1>DATUM3</FIELD1>
    </C>.
    It looks like it does not check for each tag A.
    I have tried with UseOneAsMany but it does not work and read a lot on SDN but nothing helped!
    Please, any idea?
    Kind Regards,
    Danijela

    Hi Danijela,
    Source tag:
    <FIELD1>DATUM1</FIELD1>
    <STATUS> X</STATUS>
    <FIELD1>DATUM2</FIELD1>
    <STATUS> </STATUS>
    <FIELD1>DATUM3</FIELD1>
    <STATUS> </STATUS>
    Target Tag:
    <C>
    <FIELD1>DATUM1</FIELD1>
    </C>
    <D>
    <FIELD1>DATUM2</FIELD1>
    </D>
    <D>
    <FIELD1>DATUM3</FIELD1>
    </D>
    Follow these steps -
    you have source message type like this
    <root>
               <Field>
               </Field>
               <status>
               </status>
    </root>
    In Graphical mapping , first take Status if with else node function and check for 'X' if yes then create  target node <C></C> . if else then check for empty with if without else node function and create target node <D></D> node.
    It will solve the issue. Pls let us know if you need any further support.
    Regards,
    kishore

Maybe you are looking for

  • How do I move images in iPhoto '08?

    Recently, when I uploaded digital images from my camera to iPhoto, some of the images were in a different order from the order on the camera. I have been unable to move the images into the proper order. I remember being able to move images in albums

  • Problem transferring videos from iPhone 4

    Recently, the videos I transfer show up as having 0 KB for size and are not recognized by Quicktime. They play properly on my phone. I am transferring the videos via Windows Explorer. It started happening around the time I updated to iOS 5, but I can

  • Importing .pst in outlook not working

    Hi, I have bought a mac book pro 13 retina two days ago and installed Office Mac 2011 However, when I start importing my .pst file there it begins processing at first, it takes a long time (10GB file) to end with message that the improt was not succe

  • Sliding Window Table Partitioning Problems with RANGE RIGHT, SPLIT, MERGE using Multiple File Groups

    There is misleading information in two system views (sys.data_spaces & sys.destination_data_spaces) about the physical location of data after a partitioning MERGE and before an INDEX REBUILD operation on a partitioned table. In SQL Server 2012 SP1 CU

  • Problem sharing a Reminder list with another iCloud user

    I'm trying to share a Reminder list with my wife, and even though I follow the instructions, it doesn't seem to work. I go to iCloud.com in Safari on my Mac, click on Calendar, and I can see my list there in the sidebar, including the one I wish to s