6 IF-THEN and OR conditions for one target field mapping

Hi Mapping experts,
I have a validation condition involving 2 source fields and 1 target field only, however the number of conditions is 6 (OR)
Source Fields:
TYPE
PONUM
Target Field:
BELNR
If TYPE = 1st value   then   BELNR = PONUM substring (0, 8)  0=start position, 8=character count
OR
If TYPE = 2nd value   then   BELNR = PONUM substring (2, 8)
OR
if TYPE = 3rd value  then  BELNR = PONUM substring (4, 8) ..........  up to the 6th Validation Condition.
When I do this using graphical mapping only (multiple IF-THEN and OR's) the validation is successful only on the 1st IF-THEN statement, then it passes the substringed value to the 1st OR function.....    When I "Display Queue" the 1st OR function the substringed value is taken as null (or:in1 <null>)  Is this because OR function is expecting Input as "True or False" value only and not a string value?
For my requirement above, can I achieve this using graphical mapping only?    or do I have to use UDF for this?
If it's better to use UDF for this, would anyone give me a jumpstart on the code?  (I have no experience yet in UDFs)
Thanks, and hoping that somebody will respond accurately and completely.

Create UDF with two inputs as TYPE & PONUM and use bleow code there..
String out = "";
if( TYPE.equals("1"))
out = PONUM.substring(0,8);
return out;
else if( TYPE.equals("2"))
out = PONUM.substring (2,8);
return out;
else if( TYPE.equals("3"))
out = PONUM.substring (4,8);
return out;
else if( TYPE.equals("4"))
out = PONUM.substring (4,8);
return out;
else if( TYPE.equals("5"))
out = PONUM.substring (4,8);
return out;
else if( TYPE.equals("6"))
out = PONUM.substring (4,8);
return out;
return "";
Note: change the substring range as per your need in above code.
Now do your mapping as shown below
TYPE ------>|
            | -----> UDF ---> BELNR
PONUM----->|

Similar Messages

  • HT1386 My MacBook Pro HD crashed.  It is all up and runmning except for one issue.  I have about 200 songs on my iPhone but have only gotton 53 back on my laptop and those are the songs I purchased via iTunes. How do I get the rest of the songs from iPhon

    My MacBook Pro HD crashed.  It is all up and runmning except for one issue.  I have about 200 songs on my iPhone but have only gotton 53 back on my laptop from my iPhone and those are the songs I purchased via iTunes. How do I get the rest of the songs from my  iPhone back onto my HD. 
    The songs I'm not able to import casme from CD's.  Nothing from napster etc.
    I've tried and tried to import them rom iTunes vis "Library"  " Import"

    Hey kbert73
    I would do a transfer of purchases from the phone and not sync. If you sync then it will want to start over and sync music that is on the MacBook Pro. If you want to transfer the music, check out the article below that will give you multiple options on how to move. I have also provided on how to sync with multiple computers.
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Using iPhone, iPad, or iPod with multiple computers
    http://support.apple.com/kb/ht1202
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How to put condition for one date range should not interfear with another ?

    hi friends,
    how to put condition for one date range should not interfear with another  date range.
    my data base table has two fields
    from date
    to date.
    when we enter the date range in the data base , new date range means from date and to date should not interfear.
    can  anybody help me.
    thanks &Regards,
    Revanth
    Edited by: rk.kolisetty on Jul 1, 2010 7:18 PM

    Do it the SAP way....
    First entry...from is today, to is 99991231.
    New dates entered, now we have two rows...:
        from is original date  to becomes yesterday.
        From is today          to is 99991231

  • I NEVER entered a password for the backup but now I want to restore my iphone and itunes asks for one. What can I do?

    I NEVER entered a password for the backup but now I want to restore my iphone and itunes asks for one. What can I do?

    @Razmee209 is right there is nothing you can do if it is an encrypted back up
    iOS: Troubleshooting encrypted backups - Apple Support
    BUT you could try to see if you have a back up that is not encrypted. If you go to iTunes Preferences (On a Windows go to Edit Menu under the Play Button - On a Mac click on iTunes at the top left) Click on Devices and if you see a back up that does not have a lock next to it you will be able to restore from that back up without using that password.
    Encrypted passwords are set up at the time you create the back up.

  • HT1051 Trying to change Shipping and Delivery address for one in the US, from Canada, and can't do it. State and zip code appears in red but no change in country name.  Using French (Canada) iPhoto app.

    Trying to change Shipping and Delivery address for one in the US, from Canada, and can't do it. State and zip code appears in red but no change in country name.  Using French (Canada) iPhoto app.

    Larry's right, You can still use your credit card, you just need to change the "billing address" to the recievers address. It gets billed to your CC and delivered to the US

  • Message-Mapping: Use same RFC lookup for different target fields

    Hello,
    I need to apply an RFC Lookup which delivers a boolean flag back (true or false). This RFC lookup should be used for different target fields.
    Is there a way to execute the RFC lookup just once and then store the result in an internediate variable that I can use for all futher checks for different target fields?
    If this is not possible and I have to apply the RFC lookup for all necessary target fields is it then executed for each target field ? This is exactly what I want to avoid in order not to slow down performance.
    The input parameter (=source field value) would be the same.
    Thank you for your advice!

    Exactly.
    Here is a UDF example I have that you could adapt to your needs.
    Set
    public String setCounter(String a,String b,Container container){
    /* Store values in global datacontainer
    a: mapping value and return valueparameter
    b: name for stored value parameter
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    Get
    public String getCounter(String a,Container container){
       //write your code here
    GlobalContainer gc = container.getGlobalContainer();
    if (gc.getParameter(a) != null) {
      return String.valueOf(gc.getParameter(a));
    } else {
    return "1";

  • I just downloaded and instaled firefox 4. Now, everytime I institute a command I get a po[p-up from Java script that tells me to uninstal set. I cannot go on untin I press ok and then I am good for one more command and it starts with the pop-up again.

    I'm not even sure if this is an extension or plug-in and all I can tell you is what I have already stated. I can only make one command at a time and after each one I get a pop-up from Java script that says uninstal set. I must depress ok to move on, but only for one more command and it starts over again. This also happened when I tried to instal firefox 4 a couple months ago and I deleted the program and went back to an earlier version.

    Mail troubleshooting - Yosemite
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages
    SMTP servers keep going offline

  • Difference amount in sales order and billing document (For one line item)

    Hi Experts,
    User created sales order with 3 line items and billing document. but problem is that there is difference in value of sale order and billing only for line item 10. The remaining items values are same in sales order & billing doc.if I check in sales order condition I found that VPRS condition is used and the value is 692.13and the amount is 3245.26in sales order. But if suppose I check the same value in billing doc the value is 0.69 and the amount is 3245.28. Can u suggest me which configuration I have to check for this.
    I also checked change lock but there is no change in sales and billing document & Material
    Regards
    Sunina agarwal

    Morning Sunina
    Now consider this scenario
    Item a - 10
    Item b - 20
    Item c - 30
    and the validity of condition rec for item C is 31st of Jan
    after 31st JAN the record changes or there isn't any.
    In Copy control the pricing type is 'B' i.e., carry out new pricing.
    Now if the document is created in January it will take all the above prices. and this document is then billed in Feb. Now the copycontrol, whilst copying the prices, will predetermine the same.
    Now your task is to check if there was user intervention, check the pricing in order and check what condition types got affected in order and in billing.
    If your scenario is still not amongst the above cases...
    I don't know what to do, if you figure out please let us also know, god know when we would face the same scenario....
    Take care

  • Select List and Popup LoV for one column

    Hello,
    is there a built-in functionality to show a select list and a popup lov for one column similar to "Condition Type" in the condition region when editing a page.

    Hello,
    No, you have to code that yourself. For instance by adding HTML in the Post Element Text field (like <IMG src=... />).
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • How to get telephone and mobile phone for one partner

    Hello Expert,
    In VA03, I open one sales order and go into the partner tab. Then I selection one partner and click "Detail" button, one page with partner detailed information will pop up.
    In the pop-up window:
    There are two fields: Telephone and Mobile Phone.
    In my program, I want to get these two information. 
    I tried to call FM 'ADDR_COMM_GET' by passing address_number(VBPA-ADRNR), table_type('ADTEL'), iv_current_state(SPACE). For some partner, it works, but for others it doesn't work.
    Then I find table ADR2 which is used to keep phone infomration. There are two entries in the table. But how can I identity which one is telephone and which one is Mobile phone?
    So can any expert help me on how to get the telephone and Mobile Phone of the pop-up page?
    Thanks in advance,
    Best Regards, Johnny.

    Read ADR2-TEL_NUMBER where ADDRNUMBER = VBPA-ADRNR and R3_USER = '2' or '3'.
    These are the possible values
            Telephone is Landline Telephone
    1     Telephone is Default Under Landline Telephones
    2     Telephone is Mobile Telephone but Not Default Mobile Phone
    3     Telephone is Default Mobile Telephone
    X     Obsolete - No Longer Valid

  • Memory and CPU load for one Oracle instance

    I need to design a database server with 5 oracle instances.
    Each instance have only 2 or 3 connected application users and the rate of transactions is about 10 transactions/hour.
    How can I estimate to total memory and CPU needed for my server ?
    The minimum esimation : 2x2Ghz and 2Go of RAM per instance is it pertinent ?
    Dominik

    Dominik wrote:
    I need to design a database server with 5 oracle instances.
    Each instance have only 2 or 3 connected application users and the rate of transactions is about 10 transactions/hour.
    How can I estimate to total memory and CPU needed for my server ?
    The minimum esimation : 2x2Ghz and 2Go of RAM per instance is it pertinent ?
    DominikThough the picked specs look okay but the better answer, as being mentioned already, would be "it depends" . At this moment, almost all the machines are coming with very good specs so 2gb probably would be the least . You can even have a 4gb RAM system with x86_64 architecture , leaving room for future growth if needed. About setting the memory for the SGA, if the release is 11g, setting the Memory_Target would take care of the the memory allocation for both SGA and PGA and you can start by the default that Oracle picks which I guess is about 40% of the total RAM. Afterwards, you can monitor the performance and can bring down the memory settings if you feel its overly allocated.
    That said, I think that this is a question better answered by the capacity planning and management people. I shall see if I can ask my friend, who is in this domain to comment on it.
    Just my 2 cents.
    Aman....

  • Syndicate depending on condition to a target field

    HI,
    I am a scenario where I need to syndicate out the value depending up on the condition:
    Source:
    Remote System --AAA
    value1---111
    valu2---- null
    Another record:
    Remote System --BBB
    value1---333
    valu2----444
    Target has two fields: System and Value
    Condition is : When ever remote system is BBB then I need to pass value2 to Target Value field any thing else I need to pass Vlaue1 value to Value target field...
    Is this possible in MDM Syndication?
    Thanks
    Rajeev

    Hi Rajeev,
    Yes it is possible in MDM 7.1 version
    create two seprate map for each system (AAA,BBB) i.e.  and set condition on each system
    follow the the which may help you
    1. Create field to field Map
    2. In Map Properties Tab ---> Remote Key Over ride (AAA) & tiick suppress unchaged records
    3. Specify Value1 = 111 and Value2= Null in free form serach
    4. SAve map by selecting Remote System in our case it would be AAA
    5. Give Map name & Save
    follow same step for remote system BBB it will work
    Note : Based on your Condition set in free form serach mapping will execute accordingly for perticuler system
    Thanks,
    Jignesh Patel
    Edited by: jignesh patel on Sep 6, 2010 4:06 PM

  • RemovingContext only for One level(Message Mapping)

    Hi,
    Is it possible to remove context only for one level?
    For Eg:If I apply [RemoveContext] function to <Item>
    I will get {A1,A2,B1,B2,C1,C2,C3,C4}
    <SourceRoot>
    <A>
    <Item r="a">A1</Item>
    <Item r="b">A2</Item>
    </A>
    <A>
    <Item r="a">B1</Item>
    <Item r="b">B2</Item>
    </A>
    <A>
    <Item r="a">c1</Item>
    <Item r="b">c2</Item>
    <Item r="c">c3</Item>
    <Item r="d">c4</Item>
    </A>
    </SourceRoot>
    But I need only those coming under a particluar <A> .
    Like {B1,B2}.
    Any way to do this?
    Can anyone help.
    Thanks in Advance
    Message was edited by: Chemmanz

    Hi,
    I was just trying to give an example. In my real case
    SOURCE - INVOIC01 IDoc
    TARGET - cXML Structure for Invoice.
    When it goes to Line item level the complexity comes.
    A similar situation as i explained needs to be solved.
    [REMOVECONTEXT] helped me a lot.
    But I this situation I want to restrict it to a single level.
    For Ex:
    <INVOIC02>
    <IDOC>
    <EIEDP01>
    <EIEDP02 QUALF="001">.. </EIEDP02>
    <EIEDP02 QUALF="002">.. </EIEDP02>
    <EIEDP02 QUALF="0xx">.. </EIEDP02>
    </EIEDP01>
    <EIEDP01>
    <EIEDP02 QUALF="001">.. </EIEDP02>
    <EIEDP02 QUALF="002">.. </EIEDP02>
    <EIEDP02 QUALF="0xx">.. </EIEDP02>
    </EIEDP01>
    </IDOC>
    </INVOIC02>
    1.<EIEDP01>
    <=== mapped directly to ==> <InvoiceDetailOrder>
    Then internal things are organized differently in
    <InvoiceDetailOrder> compared to IDoc element<EIEDP01>
    Ex:
    I want to take all the <EIEDP02>s coming under one line Item <EIEDP01>
    <EIEDP02> cannot be mapped diectly to cXML element. It can be done only after checking it's own attribute QUALF.
    For this I applied [REMOVECONTEXT], but i am getting all the QALF values.
    I need to restrict it to <EIEDP01> level.
    Regards
    Chemmam

  • XSLT for dynamic target field names

    Hello,
    I got a requiremt where I need to create target field names from input values.
    Input XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Field Name="A">
    <Value>1</Value>
    </Field>
    <Field Name="B">
    <Value>1</Value>
    </Field>
    </Createelement_MT>
    Expected OutPut XML -
    <?xml version="1.0" encoding="UTF-8"?>
    <Createelement_MT>
    <Statement><TableName><table>XYZ</table>
    <access>
    <A> 1 </A>
    <B> 2 </B>
    </access>
    </Statement></TableName>
    </Createelement_MT>
    The value of the attribute 'Name' of field 'Field' should be the name of target field.
    XSLT:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="Createelement_MT">
    <xsl:element name="statement">
    <xsl:element name="TableName">
    <xsl:element name="table">ABC</xsl:element>
    <xsl:element name="access">
    <xsl:for-each select="Field">
    <xsl:element name="{@Name}">
    <xsl:value-of select="Value"></xsl:value-of></xsl:element></xsl:for-each>
    </xsl:element>
    </xsl:element>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    Error:
    Error: at xsl:element on line 15 of file:///......: XTDE0820: Invalid element name. Invalid QName {}
    Please help me with the xslt code for this requirement.
    Thanks!

    Hi,
                Please try this code
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml"/>
         <xsl:template match="/">
              <Createelement_MT>
                   <Statement>
                        <TableName>
                             <table>XYZ</table>
                        <access>
                             <xsl:for-each select="Createelement_MT/Field">
                                  <xsl:variable name="field" select="@Name"></xsl:variable>
                                  <xsl:element name="{$field}">
                                  <xsl:value-of select="Value"></xsl:value-of>
                                  </xsl:element>
                             </xsl:for-each>
                        </access>
                        </TableName>
                   </Statement>
              </Createelement_MT>
         </xsl:template>
    </xsl:stylesheet>
    input xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Field Name="A">
      <Value>1</Value>
      </Field>
    - <Field Name="B">
      <Value>1</Value>
      </Field>
      </Createelement_MT>
    output xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Createelement_MT>
    - <Statement>
    - <TableName>
      <table>XYZ</table>
    - <access>
      <A>1</A>
      <B>1</B>
      </access>
      </TableName>
      </Statement>
      </Createelement_MT>
    One small request, if you think your question has been answered,could you please kindly, if possible, close this thread.
    regards
    Anupam

  • Field name and table name for the value field

    hi,
        i requred the  value field  for  which the quantity that is not delivered in purchase order, so please tell  me which field i have to go for the value field.
    thanks and regards.

    Hi,
    There is no direct field to get the PO Open qty(undelivered Qty).
    Take the PO quantity for each Item from EKPO-MENGE.
    For each PO Item there will be multiple GR(good's receipts) 's in MSEG table.
    So pass EBELN and EBELP for MSEG table and Take all the GR Quantities(ERFMG) field and sum up .(have to take care of the Movement type also, becasue there will be some returns and GI's).
    Substract the GR qty from PO qty you will get the UNDELIVERED QTY of A PO.
    Regards,
    Anji

Maybe you are looking for

  • Status Profile in Q Info record

    Hi, I manintained a status profile in Q Info record for PPAP approval process and working fine for status changes from Proto to Pilot to Production lots. The functionality works fine  as long as each status change happenes automatically based on the

  • Cannot update 5G iPod setting after 1.2 update...

    Has anyone else run into this problem. I updated to iTunes 7 today along with the 1.2 update for my 5G iPod. I am running Mac OS X. After the update, my video playlists were removed from the iPod. Checking the iPod setting showed that the video playl

  • Validation not happening on commit

    Hi, We have an inputText whose validation is defined at EO attribute level. There are two validations: a rangeValidator (0 to 100) and a method validator. We have an applicationsPanel which has 'Save' and 'Save and Close' buttons. In the task flow, S

  • How to make a scroll bar!!!

    i need to know how to make a scroll bar in flash cs3! can anyone help me with this??

  • Solaris 8 smpatch - no patches required

    I've read through most of the discussions and have not been able to find an answer. I am running Solaris 8 and appear to have all of the settings correct, but smpatch analyze always returns - no patches required. smpatch get returns: patchpro.backout