Passing 2 input structures into 1 output structure

I have a BPM where I have data from 2 input different structures that needs to be mapped and passed to the same output structure at the same time.  Is this do-able through the BPM builder or the mapping builder or what?

As i understand you have two inputs to be mapped to one output structure. You can do this in your BPM using Transformation step. You need to do multimapping to achieve this.
Check this..
http://help.sap.com/saphelp_nw04/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/content.htm
hope this helps...
Regards
Anand

Similar Messages

  • How to merge five different xml input files into three output files

    Hi All,
    Can you please explain me to merge 5 different xml input files into 3 output xml files.
    I'm looking forward for ur suggestions...
    Thanks
    Pullarao

    HI
    Please see the below links
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm - Collection of IDoc to Single File
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/de/766840bf0cbf49e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cb/15163ff8519a06e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm
    Many other examples can be found under the following link at help.sap.com
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    And some weblogs
    https://weblogs.sdn.sap.com/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken]
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm *****
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi
    /people/michal.krawczyk2/blog/2005/09/04/xi-do-you-realy-enjoy-clicking-and-waiting-while-tracing-bpm-steps *****
    /people/udo.martens/blog/2005/09/30/one-logical-system-name-for-serveral-bpm-acknowledgements *****
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    /people/kannan.kailas/blog/2005/12/07/posting-multiple-idocs-with-acknowledgement
    Also have a look at these seminars,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/daea5871-0701-0010-12aa-c3a0c6d54e02
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/e8515171-0701-0010-be98-e37bec4706cc
    <b>BPM CollectPattern..</b>
    http://help.sap.com/saphelp_nw2004s/helpdata/en/08/16163ff8519a06e10000000a114084/frameset.htm
    Thanks !
    Regards
    Abhishek Agrahari
    Questions are welcome here!!
    <b>Also mark helpful answers by rewarding points </b>

  • Input word into box/Output box gives different word . . . possible?

    Hey all,
    Had a few questions for you guys .
    As some background . . .
    I work for a Public Safety organization for local government. In the coming year or so, we'll be implementing a new records management system for our police and fire agencies, as well as partner agencies in the region. This will require that all agencies use the same type of call type. A call type is an abbreviated message for a type of call.
    For instance, a commercial fire is known as CFIRE in our city, but in a neighboring city it might be labeled as anything from COMFIRE to 211 to . . . whatever really.
    I would like to build a flash "app" where the user can enter in their code, and the app will give them what the universal code is.
    For example, there will be a box that they can type in 211 (or COMFIRE or whatever) and press ok. Below will appear CFIRE. Then I would like them to be able to press a button that says COPY, so it copies that to their clipboard.
    All the various call types for the different agencies will be known. I essentially need something that will say "If field 1 = COMFIRE, 211, X, Y, Z; Then field 2 = CFIRE" type of thing. Then the coding to Copy it to clipboard.
    Is this possible, and if so, where should I be exploring further. I am not unfamiliar with action-scripting, and have built many flash websites that are fairly involved, but I imagine a bit of this will be new to me .
    Any and all help is greatly appreciated.

    I am not going to have anything to offer for the clipboard aspect.  THat' may be a system control that Flash may not be capable of providing.  But for the cross-reference bit you could just use an array that contains the universal code as the first element and all possible variations of it as the others.  Then you can make use of the indexOf() method of the Array to see if the array holds the value entered, and if so, display the first element of that array for the other textfield.
    var cfireArray:Array = new Array("CFIRE","211","COMFIRE");
    inputText.addEventListener(Event.CHANGE, checkArray);
    function checkArray(evt:MouseEvent):void {
         if(cfireArray.indexOf(inputText.text) > -1){ outputText.text = cfireArray[0];
    And you could have a higher level array that hold all of the arrays like the one above and in that function just loop thru them all that way.
    (Edited due to misnaming array in some lines.)

  • Passing RFC output structure to another RFC input structure.

    Hello Friends,
    I have 2 views (i.e. SearchView & ResultView). In search view, I pass input parameter (PO Number) to BAPI_PO_GETITEMS and get back the output table PO_ITEMS correctly. I display this table in the ResultView correctly. Now, after displaying the order details, I need to pass this input to BAPI_GOODSMVT_CREATE in its GOODSMVT_ITEM structure to create a Good Movement Note.
    Can somebody help me as to how could I pass values from PO_ITEMS to GOODSMVT_ITEM structure?
    Thanking you in advance,
    Maulin

    Hi,
    You can pass the input of BAPI_PO_GETITEMS  to the BAPI_GOODSMVT_CREATE .
    For this u need to first understand and read the BAPI throughly, means u must read how your two bapi's are working and what are the relation ship b/w them.
    Also, i assume that in a ur webdynpro application u already imported all required BAPI and just simple take the user Input from the context and pass it to the next Bapi.
    Hope so it can solve ur pb,If there is any more query, put in forum.
    Thanks
    Dheerendra Shukla

  • How to force field to appear in input structure in content conversion

    Hi all,
    I am doing file content conversion in sender File adapter. Here is the structure
    Header
    Body
       field1 - length 2
       field2 - occurrence 1:1, length 3
       field3 - length 2
       field4  length 2
    Trailer
    Here is the fixed length file that is inputed into XI
    <b>header22   2211trailer</b>
    field2 occrence is 1:1 and as you se from the file example field2 from the body is empty(just space).But  When I do the content conversion I don;t have this field showing up in my structure!??!!
    I want to make sure that field2 appears even as empty field because that is screwing my mapping!?
    Can you please have any idea how to make sure that field is in my input structure when I pass spaces?Can I force it somehow?
    Thanks all.

    Hi Jon,
    Yes you are right.
    For Ex: ur XML is
    <1>a</1>
    <2>b</2>
    and sometime is there is no value ur FCC will become
    <1>a</1>
    So what you have to do is in the message mapping take the source element
    if <2> exists then <2>---->Target
    else
    <2>---->Constant(space)
    and this "exists" is a standard function in NodeFunctions.
    Regards,

  • RFC input structure

    Hello,
    I am trying to call a RFC from my WebDynpro application.
    The RFC has a mandatory input structure called PERSDATA.
    I am using the following test code to call the RFC:
         IWDMessageManager manager = wdComponentAPI.getMessageManager();
         try{
              wdContext.nodeZ_Portal_Get_Timesheet_Input().bind(new Z_Portal_Get_Timesheet_Input());
              wdContext.currentZ_Portal_Get_Timesheet_InputElement().setKeydate(new Date(105,9,27));
              wdContext.nodePersdata().bind(new Cats_Its_Persdata());
              wdContext.currentPersdataElement().setPernr("00003000");
              wdContext.currentZ_Portal_Get_Timesheet_InputElement().modelObject().execute();
              wdContext.nodeOutput().invalidate();
         } catch(WDDynamicRFCExecuteException ce) {
              manager.reportException(ce.getMessage(), false);
    When I run this code I get the errormessage:
    <b>Mandatory parameter PERSDATA of method Z_PORTAL_GET_TIMESHEET missing.</b>
    When I display the input structure in my view (in a table) it displays one row with pernr set to 00003000 (so it seems to me that the input structure is ok).
    What am I doing wrong here?

    Hallo Johan,
    your mistake is based on the fakt, that you did not correctly aggregate your model object graph. Instead you operated on the context itself. The context only references the model objects within the model object graph. Relations between context nodes and context node elements are not automatcally mirrored within the model object graph. Principally you have to aggregate your model object graph first (independant from the contex) and afterwards you can reference the executable model class within the toplevel context node element.
    I assume, that your code should look like this:
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
    try {
      // Aggregate model object graph
      Z_Portal_Get_Timesheet_Input timeSheetInput =
      new Z_Portal_Get_Timesheet_Input();
      timeSheetInput.setKeydate(new Date(105, 9, 27));
      Cats_Its_Persdata persData = new Cats_Its_Persdata();
      persData.setPernr("00003000");
      timeSheetInput.setPersdata(persData);
      // Bind executable model object to context node 'Z_Portal_Get_Timesheet_Input'
      wdContext.nodeZ_Portal_Get_Timesheet_Input().bind(timeSheetInput);
      // Execute model object
      wdContext
        .currentZ_Portal_Get_Timesheet_InputElement()
        .modelObject()
        .execute();
      // Invalidate output node so that the context-to-model-object-references will be updated
      wdContext.nodeOutput().invalidate();
    } catch (WDDynamicRFCExecuteException ce) {
    manager.reportException(ce.getMessage(), false);
    Also have a look at my related answer within the forum thread Executing model : deep structure in importing parameter of RFC which deals with the same issue.
    Regards, Bertram
    Regards, Bertram

  • Duplicate records in input structure of model node

    Hi,
    Following is the way, I am assigning data to a model node:
    //Clearing the model input node
    for (int i = wdContext.nodeInsppointdata().size(); i > 0; i--)
         wdContext.nodeInsppointdata().removeElement(wdContext.nodeInsppointdata().getElementAt(i - 1));
    //Creating element of the input model node
    IPrivateResultsView.IInsppointdataElement eleInspPointData;
    //START A
    Bapi2045L4 objBapi2045L4_1 = new Bapi2045L4(); //Instance of the input structure type
    //Populating data
    eleInspPointData = wdContext.nodeInsppointdata().createInsppointdataElement(objBapi2045L4_1);
    wdContext.nodeInsppointdata().addElement(eleInspPointData);
    eleInspPointData.setInsplot(wdContext.currentContextElement().getInspectionLotNumber());
    eleInspPointData.setInspoper("0101");
    //Inspection_Validate_Input is the model node. Adding instance to main node
    wdContext.currentInspection_Validate_InputElement().modelObject().addInsppointdata(objBapi2045L4_1);
    //STOP A
    //Now executing the RFC
    Above code seems to be fine. Works very well for the first time. But, when the user clicks on the same button for the second time, I can see duplicate records getting passed to RFC [Debugged using external breakpoint]. When I am sending 4 records, I can see there are total of 6 records. The number keeps increasing when clicked on the button.
    I am adding multiple records to input model node using the code from START A to STOP A. Does the code look fine? Why do I see multiple records?
    Thanks,
    Sham

    Issue solved.
    After executing RFC, I used following code to clear the input model node:
    try
         wdContext.current<yourBAPI>_InputElement().modelObject().get<yourinputnode>().clear();
    catch (Exception e1)

  • Mandatory fields passing to the structure POCOND in BAPI_PO_CREATE1

    Hi,
    Please help me that what are the mandatory fields passing to the structure <b>POCOND</b> in <b>BAPI_PO_CREATE1</b>. I am using BAPI to create the PO based on certain conditions. But after creating the PO the condition values are not updating properly. Currently i am not passing any values to the structure.
    Your solutions should be highgly appreciated. Please help me this issue as early as possible
    Regards,
    Uday

    Hi ,
    In my current requirement i m using BAPI_PO_CREATE1 to create the PO.
    I am passing all the line item detials to the BAPI.
    For some of the material rounding value are maintained in MM02 on MRP view.
    If the line item material maintains rounding value then instead of taking the PO item quantity, it is taking the rounding value that has maintained in MM02. So to control that i have done the forceful updation using the update statement in one of the exit on BAPI_PO_CREATE1.
    Here i m facing one problem. Now i can able to udpate the PO quantity correctly.
    But the Condition value maintained in the Condition View still taking the rounding value for calculating.
    To control this also i am using update statement on KONV table and the field is KAWRT. But this value is not updating.
    Please help any one that in which table the the condition value is going to update and wht are the criteria to update the  Condition Value field.
    <b>Points should allocate for suitable answer.</b>
    Thanks
    Uday

  • Pass multiple values as single input parameter into pipelined function

    Hi all,
    My need is to pass multiple values as single input parameter into pipelined function.
    For example - "2" and "3" are values of input parameter "t":
    with data as (
    select 1 as t from dual union all
    select 2 as t from dual union all
    select 3 as t from dual union all
    select 4 as t from dual union all
    select 5 as t from dual
    select * from data where t in (2,3)Is it possible at all?

    Not exactly sure, but usually 'multiple values'+'pipelined function' = some IN-LIST related approach?
    See:
    SQL> create table data as
      2  select 1 as t from dual union all
      3  select 2 as t from dual union all
      4  select 3 as t from dual union all
      5  select 4 as t from dual union all
      6  select 5 as t from dual;
    Table created.
    SQL> --
    SQL> CREATE OR REPLACE FUNCTION in_list (p_in_list  IN  VARCHAR2)
      2  RETURN sys.odcivarchar2list PIPELINED
      3  AS
      4    l_text  VARCHAR2(32767) := p_in_list || ',';
      5    l_idx   NUMBER;
      6  BEGIN
      7    LOOP
      8      l_idx := INSTR(l_text, ',');
      9      EXIT WHEN NVL(l_idx, 0) = 0;
    10      PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
    11      l_text := SUBSTR(l_text, l_idx + 1);
    12    END LOOP;
    13 
    14    RETURN;
    15  END;
    16  /
    Function created.
    SQL> --
    SQL> select *
      2  from   data
      3  where  t in ( select *
      4                from   table(in_list('1,2'))
      5              );
             T
             1
             2
    2 rows selected.http://www.oracle-base.com/articles/misc/dynamic-in-lists.php
    or
    http://tkyte.blogspot.nl/2006/06/varying-in-lists.html

  • Getting Data from Input Structure (in Web Dynpro)

    Hi All,
    in my Web Dynpro Application, i have problems to get the data form my Input-Structure. In the execution-method I implement the following code, to show the input parameters in my form (in context-nodes):
    IGPStructure inputStructure = executionContext.getInputStructure;
    node.setSolution((String)inputStructure.getStructure("FRS").getAttribute("Solution"));
    But that doesnt work I, my exception handler throws an exception. Exception.getMessage() returns null, so I cannot show the error-message. What is the problem?
    Hope someone can help me.
    Really thanks
    Bye Steve

    I solved it my own.
    It was an Null-Pointer exception, cause getStructure can also return null, when no structure is added.
    In my code I didnt catch null-structures, result was the error message.
    Right code example:
    IGPStructure inputStructure = executionContext.getInputStructure.getStructure("FRS");
    if(inputStructure != null){
        node.setSolution((String)inputStructure.getAttribute("Solution"));

  • LSMW  Field Mapping: can't map Batch Input Structure for Session Data

    In step 5 Maintain Field Mapping and Conversion Rules, I can not see Batch Input Structure for Session Data Fields.
    Can somebody tell what's wrong?
    Here's what I see:
    Field Mapping and Rule
            BGR00                          Batch Input Structure for Session Data
                Fields
                BMM00                          Material Master: Transaction Data for Batch Input

    Hi Baojing,
    To see structure BGR00  you have to map this structure first with input file structure in step 4 (maintain structure relationship).
    Regards
    Dhirendra

  • BRM 7.2 and input structure as a collection

    Hi there!
    I created a BRM project in NWDS 7.2 and I have an input structure with cardinality 0..n (it's a collection). Now I have to iterate through it and check the each value of the structure's attribute. But I can't see the way to iterate the collection. I created a rule script in flow ruleset, but I can't find the way to initialize List with my collection.
    How can I achieve ma task?

    My system is
      MacBook Pro Late 2011
      Processor Name:          Intel Core i7
      Processor Speed:          2.4 GHz
      Number of Processors:          1
      Total Number of Cores:          4
      Memory:          16 GB
    Same issue, initially, I believed the problem was "lumetri" effect related, but I see now that it appears to be GPU related, when i select Mercury Playback with GPU it is sluggish when handling clips with effects, and it says that it will take about 7 hours to export a 5 minute clip. 
    However when I select Mercury Playback "software only" seems to zip right on again, a work around for now I suppose, but I really do think that the GPU ought to be enabled, no?
    Everything worked fine 7.1 -more or less.... but still seemed a bit more stable than 7.2...
    I hope these guys release a patch in the next couple of weeks, cause this software only mode is a HUGE step backwards...

  • Passing & receiving C structures in Forte

    Hi,
    I need to pass a C structure to an External Connection and receive it as
    well.
    Thanks for the help in advance
    Bala Cuddalore
    Sage Solutions
    425 Battery
    Suite 4B
    San Francisco CA
    [email protected]

    Hello,
    We cannot pass it please check the FM parameters datatype declare one variable of the that parameter type and move your parameter type value to FM parameter type variable and pass the value to FM.

  • Read multiple files and save all into one output file(AGAIN)

    Hi, guys
    I need your help for reading data from multiple files and save the results into one output file. When files are selected from file chooser, my program read the data line by line , do some calculations and save the result into the output. I made an array to store input files and it seems to be working fine, but when it comes to SaveFile() function, issues NullPointException message.
    public class FileReduction1 extends JFrame implements ActionListener
       // GUI definition and layout
        /* ACTION PERFORMED */
        public void actionPerformed(ActionEvent event) {
            if (event.getActionCommand().equals("Open File")) getFileName();
        /* OPEN THE FILE */
        private void getFileName() {
            // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            fileChooser.setMultiSelectionEnabled(true);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
            if (result == JFileChooser.APPROVE_OPTION)
             files = fileChooser.getSelectedFiles();
                textArea.setText("");
                if(files.length>0)
                    filelist="";
                    System.out.println("files length"+files.length);
                    for(int i=0;i<files.length;i++)
                         System.out.println(files.getName());
    filelist+=files[i].getName()+" ,";
    if (checkFileName(files[i]) )
    openButton.setEnabled(true);
    readButton.setEnabled(true);
    textArea.append("file "+files[i].getName()+"is a proper file"+"\n");
    readFile(files[i]);
    textfield.setText(filelist);
    else{JOptionPane.showMessageDialog(this,"Please select file(s)",
                    "Error 5: ",JOptionPane.ERROR_MESSAGE); }
         // Obtain selected file
    /* READ FILE */
    private void readFile(File fileName_in) {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines(fileName_in);
         data = new String[numLines][4];
         // Read file
         readTheFile(fileName_in);
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines(File fileName_in) {
    int counter = 0;
         // Open the file
         openFile(fileName_in);
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile(fileName_in);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile(fileName_in);
         System.exit(1);
    /* READ FILE */
    private void readTheFile(File fileName_in)
    // Open the file
    //int row=0;
    int col=0;
    openFile(fileName_in);
    System.out.println("Read the file");
    // Loop through file incrementing counter
    try
    String line = fileInput.readLine();
    while (line != null)
    boolean containsDoubles = false;
    double temp;
    String[] lineParts = line.split("\t");
    try
    for (col=0;col<lineParts.length;col++)
    temp=Double.parseDouble(lineParts[col]);
    data[row][col] = lineParts[col];
    containsDoubles = true;
    System.out.print("data["+row+"]["+col+"]="+lineParts[col]+" ");
    } catch (Exception e) {row=0; col=0; temp=0.0;}
    if (containsDoubles){ row++;}
    System.out.println();
    line = fileInput.readLine();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(this,"Error reading File", "Error 5: ",JOptionPane.ERROR_MESSAGE);
    closeFile(fileName_in);
    System.exit(1);
    //System.out.println("length"+data.length);
    closeFile(fileName_in);
    process(fileName_in);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName(File fileName_in) {
         if (fileName_in.exists()) {
         if (fileName_in.canRead()) {
              if (fileName_in.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* OPEN FILE */
    private void openFile(File fileName_in) {
         try {
         // Open file
         FileReader file = new FileReader(fileName_in);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
         textArea.append("OPEN FILE\n---------\n");
         textArea.append(fileName_in.getPath());
         textArea.append("\n");
         //System.out.println("File opened successfully");
    /* CLOSE FILE */
    private void closeFile(File fileName_in) {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    private void process(File fileName_in) {
    //getNumberOfLines();
         //data = new String[numLines][3];
         // Read file
    double temp,temp1;
         //readTheFile();
    //System.out.println("row:"+row);
    //int number=data.length;
    //System.out.println(number);
    for (int i=0; i<row; i++)
    temp=Double.parseDouble(data[i][1]);
    sumx+=temp;
    temp1=Double.parseDouble(data[i][3]);
    sumy+=temp1;
    multixy+=(temp*temp1);
    square_x_sum+=(temp*temp);
    square_y_sum+=(temp1*temp1);
    //System.out.println("Sum(x)="+sumx);
    double tempup=(row*multixy)-(sumx*sumy);
    double tempdown=(row*square_x_sum)-(sumx*sumx);
    slope=tempup/tempdown;
    double tempbup=sumy-(slope*sumx);
    intb=tempbup/row;
    double tempside=(row*square_y_sum)-(sumy*sumy);
    double cordown=Math.sqrt(tempdown*tempside);
    corr=tempup/cordown;
    r_sqrt=corr*corr;
         textArea.append("Data for file"+ fileName_in.getName()+" have been processed successfully.");
         textArea.append("\n");
         textArea.append("Please enter output file name including extension.");
    System.out.println("number"+row);
    System.out.println("slope(m)="+slope);
    System.out.println("intecept b="+intb);
    System.out.println("correlation="+corr);
    System.out.println("correlation="+r_sqrt);
    saveFile();
    private void saveFile()
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // search for the file path
    StringBuffer stringpath;
    title=textfield1.getText().trim();
    int temp=fileName_in.getName().length();
    int temp_path=fileName_in.getPath().length();
    int startd=(temp_path-temp);
    stringpath=new StringBuffer(fileName_in.getPath());
    stringpath.delete(startd, temp_path+1);
    //System.out.println("file-path="+temp_path);
    //System.out.println("length-file="+temp);
    path=stringpath.toString();
    fileName_out = new File(path, title);
    //System.out.println(file_out.getName());
    if (fileName_out==null || fileName_out.getName().equals(""))
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File name",JOptionPane.ERROR_MESSAGE);
         return(false);
         else
    try
    boolean created = fileName_out.createNewFile();
    if(created)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    fileOutput.println("File Name"+"\t"+"Slope(m)"+"\t"+"y-intercept(b)"+"\t"+"Coefficient(r)"+"\t"+"Correlation(R-Squared)");
    return(true);
    else
    fileOutput = new PrintWriter(new FileWriter(fileName_out,true));
    return(true);
    catch (IOException exc)
    JOptionPane.showMessageDialog(this,"Please enter the file name","Error",JOptionPane.ERROR_MESSAGE);
    return(false);
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         // Test if data exists
         if (data != null)
         fileOutput.println(fileName_in.getName() +"\t"+ slope+"\t"+intb+"\t"+corr+"\t"+r_sqrt);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
    initialcomp();
         fileOutput.close();
    private void initialcomp()
    slope=0.0;
    intb=0.0;
    corr=0.0;
    r_sqrt=0.0;
    sumx=0.0; sumy=0.0; multixy=0.0; square_x_sum=0.0; square_y_sum=0.0;
    for(int i=0;i<data.length;i++)
    for(int j=0;j<data[i].length;j++)
    data[i][j]=null;
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Sorry about the long lines.
    As you can see, all input files saved in array called files, however when OpenFile1() function is called, it take input (fileName_in) as a single file not an array. I'm assuming this causes the exception.
    When there's muptiple inputs, program should take each file from getFileName() to outputToFile() sequentially.
    Does anybody have an idea to solve this?
    Thanks a lot!!

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

  • How to apply input file name to output file in file adapter

    Hi Friends
    In my file to file scenario,i want to use input file name to output file by using adapter specific attributes,for this i have java code.Please suggest me how can i use this java code in mesg mapping and to which field i need to mapping this.
    Thanks
    pullarao

    Hi Pullarao,
    I have two questions ...
    1. Are u want the static file name in the target file?
    if yes...then follow the Bhavesh instruction.
    2.If u want a dynamic file name in the target file using UDF....then your UDF should mapped to the <b>root element</b> of target structure.
    /**********UDF********/
    Imports: com.sap.aii.mapping.api.*;
    Parameter: String filename
    String filename;
    filename = fileName + ".DAT";
    DynamicConfiguration conf = (DynamicConfiguration) container
           .getTransformationParameters()
           .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    conf.put(key, filename);
    return filename;
    /*******END UDF*******/

Maybe you are looking for

  • Does the latest ipod nano work with icloud?

    Hey guys! I've recieved a new ipod nano (seventh generation), brand spankin new. Got it all set up with itunes and have music added and everything. I also have a ipod touch (third generation) with tons of music NOT in my itunes library. But I do have

  • Can't see some Business Rules after running the Import via LCM

    I am trying to migrate our Business Rules down from Prod to Dev to get them back in sync. Here is the steps I have run: Export ALL Business Rules and Sequences from Prod via LCM I confirmed the export directory contains an .xml file for EACH Rule. co

  • No longer able to follow local file links.

    In previous versions of firefox ( 28 and Earlier ) I was able to follow local file links by whitelisting them in the user preferences file as shown here: http://kb.mozillazine.org/Links_to_local_pages_do_not_work This functionality has ceased to work

  • Attachments sent via mail not received as attachments

    Frequently when I send an email with an attached gif or jpeg, the receiver writes back to ask if I can send it as an attachment, not embedded in the email. I find this confusing since I don't know of any other way to send something than as an attachm

  • Apple tv - computer work

    Hi There I want to be able to work on my computer whilst someone else is watching a movie from my harddrive via the apple tv in a seperate room.  How do I do this without them seeing my work via the mirroring option