File splitting based on 3 parameterrs

Hello experts,
my requirement: i have to split a file based on country, then number of records, and finally based on whether records or historical or inventory.
I have done till splitting using country and number of records, ie, if the user specifies number of records, 50000, it will generate files containing 50k records.
Now the new requirement states that on top country and number of records, i need to split the file bases on historical or inventory, the data will have HIS or INV prefixed for all the records.
The user should have the ability ti split only on HIS or INV, he can specify both, HIS and INV. The logic should split accordingly.
Please assist me in this,
thanks and regards
Abhishek

Hi Abhishek,
A case transform will work in your case where in you specify a match pattern for historical(HIS%%%) and Inventory(INV%%).
You can also use a batch command script to rename the excel/txt files with HIS_%%% or INV_%% once the file has been loaded with data.
Regards
Arun Sasi

Similar Messages

  • File-splitting based on content.

    Hi Experts,
    This question is regarding file-splitting.
    Its a BAI2 file with multiple records in it.
    a)I need to split the file based on an identifier and make those many sub-files ( with header and trailer added to the file )
    b)And can we ensure we have the same name for the files? ( with a count suffixed in the end )
    The forum talks about BPM, Enhanced Interface/Receiver Determination, Message Mapping split etc..
    Which would be the best approach for this?
    Please advise.
    Thank you,
    Rakesh.

    Hi,
    Using Enhanced Interface/Receiver Determination approach is best one.
    1.If your version is 7.1 and above, you can also try using enhanced interface determination. Please go through the below link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1571?QuickLink=index&overridelayout=true
    2.In the Receiver Determination, you need to select " Extended" in the Type of Receeiver determination.
    Illustration of Enhanced Receiver Determination - SP16
    regards,
    ganesh.

  • File Split based on Condition

    Hello
    I have a scenario where I get a file and need to split it into two based on a condition. Is it possible to accomplish this scenario at the file adapter configuration or do I need a mapping for this.
    Sample File 
    ABC1234asdfasfasdfasdfsdfasdfsdfsdfsdfasfsdfasdfsfasdfNewafasfsdfasfasdfasfafsdas
    asfdasdfasfasdfasdf
    asdfasdfadfasdfasfsd asdfsadfa fs
    asdfasdfasfasdfasdfasdfadfsfafasfas
    ABC1234asfdjoawejasdlfasdfasdfjsdfljasfjsfjaslfjasldfjasdlfsdOldfsdfadsfadfsdfasdffasdfasdfads
    asdfasdfsdfa
    asfdasdfasdfasdf
    asdfsfasfsfsad
    fasfasfasdffas
    asdfasfsfa
    asdfasfasfasdfas
    ABC1234asfdjoawejasdlfasdfasdfjsdfljasfjsfjaslfjasldfjasdlfsdNewfsdfadsfsd23424324234234234
    asdfsfasdfasfasfasfasfa
    asdfasfasdfasfasfaasdfa
    in the above content record always start with ABC1234 and it can have multiple sub records and it has a value new or old at column 120-123 in the first line of each record, it can have many sub records but I need to consider ABC1234 as the new record. I need to split the file into two, like one as newdata.txt and other as olddata.txt with new and old records respectively.
    Files after the split should look like this
    newdata.txt
    ABC1234asdfasfasdfasdfsdfasdfsdfsdfsdfasfsdfasdfsfasdfNewafasfsdfasfasdfasfafsdas
    asfdasdfasfasdfasdf
    asdfasdfadfasdfasfsd asdfsadfa fs
    asdfasdfasfasdfasdfasdfadfsfafasfas
    ABC1234asfdjoawejasdlfasdfasdfjsdfljasfjsfjaslfjasldfjasdlfsdNewfsdfadsfsd23424324234234234
    asdfsfasdfasfasfasfasfa
    asdfasfasdfasfasfaasdfa
    olddata.txt
    ABC1234asfdjoawejasdlfasdfasdfjsdfljasfjsfjaslfjasldfjasdlfsdOldfsdfadsfadfsdfasdffasdfasdfads
    asdfasdfsdfa
    asfdasdfasdfasdf
    asdfsfasfsfsad
    fasfasfasdffas
    asdfasfsfa
    asdfasfasfasdfas
    I appreciate if any one can help me with this.
    Thanks in advance

    Hi,
    as stefan pointed already you can't do this using standard adapter functionality,
    you can do it in mapping easily,convert below code in to UDF it will work.
    String test = "ABCasdasasasABCadsfsddgfgABCggdgdgdgdgABC34343";
    myString =test.split("ABC");
    for(int i=0;i<=myString.length;i++)
    System.out.println("MY STRING " + myString<i>);
    Regards,
    Raj

  • XML File splitting in PI

    Hi all,
    We have a requirement that the receiving application can accept files only of size 2MB. So this is a limitation from the receiving application
    The source system is SAP ECC system and the receiving application is a legacy application.
    Technically it is a ABAP Proxy to File scenario. Receiving application can accept files only in XML format.
    SAP ABAP Proxy code is written in such a way to read all the records in a SAP table and the full table load is sent as an proxy xml message to PI, PI has to split this  full xml file  in to chunks based on some condition and then transfer it to receiving legacy application.
    Can we achieve file splitting in PI for XML files based on no.of records or size.
    Please share your inputs/pointers to provide the best solution to this requirement.
    regards,
    Younus

    Hi,
    Yes this can be done by the amount of records you send through at a time.
    So lets there is 10000 records. You might only send 200 at a time and that will keep it under the 2mb limitation.
    This is a simple if function on your nodes. Please see the links below that would help you.
    Split source message into multiple target messages
    Defining Message Splits - SAP NetWeaver Process Integration - SAP Library
    Configuring Mapping-Based Message Splits - Integration Directory - SAP Library
    Split mapping created no messages SAP PI 7.11
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30ea2fdf-f047-2a10-d3a2-955a634bde6b?overridelayout=t…
    Regards,
    Jannus Botha

  • Another case of file splitting

    Hello
    I need your help to find the easier way to develop this kind of interface :
    My source file have a variable number of records.
    I would like to create as target datastores as much files as sets of a kixed number of records :
    For example : This fixed number of records is 10 and my source datastore has 83 records :
    I would like to obtain
    9 files : the first with the first 10 records, the second with de 10 next and so on untill the last that will contain the last 3 records
    I guess I have to use a sequence ???

    Hi,
    Yea, you need to use sequence to do this task,
    Better to create the temp table for source file use sequence here(while uploading source file to temp table).From the table you can split it as mush file required based on number of records
    Thanks
    Madha

  • How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?

    Greetings all,
    I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
    We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
    The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
    For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
    There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
    I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
    PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
    var myPresets = app.pdfExportPresets.everyItem().name;
    myPresets.unshift("- Select Preset -");
    var myWin = new Window('dialog', 'PDF Export Presets');
    myWin.orientation = 'row';
    with(myWin){
        myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
        myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
        myWin.myPDFExport.selection = 0;
        myWin.btnOK = add('button', undefined, 'OK');
    myWin.center();
    var myWindow = myWin.show();
    if(myWindow == true && myWin.myPDFExport.selection.index != 0){
        var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
        myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
        if(myFile != null){
            app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
        }else{
            alert("No File selected");
    }else{
        alert("No PDF Preset selected");
    So far my code does the following:
    1) Runs the Multi-Page PDF Import Script
    2) Runs PDF Export Script Above
    3) Toggles the Template
    4) Runs #2 Again
    5) Deletes the imported PDF and all pages and toggles template again.
    It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
    Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!

    If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
    Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
    It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.

  • File Based logging: Control file name based on calling service

    In the file logging, I need to change the "Prefix" and "Suffix" that I can type in, from page "FILE Transport Configuration" while creating
    business service with transfort: File. I need to be able to supply these values for the file name from proxy service activity.
    I am creating as logging proxy service which will be called from all the other proxy services. I am planning to use logging to File System based on
    BS for achieving this. I need to be able to create a new file with name that corresponds to the calling service. How can I achieve this?
    Also this service should be able to turn logging on or off based on the calling service. I should be able to turn off the logging completely or
    turn off the logging only for few services.
    What is the best way to achieve this?

    HI
    That means your file name would be decided at run time . so u can use adapter specific mesage attributes in ur communication channel
    please refer tto the same here
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    Dynamic File Name Part 2
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

  • When saving a file in [.jpg] format, i am asked to choose a quality from 1 to 100. what changes in the file created based on the quality parameter chosen?

    when saving a file in [.jpg] format, i am asked to choose a quality from 1 to 100. what changes in the file created based on the quality parameter chosen?. i would like to know what changes, so in the future i can set my camera to a setting that will give me the highest quality to begin with,allowing me to make crops and still preserve the quality.
    thank you
    dovid

    It's the level of compression. Lower number, more aggressive compression, more visual artifacts.
    Aside from that you should never use jpeg as a working format. The compression is destructive and cumulative, and the file deteriorates every time you resave it.
    Use TIFF or PSD, and if you need jpeg save out a copy as a single final step.

  • File Split to Multiple IDocs

    Hi all
    I have a problem with splitting an flat file into multiple IDocs. My attempt was to do this without BPM as mentioned in some similar posts, but I am not sure about how to get the file splitted. The flat file has multiple orders with multiple line items and each order should create a single IDoc of type ORDERS.ORDERS05. I have imported the IDoc as external definition with IDOC being 0...unbounded. My input file looks as following:
    ORDER1|LINE1|SOMETHING
    ORDER1|LINE2|SOMETHING
    ORDER1|LINE3|SOMETHING
    ORDER2|LINE1|SOMETHING
    ORDER2|LINE2|SOMETHING
    I have been getting this into the appropriate PI XML structure like:
    MT_Order
    ...OrderRecordSet  (0...unbounded)
    ......OrderRecord    (1...1)
    How do I get this into multiple IDocs for each ORDERx with its n LINE items? I was thinking of SplitByValue with value change on PO, but this doesn't seem to work.
    Any feedback appreciated. Thanks,
    Daniel

    Dear Daniel,
    You can achieve the required by using MultiMapping without BPM. Pls refer to the following blog for the same,
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    Apart from the above, if allowd you can changed the IDOC occurrence and change the XSD of the IDOC and you can achieve the requirement with the simple message mapping.
    Thanks
    Prasanna

  • Creating Files Dynamically based on Condition

    Hi Experts,
    I want to create a scenario in which I want to have N number of target files based on some condition.
    Suppose I have following Source structure .
    <ns0:MT_Employee_Src xmlns:ns0="urn://FileToFile_ERD">
       <Details>
          <EmpId>1</EmpId>
          <Name>Rabi</Name>
          <Designation>ABAP</Designation>
       </Details>
          <EmpId>4</EmpId>
          <Name>Satya</Name>
          <Designation>ABAP</Designation>
       </Details>
    </ns0:MT_Employee_Src>
    My requirement is I want to have 2 different target files based on EmpId.
    And this should be dynamic that means N number of EmpId in my source will create N number of files.
    Can anyone help me to solve this?
    Any kind of suggestion will be appreciated.
    Thanks
    Rabi

    Hi All,
    As my requirement was to create N files dynamically based on some condition so I first used 1:N multimapping without BPM.
    Then I followed RP's steps.
    Follow those steps
    1) in the message Mapping go to Signature T..Outbounded.
    2)later go back to main tab . you shoud create a mapping like this:
    3)<EmpId>--> change the context to MT_Employee_Src. to do that press right button on the field and go to context menu option.
    map this field to the proper header target structure E.X: MT_Employee_Tgt
    4) doing this you will create as many target files as <EmpId> you receive.
    5) map the rest of the fields
    This is great.And  this helped me a lot and finally gave solution.
    I want to share one thing that I faced.
    when you are doing 1:N multi-mapping then you have to change the occurrence of target .
    Then your source and target structure will be changed .If you are taking the source schema from mapping then remove the extra tags those got generated due to multi mapping such as
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    - <ns0:Message1>
    </ns0:Message1>
      </ns0:Messages>
    And then use the file and it will work fine.
    Thanks
    Rabi

  • Idoc to File Split Scenario..

    HI Experts,
    My scenario is Idoc to File split scenario..
    Idoc will be triggered from the SAP ECC system and at the target side we need to drop two text files at the ftp directory.
    so Idoc data needs to be splitted and to be dropped in two differient files in the target FTP directory..
    So can any one suggest how to go ahead with the scenario..
    Thanks,
    --Kishore.

    Hi,
    In the idoc, some of the data will go to onefile and some goes to other files..
    the structures of the two files are differient..
    There is no condinal spliting here every idoc contents should be mapped according to the requirement and dropped as two files.. at the target end.
    for ex:
    Idoc
    field1
    fileld2
    field3
    field4
    in the out put side
    file1 should contain
    field1
    field3
    field4
    file2 should contain
    field1
    field2
    fileld3
    This is what the requirement, if you are not getting reply back with your queries..
    Thanks,
    --Kishore..

  • Merge files...... pick file dynamically Based on your content

    Hi All,
    In my current scenario I have 2 dependent sources (Proxy and File system) from which data is being sent to a common target service. The sources are dependent on Proxy/ECC to File System. Please let me know how I need to pick the file from File system because lot of files are there in File System. Based on my ECC/Proxy message details on field of ABN, according ABN number I need to be pick the file from the File system but I have lot of files in File system. Please let me know how to pick multiple files from one correct file based on my first file message.
    After that picking the files I need merge the two messages and send to target file system.
    Using fork I can merge files, no issues. But here problem to pick file dynamically Based on content .
    Please provide your input......
    Regards,
    Ramesh

    Hi Ramesh Sir,
    You can go for JAVA Type Message Mapping.
    ECC - >  JAVA BASED MESSAGE MAPPING ( HERE WE WILL PERFORM FILE LOOKUP) - > RECEIVER .
    Is This approach sounds fisible to you ?
    Please provide Sender DataType XML / Receiver DataType XML + any 1 csv file in which lookup has to perform.
    and this approach is only possible , if your Flat file is on FTP Server which is on the same network.
    Regards
    Prabhat Sharma.

  • File name based routing

    Hello All,
    Here I have a scenario where based on the source file name PI should route it to corresponding Business system.
    There is no IR part as it is a pass through Interface. Instead of creating multiple channels can I check the condition(file name based condition) at Receiver determination level in ID part?
    Thanks,
    Regards,
    Moorthy

    Hello,
    There is no IR part as it is a pass through Interface. Instead of creating multiple channels can I check the condition(file name based condition) at Receiver determination level in ID part?
    Yes, you can use context objects and then select fileName, I'm not sure if you'll be able to use the extended xpath conditions. Probably that approach is limited to the approximately equals, equals, not equals condition.
    Corrections are welcome
    Hope this helps,
    Mark

  • Invoice split based on Partner function

    We have a requirement where we want the invoice to be split based on the partner function. Here are the details.
    1. We bill the builder(Partner function PY) by default. Sometimes we want part of the amount to be billed to buyer(Partner function ZA). So if the the sales order has both the partner functions(PY and ZA), I would like the invoice to be split into 2 where one should go to builder(PY) and the other to buyer(ZA).
    2. I tried with the split routine given in data transfer for billing documents. The routine is triggered just once(for a sales order) as it is defined at the header level hence I am unable to split the invoice for that order.
    Is there any other way to split the invoice?
    Thanks in advance
    Vamsi

    what kind of code  have u written to this ? please paste here,
    Regards
    peram

  • Document splitting-based on profit center

    Hi Experts,
    While posting JV (f-02) document, document was not splitting based on profit center.
    Dr 520499.......9100  (Profit center 100)
    Dr 520475.......7888 ( Profit center 200)
         To. 199000...... ...    16988
    When I am trying to post the above entry getting error " Balancing profit center error, profit center is not filled in line item 3"
    I hope I done configuration is current.
    Please provide the solution on top priority.
    Regards,
    Mallesh
    Moderator: Please, search before posting

    Hi,
    If you have activated document spliting and done the need ful settings, then entry will be posted in 2 views one is normal etry view and another one is genereal ledger view.
    Entry view;
                                              Profit center
    vendor                     cr 100
    Printing& stationary dr 50     200001
    Labour charges       dr 50     200002
    GL View
    vendor      cr     50      200001
    vendor      cr     50      200002
    prin & stat   dr  50      200001
    Labour charges dr 50  200002
    So plz just check your settings related to document spliting and get back.
    Regards
    T N R

Maybe you are looking for

  • RZ20 PerformanceAttributes not saved

    Hi everyone, I have a SolMan system being used for monitoring file and processes. The problem is when i change the threshold values (in CCMS : performance attribute) of an individual MTE, these changes are not saved. When i restart the server where t

  • VCAP5-DCD Experience

    Hello, Last week i passed my VDCD550 exam and got VCAP5-DCD certification, so i guess i have some experience to share. Last few years i worked at PM/management positions at various integrators but recently decided to go more technical again. So i upd

  • Open Item & budget Carryforward.

    Dear All! we are little bit confused regarding the closing procedure of  Funds Managment ( BCS). I'm writing the following scenerio that may I able to understant every one! I entered the Budget $100 and Released $ 40. When I execute the transaction F

  • Issue combining CC sphere with Shatter 3D text

    Hi to all, I created a simple 3D text with the shatter effect extrusion in a composition.Later,I used the cc sphere to wrap it around a sphere. But when I use the CC sphere, it looses the 3D characteristic of the Text and the text becomes flat over t

  • Error:The table 'table1' refers to an invalid DataSetName 'dataList'

    I am getting this error The table 'table1' refers to an invalid DataSetName 'dataList'  I check the data set name and it is spelled correct  what might be the reason for this error