Handling Multiple Records in a file adapter

Hi All,
My source file message :
<Source_MT>
    <Records>....<b>0-Unbound</b>
             <Country>THAILAND</country>
    </Records>
   <Records>....<b>0-Unbound</b>
             <Country>ANGOLA</country>
    </Records>
</Source_MT>
Target Message:
<Target_MT>
    <Employees>....<b>0-Unbound</b>
             <Country>THAILAND</country>
    </Employees>
</Traget_MT>
Now in my scenario ,source message will have multiple records with different countries........
I want to send these records to different receivers on the basis of this coutry field,means after target message mapping....all the records corresponding to THAILAND must be sent to THA_RECVR system..all the records corresponding to ANGOLA must be sent to Angola recvr systems...
Please help me to club target message records on the basis of country field and then send it to correspodning receiver systems ......
Should I use BPM?

Shweta,
You need to do enhanced receiver determination. You can handle this by determining them during runtime.
Check this out : Re: Condition In Receiver Determination Not Working [Page 3 : My reply]
raj.

Similar Messages

  • Save file in multiple directories using receiver file adapter?

    Hi,
    Is it posible to save file in multiple directories using receiver file adapter?
    Regards,
    Ashish

    Well, there is a round about way to do that -
    The idea is to use multi mapping. 1:n mapping
    1) Map ur message to 2 different record set nodes. Since you want to use the same file both the mapping will look exactly the same. make sure that the filepath and filename are a part of the output payload message
    2) In the file adapter config. make sure the the file name and file path are from these payload fields. You can use a context object to refer these fields. Voila...the files are created in the 2 direcoties you mentioned.
    of course the simplest way is to route the same message to 2 business systems/services and write them out using 2 ccs.,
    Arvind R

  • Creation of multiple Records in the file as per multiple segments in IDOC

    Hi SapAll.
    i have got a requirement to create a multiple records in a file based on multiple segments at sending Idoc in a File To Idoc Interface.
    the Scenario  is the reciever message type is mapped with fields of 3 segments in sending IDOC.
    SEG01   1.....1(PARENT SEGMENT)
      SEG02  0...999999(CHILD SEGMENT)
      SEG03 0...9999999(CHILD SEGMENT)
    in an instance where if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 2 times PI is creating the file with 2 records in it but
    when if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 1 time it is raising the error in message mapping where it is supposed to create 2 records in a file with empty values in the fields (mapping with seg03) segment.
    can anybody help me in this.
    regards.
    Varma

    you can create a UDF after you validate if the count match. if match you create the message if not, call de UDF.
    this UDF should receive two parameters -->Queue SEG2 and queue of SEG3.
    then you should loop by the count of SEG2. if you find a Supress Value in the queue of SEG3 add a "" to result. for example.
    for(i=0;i<=SEG2.count;i++){
    If SEG3<i>.equals(ResultList.SUPPRESS) {
           result.addValue(" ");
    }else{result.addValue(SEG3<i>);
    the result of UDF is a queue which should map to target field directly coz it has context changes
    I think that is what you are needing. if no let me know.
    RP
    Edited by: Rodrigo Alejandro Pertierra on Jun 17, 2010 11:56 AM

  • Can the File Adapter handle Multiple Record Layouts in COBOL?

    I am trying to parse flat files that have a record type field in the first four characters on each record. As a test I tried to use the following record definitions:
    01 CONTRACT-HEADER.
    05 RECORD-TYPE PIC X(4).
    05 TRANSACTION-TYPE PIC X.
    05 CONTRACT-NUMBER PIC X(32).
    05 CONTRACT-RELEASE-NBR PIC X(30).
    05 CONTRACT-FILLER PIC X(2025).
    01 CONTRACT-LINEITEM.
    05 RECORD-TYPE PIC X(4).
    05 TRANSACTION-TYPE PIC X.
    05 LINE-FILLER PIC X(1664).
    I also tried smaller records with simple test data. When I press the "test" button in the native file adapter the XML is never generated if I have more than one record type as above. Suppose that the contract-header record type always has the string "X001" in it, while the contract-lineitem always has "X015" in the record-type. I chose Us-ascii and chose $eol as a delimiter. The file on my windows computer has carriage return line feed after each record. I know that the fixed length converter works, but because the records really have 50 fields on each record type and are long, I don't think I can actually use that one in one sitting. Has anyone ever gotten two different record lenght cobol definitions to work? Do I have to hand edit the XML to specify the delimiter? I don't see any delimter specified in the generated XML before I attempt the test.

    Rahul,
    I recommned you should use "|" as "," can be embedded in a text string. I guess you can pass a directive to use to deliver "|" delimited file :). If you want to handle both then you might have to write a shell script or bat to pass delimiter as an argument which will edit and replace your control file.
    Regards

  • How to handle multiple records in BPMN process

    Hi All,
    We are using Oracle BPM 11g.In my requirement,I am using the database adapter to get the data from table and I need to validate the each record and update the status of that record from the BPM Process.But I dont know how to handle if multiple records come at a time.Can anybody please helpout from this problem.
    Thanks in advanced.
    Narasimha Rao.

    Can you have a look at this post: http://redstack.wordpress.com/2010/09/30/iteratingtraversing-arrays-in-bpm/
    It's solving a different problem, but the key is that it's using a multi-instance subprocess to iterate over an array of "things" that need to be acted in. In your case it's the set of results from the db query rather than the set of tests in the example. But the principle is the same. You'd take collection of rows from the DB and process them in a multi-instance subprocess. The text that begins with the following would be good place to start:
    "Now let’s implement the body of our process. We will use the Subprocess object to handle the traversal of the array of tests. Drag a Subprocess from the component palette on the right into the process and drop it on the line between the Start and End nodes."
    In the loop characteristics you'd define whether you want to execute serially or in parallel.

  • BPM for Processing Multiple records in a file

    Hello All:
    I using BPM to process Goods issue using BAPI BAPI_GOODSMVT_CREATE. The BPM setps are as
    Step 1  Receive Request from Asyn File Interface
    Step 2  Transformation Map to Bapi request Structure
    Step 3  Send Sync Request to Bapi
    Step 4  Transformation Map Bapi Response to file
    Step 5  Send Asyn Message to File
    My input file  is as fallows
    H,20050613,20050613,9999,HEAD TXT,03,
    P,000001000108,0001,COMMON,2,EA,1000,1011,261,ITM TXT,
    H,20050613,20050613,9999,HEAD TXT,03,
    P,000001000108,0001,COMMON,3,EA,1000,1011,261,ITM TXT,
    The output file is as fallows
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_SAP_RESPONSE_ITMS_DATA xmlns:ns1="http://testcompany.com/xi/ITMS">
    - <BAPI_STR>
    - <HEADER>
      <MAT_DOC>4900000696</MAT_DOC>
      </HEADER>
      </BAPI_STR>
      </ns1:MT_SAP_RESPONSE_ITMS_DATA>
    The problem I am facing is although my file has 2 records of goods issue data (Header and Item data) , the BPM processes only one record (Header and Item) and creates a material doc in SAP and outputs a file with the material doc number as above. Ideally I would like the XI system to process both the records and produce 2 material docs as output .
    Also my input file adapter has been picking up both the records as this is visible in the SXMB_MONITOR logs.
    Do I need to introduce a loop in the BPM ?. If so can any can any body give me an example or point me in the right direction.
    Many Thanks
    TBH

    Udo:
    <b>you need a mapping splitting one message with multiple entries into multiple messages with one entry, which you put into a multiple line BPM container.</b>
       Are you implying loop Step 1 Receive Request from Asyn File Interface and collect them into a multiline container ?. How does the loop know how many times to loop.
    Would appreciate your comments
    Thorsten

  • Can Web Service Consumption in SAP CRM 7.0 handle multiple records

    Hi All,
    I have a requirement where in I need to Consume a web service in SAP CRM. The response of the web service will have multiple records.
    My questions is will Web Service Consumption in SAP CRM 7.0 be able to handle these records in a popup or not.
    I would like to know whether it is feasible or not.
    Thanks,
    Deepika

    Hi Kavita,
    There is a standard column in UWL with name 'Sent Date'. Other functionalities in UWL for example deadline monitoring (Due date column) are based on this sent date. This shows an employee what was the date workitem was created (sent date) and when it will get escalated (due date). Displaying forwarding date in Sent date will not give clear picture to employee as the deadline will be calculated based on sent date only not based on forwarding date. this was just an example.
    even though if your client is insisting, i dont think it can be done without any enhancement in UWL web dynpro com sort of thing. you can check with your portal consultant too.
    Regards,
    Ibrahim

  • Creation of multiple records in reciever file as per occurance of 1 segment

    Hi SapAll.
    i have a got a requirement in an IDOC To File Interface
    the Requirement is under sending IDOC there will be multiple segments whose fields will me mapped to reciever file,so here i got a business requirement as
    IDOC -
    Segment 1-occur for 1 time
    segment 2- occurs  for 1 time
    segment 3-occurs for 3 times so here PI Need to create a file with 3 records as segment 3 repeats for 3 times, here segment 1 and segment 2  field  values repeats for all the 3 records int the file and segment 3 fields values will have to be mapped respectively for each record of all the 3 records from each segment 3.
    i dont know on how i can acheive this.
    can any of sap group provide me the solution.
    regards.
    Varma

    > segment 3-occurs for 3 times so here PI Need to create a file with 3 records as segment 3 repeats for 3 times, here segment 1 and segment 2  field  values repeats for all the 3 records int the file and segment 3 fields values will have to be mapped respectively for each record of all the 3 records from each segment 3.
    Create your target structure as mentioned and do the mapping as shown below.
    <Records> 0..unbounded
         <segment1_Fields> </segment1_Fields>
         <segment2_Fields> </segment2_Fields>
         <segment3_Fields> </segment3_Fields>
    </Records>
    Now do the mapping like this..
            segment3 -
    >RemoveContext---> Records (parent node mapping)
             segment1----->CopyValue(0) ---> segment_field1
             segment2----->CopyValue(0) ---> segment_field2
             segment3----->SplitByValue ---> segment_field3
    Note: You can also use "UseOneAsMany" instead of "CopyValue" function to repeat the segment1 & segment2 values in each record.

  • Accessing multiple directories using single file adapter

    Hi All,
              I have data coming from two banks. I need to put them in SAP file server. Now i have two sender adapters for each bank, now is there a way i can use same receiver adapter but create diff directories to store them.
    XIer

    Hi,
    In file sender communication channel there is a check box for Advanced Selection for Source file. Check that and you dont put anything in exclusion which means it takes all the files from multiple direcotires. Please check this weblog where he has excluded some files in the directory. But you dont need to exclude anything.
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    Regards,
    ---Satish

  • Handle sub structure in receiver file adapter

    Dear all,
    How to handle deep sub structures in Receiver.any inputs would be appreciated.
    Thanks,
    Srini

    two things that you can look into are;
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    /people/shabarish.vijayakumar/blog/2010/01/14/file-conversion-using-nodeception
    that should pretty much help you come to a conclusion

  • How to write file into multiple directories by using file adapter?

    i need to write my file into multiple directories,i able to do in single directory.But i need to write to muliple directories.Please help me out.Thanks in advance.

    If you are passing the values at runtime then you can loop it and and invoke the file adapter in loop by dynamically passing the value in invoke properties for "File Directory and File name" etc.

  • Mulitple Detail record values in file adapter

    Hi,
    How shall I pick up a file in sender file adapter which is having two different record identifiers for their detail records. My structure is
    Header - Record identifier is HDR
    Detail - Record identifier is 10 and 30
    Trailer - Record identifier is TRL
    While configuring File adapetr I am unable to pick up Detail records with 30 because my Detail.KeyFieldvalue is only equals to 10. I know I can have a work around of picking up all the records and then in map distinguish all the different record types but I am interested in picking up all the detail records having different record identifiers.
    thanks .

    Rakesh
    Just an Idea..If you can make your source structure as
    Header
    Detail1
    Detail2
    Trailer
    Then you can give Detail1 key as 10 and Detail2 Key as 30. I think its just matter of getting records and assigning to target structure, guess i think it might work
    Just my 2 cents

  • Handling bad records in a file.

    Hi,
    I am using external tables for loading data from text files. I am doing it well. I came across a case, where some records are not good, those records are diverted to bad file.
    In that case, we are losing the valuable data. We can do some validation and we can use it.
    Could anyone please suggest me the way we could perform this.
    And I have one more doubt. Using OWB we can create single external table for multiple files. I would like to differentiate the records of each file, by adding filename as one extra field.
    Can we do this using owb?
    Any suggestions are welcome.
    Thanks and regards
    Gowtham Sen.

    Indeed,
    OWB is not a magic tool, but just a good ETL tool that will do what you tell it to :)
    You must first figure out what cases you come a cross, and then figure out what you can do to solve each strange case.
    First of all, as has been pointed out, get all the data into your external tables. Avoid doing any type checking or casting at this case. just stick to VARCHAR fields (and perhaps NUMBER but even here I tend to use VARCHAR). Then, in a second mapping, try to get your data in to a staging table and there you can isolate the bad records, and perhaps allow for human interaction to correct the data if all else fails.
    Regarding the files, you have before mentioned that delta loads are what you have to do. Unless you are running your loads in a "live" system where data is flowing in on and off during daily operations, then going for a whole refresh would make your life so much better (20 mins of loading during the night is quite a good deal, if it makes your loading logic so much simpler).
    But, as you have said before, you need delta loads.
    Using UNIX shell scripts, you can use the 'diff' command to create your datafiles. That should be quite straight forward. Otherwise you can perhaps use staging tables and the MINUS operator. There isn't always a quick solution.
    Borkur

  • Saving multiple records into text file

    Can I save multiple records into a text file at one go?
    My application has a list of data displayed there and when the user clicks on the save button it will save all the records on the screen.
    It works but it only saves the last record.
    Here are my codes
    // this is to display the list of data
    private JLabel[] subjects=new JLabel[20];
    private JLabel[] subTotal=new JLabel[20];
    private JLabel[] codes=new JLabel[20];
    private JLabel[] getTotal=new JLabel[20];
    String moduleCodes;
    String getPrice;
    double price;
    int noOfNotes;
    public testapp(Subjects[] subList)
    int j=0;
                double CalTotal=0;
              for (int i=0; i<subList.length; i++)
                   subjects[i] = new JLabel();
                   subTotal[i] = new JLabel();
                   codes=new JLabel();
                   getTotal[i]=new JLabel();
                   if (subList[i].isSelected)
                        System.out.println(i+"is selected");
                        subjects[i].setText(subList[i].title);
                        subjects[i].setBounds(30, 140 + (j*30), 400, 40);
                        subTotal[i].setText("$"+subList[i].price);
                        subTotal[i].setBounds(430,140+(j*30),100,40);
                        codes[i].setText(subList[i].code);
                        getTotal[i].setText(subList[i].price+"");
                        CalTotal+=subList[i].price;
                        contain.add(subjects[i]);
                        contain.add(subTotal[i]);
                        j++;
                        moduleCodes=codes[i].getText();                              
                        getPrice=getTotal[i].getText();
                        noOfNotes=1;
    // this is where the records are saved
         public void readRecords(String moduleCodes,String getPrice,int notes)throws IOException
              price=Double.parseDouble(getPrice);
              String outputFile = "testing.txt";
              FileOutputStream out = new FileOutputStream(outputFile, true);      
         PrintStream fileOutput = new PrintStream(out);
              SalesData[] sales=new SalesData[7];
              for(int i=0;i<sales.length ;i++)
                   sales[i]=new SalesData(moduleCodes,price,notes);
                   fileOutput.println(sales[i].getRecord());
              out.close();

    I suggest writing a method that takes a SalesData[]
    parameter and a filename. Example:
    public void writeRecords(SalesData[] data,
    String filename) throws IOException
    BufferedWriter out = new BufferedWriter(new
    FileWriter(filename, true));
    for (int i = 0; i < data.length; i++)
    out.write(data.getRecord());
    out.newLine();
    out.close();
    And it's good to get in the habit of doing things like closing resources in finally blocks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to pick files from multiple directories via Sender File Adapter?

    Hi guys,
    I have a scenario File to IDOC. The Sender File Adapter has to take all files: .xml from Source directory E://Current/.
    Actually directories are like
    E:/Plant1/Current/
    E:/Plant1/History/
    E:/Plant2/Current/
    E:/Plant2/History/.
    Can I have one Sender File Adapter to pick all *.xml files
    from
    E:/Plant1/Current/ and
    E:/Plant2/Current/  and how can I write it in Source Directory of Communication Channel?
    Or do I have to have a Sender File Adapter for each Plant?
    Any suggestion please?
    Kind regards,
    Danijela Zivanovic

    Hey
    You might wanna have a look at "Additional selection for source file" parameter in sender file adapter.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/singleSenderFileCC4MultipleDirectories
    XI/PI: how to exclude files in a sender File adapter?
    Even though this method works but there are some constraints,please check help.sap.com for constraints.
    Thanx
    Aamir

Maybe you are looking for

  • Content-Disposition inline Not working

    Hi all, I am using Orion application server as Web server. I like to open a file in client side form the server. Which one is known MIME type. I don't want the IE to prompt the user for Save as/ Open from the current location. I am using "inline" arg

  • Can I retrieve photos burned onto DVD (I used iDVD)?

    I lost my hard drive last week and am in the process of rebuilding my photo gallery. In Decemeber, I burned a DVD with all of my desired photos from 2012 using iDVD. In addition to the videos and slideshows that I included in the main menu, I made su

  • Frm-47313 Invalid Query for Hierarchy tree

    Hello. i am trying to create a hierarchy tree with the following query: SELECT 1, level, n.name, null, hn.nde_id FROM cerpt_nodes n, cerpt_hierarchy_nodes hn WHERE n.id = hn.nde_id AND hn.hir_id = 1 CONNECT BY PRIOR hn.nde_id = hn.nde_id_parent_of ST

  • Passing large amount of data between steps

    Hello, in my application, I developed some step types for data acquisition and analysis. I need to pass large arrays (>100000 points) from one step to another. Actually I pass the sequence context, and I use Variants to retrieve data (in the second s

  • Palm Desktop address file problem

    I recently reinstalled Palm Desktop software which is running fine. But when I try to import address book folder which was previously saved, I get an error message telling me it is "not an address book archive file or is corrupt" I have tried to impo