Issue with Variable Substitution

Hi,
We have a scenario where we need to use the data from Payload for further processcing of the messeges.The payload looks like the one given below.
<?xml version="1.0" encoding="utf-8" ?>
- <ns1:MT_NOTIFICATION xmlns:ns1="http://WM_ERRHAND"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <PROXYRESPONSE>
  <STATUS>YES</STATUS>
  <NAMESPACE>WM_INVOICE</NAMESPACE>
  <INTERFACENAME>MI_INVOICE_MOORE_ACK_IN</INTERFACENAME>
  <PROXYNAME>ZXIII_MI_INVOICE_MOORE_ACK_IN</PROXYNAME>
  </PROXYRESPONSE>
  </ns1:MT_NOTIFICATION>
In adapter, for variable substitution we have specified as below:
payload:MT_NOTIFICATION,1,PROXYRESPONSE,1,NAMESPACE,1
but getting an error "Message processing failed: Error during variable substitution: java.text.ParseException: Variable 'namespace' not found in variable substitution table"
Is the variable that we have declared is right or is there anything we have missed out. Any helpful answers will be rewarded
Thanks and regards,
Ram.

Hi Ram,
The substitution looks fine.
Did you read this,
<i>To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.</i>
Try seleting this option and checking the same.
Regards,
Bhavesh

Similar Messages

  • Problem with variable substitution.

    Hello,
    I asked this before but now I want to change the question focus.
    I have scenario from IDOC to XML file.
    The scenario is digital invoice for our company in Mexico and I end this scenario with java mapping that I import from SAP marketplace.
    Now I have request to add to the XML file name the content of the field "<ODN_NUMBER>" from the XML data.
    I try to use with variables substitution.
    My payload is:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ZINVOIC02>
    - <IDOC BEGIN="1">
    - <EDI_DC40 SEGMENT="1">
    <TABNAM>EDI_DC40</TABNAM>
    <MANDT>400</MANDT>
    <DOCNUM>0000000006599015</DOCNUM>
    <DOCREL>700</DOCREL>
    <STATUS>30</STATUS>
    <DIRECT>1</DIRECT>
    <OUTMOD>2</OUTMOD>
    <IDOCTYP>INVOIC02</IDOCTYP>
    <CIMTYP>ZINVOIC02</CIMTYP>
    <MESTYP>INVOIC</MESTYP>
    <STDMES>ZEDI</STDMES>
    <SNDPOR>SAPDEV</SNDPOR>
    <SNDPRT>LS</SNDPRT>
    <SNDPRN>DEV400ECC</SNDPRN>
    <RCVPOR>SAPDEV</RCVPOR>
    <RCVPRT>LS</RCVPRT>
    <RCVPFC>LS</RCVPFC>
    <RCVPRN>MX_INV</RCVPRN>
    <CREDAT>20100118</CREDAT>
    <CRETIM>075931</CRETIM>
    <SERIAL>20100118075931</SERIAL>
    </EDI_DC40>
    - <E1EDK01 SEGMENT="1">
    <CURCY>USD</CURCY>
    <HWAER>MXN</HWAER>
    <WKURS>10.55530</WKURS>
    <ZTERM>0090</ZTERM>
    <KUNDEUINR>ACH971209KRA</KUNDEUINR>
    <BSART>INVO</BSART>
    <BELNR>0100017295</BELNR>
    <BRGEW>0.045</BRGEW>
    <GEWEI>KGM</GEWEI>
    <FKART_RL>LR</FKART_RL>
    <RECIPNT_NO>0000012977</RECIPNT_NO>
    <FKTYP>L</FKTYP>
    - <Z1EDK01 SEGMENT="1">
    <XML_VERSION>2.0</XML_VERSION>
    <ODN_PREFIX>A</ODN_PREFIX>
    <ODN_NUMBER>1883</ODN_NUMBER>
    <DATE_TIME>2009-11-01T17:05:10</DATE_TIME>
    <DOC_SUB_TOTAL>4.22</DOC_SUB_TOTAL>
    <DOC_DISCOUNT>3.00</DOC_DISCOUNT>
    <DOC_TOTAL>1.40</DOC_TOTAL>
    </Z1EDK01>
    And the xml that I create is:
      <?xml version="1.0" encoding="utf-8" ?>
    - <Comprobante xmlns="http://www.sat.gob.mx/cfd/2" version="2.0" serie="A" folio="1883" fecha="2009-11-01T17:05:10" sello="NxZCWU8hMJMiEc2fSZafpS81Z9rUScbBotvJ8lcW76GGpmcD2lFyAV7DlNQKecYMnQJnwMVoHfGjzhpFJrjLuRcyqU3nOnH1mE1JMxY/MjLkal0Ybo2aRKCorQxx+F/Vy5ucvyeDDFAt2gx0PeHJhFS3tJ6ssc6nryz3iUr8c=" noAprobacion="49806" anoAprobacion="2009" formaDePago="Pago en una sola exhibiciףn" noCertificado="00001000000100891274" condicionesDePago="90 DAYS FROM BILL OF LADING" subTotal="4.22" descuento="3.00" motivoDescuento="Customer DiscountCustomer Discount" total="1.40" tipoDeComprobante="ingreso">
    - <Emisor rfc="NMS940324RY6" nombre="Netafim Mexico S.A. de C.">
      <DomicilioFiscal calle="Leibnitz" noExterior="20" noInterior="901" colonia="Anzures" localidad="Mexico city" municipio="Miguel Hidalgo" estado="Distrito Federal" pais="Mexico" codigoPostal="11590" />
      </Emisor>
    - <Receptor rfc="ACH971209KRA" nombre="AGRICOLA 5 HERMANOS SA DE CV">
      <Domicilio calle="JUAN DE LA BARRERA NO 1249 NORTE" localidad="COL. CHAPULTEPEC" municipio="CULIACAN" estado="Sinaloa" pais="Mexico" codigoPostal="80040" />
      </Receptor>
    -     <Conceptos>
    I try to use with this variable:
    payload:ZINVOIC02,1,IDOC,1,E1EDK01,1,Z1EDK01,1,ODN_NUMBER,1
    I received in RWB the error:
    Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var_filename
    Thank you in advance for your help
    Elad

    But my target is looks very strange:
      <?xml version="1.0" encoding="utf-8" ?>
    - <Comprobante xmlns="http://www.sat.gob.mx/cfd/2" version="2.0" serie="A" folio="1883" fecha="2009-11-01T17:05:10" sello="NxZCWU8hMJMiEc2fSZafpS81Z9rUScbBotvJ8lcW76GGpmcD2lFyAV7DlNQKecYMnQJnwMVoHfGjzhpFJrjLuRcyqU3nOnH1mE1JMxY/MjLkal0Ybo2aRKCorQxx+F/Vy5ucvyeDDFAt2gx0PeHJhFS3tJ6ssc6nryz3iUr8c=" noAprobacion="49806" anoAprobacion="2009" formaDePago="Pago en una sola exhibiciףn" noCertificado="00001000000100891274" condicionesDePago="90 DAYS FROM BILL OF LADING" subTotal="4.22" descuento="3.00" motivoDescuento="Customer DiscountCustomer Discount" total="1.40" tipoDeComprobante="ingreso">
    - <Emisor rfc="NMS940324RY6" nombre="Netafim Mexico S.A. de C.">
      <DomicilioFiscal calle="Leibnitz" noExterior="20" noInterior="901" colonia="Anzures" localidad="Mexico city" municipio="Miguel Hidalgo" estado="Distrito Federal" pais="Mexico" codigoPostal="11590" />
      </Emisor>
    - <Receptor rfc="ACH971209KRA" nombre="AGRICOLA 5 HERMANOS SA DE CV">
      <Domicilio calle="JUAN DE LA BARRERA NO 1249 NORTE" localidad="COL. CHAPULTEPEC" municipio="CULIACAN" estado="Sinaloa" pais="Mexico" codigoPostal="80040" />
      </Receptor>
    I need to add folio field
    Elad

  • Dynamic target directory with variable substitution

    Hi everyone.
    I'm trying to save a file in a folder with receiver adapter.
    This folder is determined in runtime and passed to the adapter with variable substitution. My problem is that in RWB i get a error like this : 'Content of variable XXXXX is not safe'
    Does anybody have done a variable substituion for output directory receiver file adapter?
    Regards,
    Inigo.

    Hi,
    Check this links,
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Regards,
    Phani

  • Having issue with variable after upgrade in bi7.0

    Hi,
    I have issue with variable
    For example Plant info object has attributes country, company code, storage location
    etc.
    When I run the report. If I click on plant variable it is showing me the all the data for all country , compony code , storage location. I donot want this.
    I just want only plant input values on variable screen
    Thanks,
    Naman Shah

    Naman,
    What is your SP level ?
    Also the characteristics mentioned - are they compounding attributes ? if yes then tey will come in your variable entry.

  • Filename in J2SE Adapter with Variable Substitution

    Hello,
    Within the J2EE receiver fileadapter (and ftp) from SP13 it is possible to compose the target filename and directory based on the payload of a message using variable substitution.
    I wonder if it is also possible to use variable substitution with the J2SE fileadapter. For this it is not documented but i thougth that the same java libraries are used for the J2EE an J2SE file-adapters.
    Aybody??
    Really Nobody??
    Message was edited by: Emile Hermans

    Hello,
    the J2SE Adapter does not support variable subsition. Therefore we created our own class which gets called from the main SAP XI class "XMB2FileProcessor.class" wich is in the jar "aii_msg_adapter.jar". In your own class you can do what ever you need to chane the file name. In the configuration you can set your own parameter to search the payload for a string you want to replace. We also had to come up with our own timestamp, e.g. file2005-11-10 which SAP does not let you do, only the full timestamp is possible.
    One other nice thing is that you can develop our JAVA class local and test it with your local J2SE Adapter Engine on you PC before you deploy it.
    Steps to do:
    1. JAD the SAP class
    2. Put a call in the SAP class
    3. Compile the class
    4. Put the class back in the archive
    5. Create your own class
    6. Create a jar file for it
    7. Put the jar file in the tech_adapter directory
    8. Change the run_adapter start cmd to include your jar file
    It works great, the only issue is if you patch the J2SE engine you have to do step 1 to 4 again but that should it very easy to do.
    Cheers
    Stefan

  • Problem with Variable Substitution Receiver Adapter

    Hi,
    I need to use a dynamic filename so I'm using the variable substitution in my receiver adapter. BUT, the filename can't appear in the file. So i used this blog in reference --> Solution to the problem encountered using Variable Substitution with XI-SP12
    The PROBLEM is I still get and extra blank line in the file. How can I eliminate this extra line?
    Thanks in advance.
    Using XI 7.0

    Hi Gaurav,
    Data Type:
    Lines
       Line
    Config
       FileName
    XML - example:
    <?xml version="1.0" encoding="utf-8"?>
    <nr1:MT_TP_TipoCambio_Detalle_ECC_Req xmlns:nr1="urn:erplatam/tipocambio:tp:ecc">
    <Lines>
    <Line>USDSOL0000000000003.10000013-09-200813-09-2008V</Line>
    </Lines>
    <Lines>
    <Line>USDSOL0000000000002.50000014-09-200814-09-2008V</Line>
    </Lines>
    <Config>
    <FileName>SIGMA_TCSAP_F081031.DAT.TXT</FileName>
    </Config>
    </nr1:MT_TP_TipoCambio_Detalle_ECC_Req>
    Output - File, has 3 lines should have only 2:
    USDSOL0000000000003.10000013-09-200813-09-2008V
    USDSOL0000000000002.50000014-09-200814-09-2008V
    FCC parameters:
    RecordSet Structure: Lines,Config
    Lines.fieldSeparator 'nl'
    Lines.endSeparator 'nl'
    Config.fieldSeparator 'nl'
    Config.endSeparator 'nl'
    Thanks in advance!

  • Filename generation with variable substitution.

    Hi,
    I am currently working on a senerio in which file is receiver.The requirement is to generate file at target with the file name as message id.How can i use VARIABLE SUBSTITUTION and acheive this.
    (Add message id in configuration should not be done.)

    Hello shruthi,
                  Please try this for the filename creation,
    1. Create a UDF in the message mapping named getFileName, select only one input (to pass the messageid) and paste this coding there;
    /* getFileName User Defined  Function
    // function to create name of output file
    String filename;
    filename = strFile;
    try {
    // initialize DynamicConfiguration for create file with given name
    DynamicConfiguration conf = (DynamicConfiguration) container
           .getTransformationParameters()
           .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    //create file with the specified name 
    conf.put(key, filename);
    } catch (Exception ex) {
    return filename;
    2. In the target structure header field perform this mapping,
    Messageid -> getfFileName UDF -> Target Structure Headerfield
    3. Then in the Integration directory under the target tab
    check the Use - adapter specific message attributes and File Name
    Please follow the steps and let me know if u still face the same problem.

  • Error file adapter with variable substitution in PI 7.31

    Hello,
    I'm trying to create a file with a dynamic name, based on the payload of the message.
    We're trying to create a filename with the bold content in the name %batchId%.xml. The subtitution we use is
    payload:batch,1,batch-info,1,id,1
    <ns1:batch xmlns:ns1="http://www.atosworldline.com/archivingPortal/receivers">
    - <ns1:batch-info id="test" isTest="true"> 
    <ns2:sender-identifier xmlns:ns2="http://www.atosworldline.com/archivingPortal/batchInfo">String 2</ns2:sender-identifier>  
    <ns2:nb-elements xmlns:ns2="http://www.atosworldline.com/archivingPortal/batchInfo">3</ns2:nb-elements>  
    <ns2:batch-integration-mode xmlns:ns2="http://www.atosworldline.com/archivingPortal/batchInfo">String 4</ns2:batch-integration-mode>  
    <ns2:creation-datetime xmlns:ns2="http://www.atosworldline.com/archivingPortal/batchInfo">1999-05-31T13:20:00Z</ns2:creation-datetime>  
    </ns1:batch-info>
    - <ns1:receivers> 
    - <ns1:receiver> 
    <ns1:id>String 5</ns1:id>  
    <ns1:action>String 6</ns1:action>  
    <ns1:contact-details />  
    - <ns1:tokenSets> 
    - <ns1:tokenSet startDate="1999-05-31T13:20:00Z" endDate="1999-05-31T13:20:00Z"> 
    - <ns1:token> 
    <ns1:tokenvalue>String 7</ns1:tokenvalue>  
    </ns1:token>
    - <ns1:token> 
    <ns1:tokenvalue>String 9</ns1:tokenvalue>  
    </ns1:token>
    </ns1:tokenSet>
    - <ns1:tokenSet startDate="1999-05-31T13:20:00Z" endDate="1999-05-31T13:20:00Z"> 
    - <ns1:token> 
    <ns1:tokenvalue>String 11</ns1:tokenvalue>  
    </ns1:token>
    - <ns1:token> 
    <ns1:tokenvalue>String 13</ns1:tokenvalue>  
    </ns1:token>
    </ns1:tokenSet>
    </ns1:tokenSets>
    </ns1:receiver>
    </ns1:receivers>
    </ns1:batch>
    The following error is shown, when processing the message through the receiving fileadapter.
    MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: batchId
    kind regards,
    Pieter

    AFAIK - Variable substitution does not support attributes. It only support the elements. (- <ns1:batch-info id="test" isTest="true">)
    May be you can go with dynamic configuration instead of variable substitution.

  • Issue with Variable Entry in BI 7.0

    Hi,
    I am having an issue with the variable entry in BI 7.0 Version. Here is a brief background.
    --- In BW 3.x, when we define a variable with <b>Single Value Option</b>, you can enter the value manually in the pop-up selection screen or select from the dropdown of possible values.
    ---But in 7.0 when i try to enter the value manually in the selection screen its opening the dropdown list, and is not giving me the option to enter a value manually. I am entering a valid single value in selection.
    Is this a bug or do i have to make any specific settings to correct my issue?

    When the selection screen pops up choose the KEY only function on the TOOLS on the top right corner of the screen. Then you will be able to enter the values manually.
    Hope this helps.

  • Issue with activated substitution role disappearing

    Hello,
    We have an example of a user that is experiencing problems accessing her substitution role. Her approver is off on long term sick, hence, her substitution role has been activated in 'Maintain Substitutions' in the ERP portal to enable her to authorise purchase orders on behalf of her approver. However, the drop down menu that usually appears when the substitutor is activated does not appear in the universal worklist. Therefore, this means that the user cannot access/view any purchase orders for approval delaying payment to vendors.
    The delegator has deleted and re-installed the substitute in 'Maintain Substitutes' but has failed to do anything. I have checked the users roles and they are all up to date.
    The only inconsistancy I can see is in the users universal worklist connection status. Comparing this to another users universal worklist connection status (that is not experiencing any problems with their substitutions) highlights a difference in message. There is an error message stating AdHocSystem/AdHocWorkflowConnector/Failure/ActionFailed. Any suggestions?

    Hi Sarah
    Most probably the issue is occuring due to an inconsistency or problem with the user which is receiving this error. As you mentioned, other users are perfectly able to access the popup to maintain substitutes without any error in the "Display Connection Status" popup and the same are able to see the combo to select a possible user to substitute.
    So the reason for the portal not to show the combo to select the user is that from substitution perspective, the connection to all the systems registered within UWL need to be working. As for this affected user the AdHocWorkflowConnector is failing, the combo is not showing.
    Maybe you could try checking the latest trace messages (from the default trace file) which are written right after the user entered the UWL application and check whether this would help on finding what the problem with this user would be.
    Also other thing which you could try checking is regarding how this problematic user is maintained in Identity Management. Another prerequisite for substitution is that the users should have both a first name and last name in the respective fields. Check about the possibility of this user being set in disagreement with this.
    Hope this helps
    Best regards
    Armando Zaro

  • Issue with @variable('DOCNAME')

    I added a where clause using the BO designer that uses @variable ('DOCNAME') and it work perfect when running webi reports. But I also have some crystal reports that are using the universe and they suddenly stopped working. Does the variable 'DOCNAME' have an issue with cyrstal reports??
    Even if I just create an object that simply displays the @variable ('DOCNAME'), I still run into the same problem.
    I have another query that uses @variable ('BOUSER') and that one works fine on both webi and crystal reports.

    Nevermind, I may have found an answer. Based on what the article below states, it looks like the only variable that is supported in Crystal Reports is 'BOUSER'.
    [https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/20984c2b-17f1-2b10-1091-d18977f7cd8f|https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/20984c2b-17f1-2b10-1091-d18977f7cd8f]

  • Powershell Issue with Variable and Equal Signs

    I should have been using $line.grade, but your syntax worked so thanks!

    I've been running a powershell script to create active directory accounts at our school from a csv file. I'm needing to have users placed in a specific OU based on what grade level they are in, which is a field in the csv file and I have passed into the description field in AD. To keep from writing a bunch of if statements, I thought I might could pass the description variable into my organizational unit path, but I'm having syntax issues.Here is the specific line I have issues with.Powershell'ou' = "OU=$line.description, OU=LESStudents,OU=LES,DC=school,DC=k12,DC=state,DC=us"I've tried the single quote, double quotes, escaping the equal sign and some other methods I've seen online, but haven't quite gotten it right. It just isn't recognizing OU=$line.description as a variable.
    Disclaimer - I'm not a programmer and most of this was built...
    This topic first appeared in the Spiceworks Community

  • Audio sync issues with variable frame rates as well as .ts files

    I'm using Premiere Pro CS6 and CC, in Windows 8.
    I bought an AverMedia Live Gamer HD card to capture 1080p footage with, and the the videos it produces work perfectly during playback. No sync issues whatsoever. I'm saving them as MP4 at 30fps.
    The problem is when I import them into Premiere Pro, the audio loses sync at certain points. After a bit of digging, I've discovered that the videos have a variable frame rate, which Premiere Pro does not support. I don't know why, considering competing products that are significantly cheaper can handle them with a problem, but oh well. The capture card can also save videos in .TS format, which produces a constant frame rate, however when I import them into Premire Pro the sync is immediately off by a second or more. I assume this is for an entirely different reason. Again, they play back normally without a problem. Upon emailing AverMedia, I was told this was Adobe's problem and there was nothing they could do about it.
    What I'm wondering is if there is any sort of realistic solution to this as of now. Is there any way that Premiere can work properly with files that have a variable frame rate? If not, is this being worked on?
    Or maybe there's a way to get the .TS files back in sync, that way the variable frame rate issue doesn't matter anyway.
    Converting the files is not a long term solution. I'm working with hours and hours of HD video, and it would take way too much time to do this.
    Manually resyncing the audio is also not a solution. Again, this would just be way too much wasted time with each project.
    The only solution I see as of now is to switch to Sony Vegas until this problem is resolved in Premiere, if it ever is. I'm really hoping there is some other way, so if anyone has an idea as to how to fix this, I'd really appreciate it.
    Thank you.
    tl/dr:
    Is there any way to get around Premiere Pro not working with variable framerates? My .TS files are also out of sync, is there any way to fix that? Without converting or manually resyncing.

    >If not, is this being worked on?
    Discussed many times before... never a "yes" answer to your question... tell Adobe what YOU want at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    If enough people make a request, Adobe MAY add the feature (I don't work for Adobe, so no guarantee of anything)

  • Issues With Variables

    First, let me send a thanks to PBrock and Cotton for their help with my last issue I had with a program. You guys helped tremendously!
    Now onto the latest issue with my code I compile this and get two error messages saying that the variables (again) and (exit) cannot be found. I have a sneaky suspicion that once I figure these two errors out that I'm going to get slammed with a bunch more but I do have my fingers crossed on this one.
    Here's the code
    //=====================================
    // OpSpecs5.java    Author: Michael Barry
    //=====================================
    import java.math.*;
    public class OpSpecs5
      //Random generator = new Random (50);
      private int num1, num2;
      public OpSpec5()
        num1 = (int) (Math.random()*50) +1;
        num2 = (int) (Math.random()*50) +1;
      public int ActionPerformed (String sign)
        if (sign equals(a))
          return num1 + num2;
        else if (sign equals(s))
          return num1-num2;
        else if (sign equals(d))
          return num1/num2;
        else (sign equals (p))
          return num1 * num2;
    }  And here is the other file:
    //=====================================
    // OpSpecs5.java    Author: Michael Barry
    //=====================================
    import java.math.*;
    public class OpSpecs5
      //Random generator = new Random (50);
      private int num1, num2;
      public OpSpec5()
        num1 = (int) (Math.random()*50) +1;
        num2 = (int) (Math.random()*50) +1;
      public int ActionPerformed (String sign)
        if (sign equals(a))
          return num1 + num2;
        else if (sign equals(s))
          return num1-num2;
        else if (sign equals(d))
          return num1/num2;
        else (sign equals (p))
          return num1 * num2;
      Thnx in advance!!!!!!!!!

    Sorry about that.
    Here they both are this time
    //===========================
    // ExampleMathOps5.java
    //=========================
    import javax.swing.JOptionPane;
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    public class ExampleMathOps5
    public static void main(String[] args)
         ExampleMathOps5 MyOps;
         String numStr, result;
          int sum;
        int difference;
        int division;
        int product;
        int again;
        int exit;
        MyOps = new ExampleOpSpecs5 (); // Instantiation of OpSpecs5 file.
        do
                     sum = MyOps.ActionPerformed("a"); // "a" represents addition.
                     MyOps = JOptionPane.showInputDialog ("Enter your answer:"); // Prints sum of equation.
            sum = Integer.parseInt(numStr);
          result = "The correct answer is: " + ((num1+num2 == 0) ? "correct" : "incorrect"); 
          JOptionPane.ShowMessageDialog (null, result);
          again = JOptionPane.showConfirmDialog (null, "Try again?");
                     difference = MyOps.ActionPerformed("s"); // "s" represents subtraction.
                     MyOps = JOptionPane.showInputDialog ("Enter your answer:"); // Prints difference of equation.
                     difference = Integer.parseInt(numStr);
          result = "The correct answer is:" + ((num2-num1 == 0) ? "correct" : "incorrect");
          JOptionPane.showMessageDialog (null, result);
          again = JOptionPane.showConfirmDialog (null, "Try again?");
          division = MyOps.ActionPerformed("d"); // "d" represents division.
                     MyOps = JOptionPane.showInputDialog("Enter your answer:"); // Prints result of equation.
                     division = Integer.parseInt(numStr);
          result = "The correct answer is:" + ((num2/num1 == 0) ? "correct" : "incorrect");
          JOptionPane.showMessageDialog (null, result);
          again = JOptionPane.showConfirmDialog (null, "Try Again?");     
                     product = MyOps.ActionPerformed("p");  // "p" represents multiplication.
                     MyOps = JOptionPane.showInputDialog ("Enter your answer:"); // Prints product of equation.
            product = Integer.parseInt(numStr);
          result = "The correct answer is:" + ((num1*num2 == 0) ? "correct" : "incorrect");
          JOptionPane.showMessageDialog (null, result);
          again = JOptionPane.showConfirmDialog (null, "Try again?"); 
                    while (again == JOptionPane.YES_OPTION);
    }And here is the other file:
    //=====================================
    // ExampleOpSpecs5.java    Author:
    //=====================================
    import java.math.*;
    public class ExampleOpSpecs5
      //Random generator = new Random (50);
      private int num1, num2;
      public ExampleOpSpecs5()
        num1 = (int) (Math.random()*50) +1;
        num2 = (int) (Math.random()*50) +1;
      public int ActionPerformed (String sign)
        if (sign == "a")
          return num1 + num2;
        else if (sign == "s")
          return num1-num2;
        else if (sign == "d")
          return num1/num2;
        else if (sign == "p")
          return num1*num2;     
         else if (sign == null)
         return again;
      else
    return exit;
     

  • Error with variable substitution..

    Hi
    I am getting following error message for variable substitution
    *Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: date_stamp: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: date_stamp
      <?xml version="1.0" encoding="UTF-8" ?>
    - <I813_EModMCS_IB_MT>
    - <Records>
      <ModMod>111</ModMod>
      <DesModdcr>222</DesModdcr>
    - <Date_Stamp>
      <Date_Stamp>20080338</Date_Stamp>
      </Date_Stamp>
      </Records>
      </I813_EModMCS_IB_MT>
    date_stamp             payload:I813_EModMCS_IB_MT,1,Records,2,Date_Stamp,3,Date_Stamp,1
    Would appriciate if you can correct the variable substitution...
    Regards

    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    Edited by: Progirl Progirl on Jul 17, 2008 8:04 AM

Maybe you are looking for

  • Unable to connect SQL server 2005 databse with JSF applications !

    Hello guys! Help me out to connect SQL server 2005 Databse with JSF applications using JDBC-ODBC bridge. I'm working with Netbeans 6.1 IDE. I tried for the basic applications but instead got this error: "unable to deploy jdbc drivers to the <project>

  • How to send the mail with multiple file attachments ?

    Sending mails with multiple files as attachments.

  • Lenovo ThinkPad W530 (2441-4R3) specs

    I've been trying in vain to get the specifications for the Lenovo ThinkPad W530 (2441-4R3). Lenovo's Customer Support and Tech. Support could not help me with this issue. I would appreciate at if someone would please send me the specification for thi

  • Is it possible to get component associated with DefaultListSelectionEvent?

    Hallo, Is it possible to get component associated with DefaultListSelectionEvent, please? There are multiple tables in my window. All tables (must!) have same TableSelectionListener. Problem is that there's no information about component in default l

  • Automating manifest file Links

    Hi guys, I'm trying to figure out a way to automate the process of creating a manifest file for a specific video. (I.e. File is uploaded to a folder watched by AME > AME encodes the file > I receive a *.m3u8 file that I can give to a client.) Similar