Splitting to multiple files in file adaptor when it's more than 100 records

Hi,
I have a scenario where I'm generating a xml file to the receiver using file adaptor I need to write 100 records per file, if it's more than 100 then I need to write into a different file, to say I need to have 100 records per file.
ABAP Proxy > PI- >File
Any help is really appreciated.
Thanks,
Joe.P

Hi Joe,
What is your source structure and what is your destination structure?
You can go the ABAP proxy route but then your control is not in the integration layer but in the business system.  But if you prefer it, here's some code outlined:
data:
index type i,
lcl_proxy type ref to ZCL_Proxy.
i = 0.
try.
loop at lt_recordset into ls_record.
append ls_record to lt_output.
index = index+1.
if index = 100.
create object lcl_proxy.
lcl_proxy->execute_asynchronous(output = lt_output).
index = 0.
clear lt_output.
endif.
end loop.
if index>0.
create object lcl_proxy.
lcl_proxy->execute_asynchronous(output = lt_output).
endif.
catch CX_ROOT.
endtry.
commit-work.

Similar Messages

  • RFC to XI File -  can NEVER EVER  get more than one record in Output file.

    Hi guys
    This might be related to my other post on  File conversion but whatever I do I just can't seem to get more than one record in the output file
    the payload from R3==> XI seems fine
    for example
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_XI_005_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <IP_CUSTOMER_HEADER>
    - <item>
      <CUSTOMERID>1000001</CUSTOMERID>
      <COMPANY>One-time ship-to</COMPANY>
      <SHORT_NAME>ONE-TIME</SHORT_NAME>
      <STREET />
      <STREET2 />
      <STREET3 />
      <STREET4 />
    ...... more data
    </item>
    then next customer  master data and so on
    - <item>
      <CUSTOMERID>1000005</CUSTOMERID>
      <COMPANY>ddfask</COMPANY>
      <SHORT_NAME>;LK;L</SHORT_NAME>
      <STREET />
      <STREET2 />
      <STREET3 />
      <STREET4/>
    etc etc until
    <HKUNNR>60000</HKUNNR>
      <SALES_REGION />
      </item>
      </IP_CUSTOMER_HEADER>
      </rfc:Z_XI_005_RFC>  
    All I get on the Output target file
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_customer_header xmlns:ns1="http://avenue.com/xi/test">
      <CustomerId>1000001</CustomerId>
      <company>One-time ship-to</company>
      <shortname>ONE-TIME</shortname>
    .... more data
      </ns1:MT_customer_header>
    the <item> and subsequent records all seem to have vanished.
    I must be doing something PARTICULARLY stupid as nobody else ever seems to have this problem --  I've tried almost every possible combination but still to no avail
    The function module is passing a table to XI in the correct structure and the payload seems to be fine so what on earth is broken here !!!,.
    Cheers
    Jimbo

    Thanks everybody -- it's working now
    RFC call was passing data correctly
    function z_xi_005_rfc.
    ""Local interface:
    *"  TABLES
    *"      IP_CUSTOMER_HEADER STRUCTURE  ZAP_CUSTOMER_INFO_2
    endfunction.
    in debug mode table data was fine -- in this instance 3 records were being passed.
    3 errors  in mapping etc fixed (with help from SDN - thanks)
    1)  missing the ITEM level in the Data type (hence mapping)
    2)  needed 0:unbounded in the occurrence
    3)  also mapping Item====>Item was missing (sub fields were ok)
    Points awarded
    final file output ok output now  ok (with 3 fields only for testing)
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_customer_header xmlns:ns1="http://avenue.com/xi/test">
    - <item>
      <Customerid>1000001</Customerid>
      <company>One-time ship-to</company>
      <shortname>ONE-TIME</shortname>
      </item>
    - <item>
      <Customerid>1000005</Customerid>
      <company>ddfask</company>
      <shortname>;LK;L</shortname>
      </item>
    - <item>
      <Customerid>1000010</Customerid>
      <company>One Time Customer Test</company>
      <shortname>SADFIWQEFG</shortname>
      </item>
      </ns1:MT_customer_header>
    Now only the final problem to make file content conversion work.
    Once again thanks --sometimes what seem trivial or simple problems take AGES to fix until someone else gives you a clue --that's why boards like SDN are great value.
    Cheers
    Jimbo

  • Liquify shows jagged image when liquifying at more than 100%

    Hello
    Well, that`s the problem. I recently changed my video card and liquify started working a different way. The video card I have now is ATI RADEON HD 5850 DDR5, 1gb. And the computer I have is:
    QuadCore Intel Core i7 920, 2800 MHz (21 x 133)
    Motherboard: DX58SO (1 PCI, 1 PCI-E x4, 2 PCI-E x16, 4 DDR3 DIMM, Audio, Gigabit LAN, IEEE-1394)
    RAM: 6 GB DDR3-1333 DDR3 SDRAM
    Video Card: ATI Radeon HD 5800 Series (1024 MB)
    Hard Drive: 1TB western digital, 4 partitions, 73gb free space in total and 13gb free on C Drive.
    Windows 7 ultimate 64 bit.
    Photoshop CS6.
    This are the things that happened after installing the new Video Card:
    - I used to work with the PUSH LEFT tool on Brush Pressure 1. Now, to achieve the same effect (the same kind of pressure), I have to use a higher number, like 6 o 7.
    - When liquifying the image at more than 100%, the image gets jagged. I can't do any precise work like this, because I'm not seeing the image correctly, the pixels are shifted, the lines jagged. If I go back to 100% the image looks normal again.
    I already tryied on the Preference panel to change the options of the video card but the problem persists. The way I have it set up now is this:
    I need to do some precise works on small areas of the image so this is quie a problem for me. Any suggestions, ideas?
    THANKS A LOT IN ADVANCE!
    Margaret.

    Could you please post a screenshot to illustrate the issue?
    What is the GPU driver?

  • Why does a mail-merge in MS Publisher split into multiple files when printed as a pdf file?

    Why does a mail-merge in MS Publisher split into multiple files when printed as a pdf file?

    'Cuz that's what mail merges do.  They create multiple documents based on the parent doc and all the names/addresses in your data tables.
    Perhaps if you describe exactly what you're trying to do & why you need PDF, we can point you to relevant tutorials.
    Nancy O.

  • Photoshop crash when I open more than 21 files ".jpg"

    When I open with photoshop cc more than 21 files ".jpg", it crashes, but it doesn't happen when i open RAW files.

    Hi GautamBahl and thank you for the answer.
    1. I use Windows but i can open with photoshop more than 100 RAW files and it doesn't crash
    2. I don't receive any error message
    3. JPG are located on my PC drive

  • Outofmemory while creating a new object of file with size more than 100 MB

    I have created an application which generates a report by getting the data from our archived files (.zip file).By the time, the application is reaching a file with size more than 100 mb, it is running out fo memory while creating the object of that particular file. Can some one help me by tellin if there id way to resolve this issue?
    Thanks in advance

    If you're getting OutOfMemoryError, the simplest thing to try is to give the VM more memory at startup. For Sun's VM, I believe the default is 64 MB. You can increase this by using the -X args that control the heap size. For example: java -Xms128m -Xmx256m ... etc. ... This says start with 128 MB of heap, and allow it to grow up to 256 MB.
    One thing to consider, though, is do you need that much stuff in memory at once? A more intelligent approach might be to unpack the archive to the file system, and then read a file at a time or a line at a time or a whatever at a time is appropriate for the processing you need to do.

  • Can we upload more than 1000 records with BPS file upload pf

    We are using file upload functionality in BPS. Can we use this function to upload around 80,000 records at a time.
    We are unable to upload more than 1000 records because throws a time out error. Is there a setting that we can change to resolve this?

    Hi,
    Can you check the following note  about BW system parameters :
    [https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=192658]
    Check the work Process time set for your BW system
    Is your application web based ?
    Pratyush

  • Converting document files of more than 100 Mb?

    Is it true that you cannot convert document files with more than 100 Mb to PDFs because of that limit on Adobe CreatePDF?
    Is there a way of solving this problem e.g. document files with 285 Mb?

    have you tried compressing the images in the original document?  You can probably compress to 200 dpi if they are only for printing.

  • Flex file upload more than 100 MB

    Hi,
    Is there possibly any method where I can upload file to the server which are more than 100 MB?
    I've gone through the nice piece of code demonstrated at here : http://www.zehnet.de/2009/02/23/flex-fileupload-component/ , where it shown how we can upload files in chunks to the server following FP10, but it also limits to the FP max limit of 100 MB. I've also gone through the discussion followed at: http://forums.adobe.com/thread/494366 , where a process been discussed where FP first reads a defined amount of bytes from a file, loads them and upload them and then go for the rest of the bytes, following openAsync() method for FileMode.READ, but which is only available in AIR. So, I wonder, if there could possibly any way to upload more than of 100 MB files in chunks to the server in browser mode of the Flash Player.
    Thanks for any coming suggestions.
    Rgds,
    Santanu.K

    Long time no see vet. Your problem sucks. I would go to sun site review there articles on JVM tunning. To solve this problem you will need to change the command line arguments to JVM to increase the heap space.
    java -Xms<initial heap size> -Xmx<maximum heap size>
    Defaults are usually: java -Xms32m -Xmx128m
    -Xm*s* - initial java heap size
    -Xm*x* - maximum java heap size
    -Xm*n* - the size of the heap for the young generation
    This is a good article: http://java.sun.com/developer/technicalArticles/Programming/turbo/
    Also, if this solves your problem please check it off so I can get some points. I've been out of the game for awhile.
    Ike Wiggins
    http://bipublisher.blogspot.com

  • Joining 2 related records using PL SQL in Apex - Problems when there are more than 2 related records?

    Hi
    I am combining 2 related records of legacy data together that make up a marriage record.  I am doing this in APEX using a before header process using the following code below which works well when there are only 2 related records which joins the bride and groom record together on screen in apex.  I have appended a field called principle which is set to 'Y' for the groom and 'N' for the bride to this legacy data
    However there are lots of records where in some instances there are 3, 4 , 5, 6 or even 1 record which causes the PL/SQL in APEX to not return the correct data.  The difference in these related columns is that the name of the bride or groom could be different but it is the same person, its just that from the old system if a person had another name or was formally known as they would create another duplicate record for the marriage with the different name, but the book and entry number is the same as this is unique for each couple who get married.
    How can I adapt the script below so that if there are more than 2 records that match the entry and book values then it will display a message or is there a better possible work around?  Cleaning the data would be not an option as there are thousands of rows of where these occurrences occur
    declare 
         cursor c_mar_principle(b_entry in number, b_book in varchar2) 
         is 
              select DISTINCT  id, forename, surname, marriagedate, entry, book,  formername, principle
              from   MARRIAGES mar 
              where  mar.entry   = b_entry
              and    mar.book = b_book
              order by principle desc, id asc; 
         rec c_mar_principle%rowtype;
    begin 
    open c_mar_principle(:p16_entry,:p16_book)  ;
    fetch c_mar_principle into rec;
    :P16_SURNAME_GROOM   := rec.surname; 
    :P16_FORNAME_GROOM   := rec.forename;
                   :P16_ENTRY := rec.entry; 
                   :P16_BOOK :=rec.book;
    :P16_FORMERNAME :=rec.formername;
    :P16_MARRIAGEDATE :=rec.marriagedate;
    :P16_GROOMID  := rec.id;
    fetch c_mar_principle into rec;
    :P16_SURNAME_BRIDE   := rec.surname; 
    :P16_FORNAME_BRIDE   := rec.forename;
                   :P16_ENTRY := rec.entry; 
                   :P16_BOOK :=rec.book;
    :P16_FORMERNAME :=rec.formername;
    :P16_MARRIAGEDATE :=rec.marriagedate;
    :P16_BRIDEID  := rec.id;
    close c_mar_principle;
    end;

    rambo81 wrote:
    True but that answer is not really helping this situation either?
    It's indisputably true, which is more than can be said for the results of querying this data.
    The data is from an old legacy flat file database that has been exported into a relational database.
    It should have been normalized at the time it was imported.
    Without having to redesign the data model what options do I have in changing the PL/SQL to cater for multiple occurances
    In my professional opinion, none. The actual problem is the data model, so that's what should be changed.

  • How can I see more than 100 users when adding users to a node?

    When adding new users through the User Management interface, only the
    first 100 entries are listed. How do I increase the number of entries
    so I can see the next hundred (or more) users? Is this done via the server
    configuration parameter maxsearchresult?
    <P>
    The GUI Add User to Node option was meant for infrequent adds in smaller
    environments. In large deployments (more than 100 user adds at a time), you
    should be using the command line script "unidsattach". See the Administrators
    Guide for more details on the command.
    <p>
    The parameter, maxsearchresult, is meant to limit the number of users that can
    be returned on a search request by the calendar client. For example, if you have
    1000's of calendar users and someone tries to search for all of them, this
    parameter will make sure that the user is not left waiting a long time for
    results.

    In Settings > Notification Center, try turning "on" all the six buttons under "Today View".  Also turn "on" the top two buttons under "Access on Lock Screen".  Doing that should show you "Tomorrow" at the bottom of Noticiation Center.

  • My hard drive has 70.93 GB available, yet when i have more than one internet tab open, i have to force quit google chrome because 'there is no more available application memory'. How can I solve this? I have a 2009 macbook pro running on 10.6.8.

    My hard drive has 70.93 GB available, yet when i have more than one internet tab open, i have to force quit google chrome because 'there is no more available application memory'. How can I solve this? I have a 2009 macbook pro running on 10.6.8. I have tried updating to mavericks through the mac app store but after it downloading for a day i got an error message saying there was a problem with the download. The same thing happens if i try to update itunes or the mac app store. After research, i have also tried repairing disk permissions, but every time they do get repaired the 'repair' button still appears, i'm not sure if it's because it was unable to repair the initial problems or if it just keeps detecting new ones.

    2 GBs is a minimum in which you can do many things, but not concurrently. Be very careful to not install third-party add-ons, limit the number of applications you choose to enter in Login Items, run as few applications concurrently as you demand.
    I would consider adding more RAM to your computer. Your model supports 8 GBs, so I would install that.

  • When I open more than one tab with ikls.ru web site - safari freeze immediately.

    I have a Lion OS and all updates. When I open more than one tab with ikls.ru web site - safari are freezing immediately.

    In safe mode the same problem in Safari. And I couldn't enable the guest account. You can see an attached pic. It's in Russian, but I think it's clear. I took a pic in a safe mode, but in normal mode it's the same.

  • Why can i only print 1 copy in print in CS5 even when I type more than 1?

    Why can i only print 1 copy in print in CS5 even when I type more than 1?

    Sophie Hubble which Adobe software or service is your inquiry in reference too?

  • Short dump when we write more than 4 routines or formulas 4 one source fld

    Hi Experts ,
    We have one source field in a DSO which supplies data to 9 other characteristics present in the cube via formulas. But the system throws a short dump when we write more than 4 routines or formulas.
    Please let us know if there is any restriction in BI 7 as to let only 4 formulas to be written for one source field.
    The below is the description of the short dump
    RUNTIME ERROR : SAP SQL_ARRAY_INSERT_DUPREC
    EXCEPTION : CX_SY_OPEN_SQL_DB
    Help done would be assigned points ...
    Thanks,
    Santosh ...

    Hi,
    thanks for your input
    Rd, rt,re and rs are ranges.
    Select ranges
      RANGES: rd FOR ZMOBILEDATA-COMPID,
              rs FOR ZMOBILEDATA-SUBSCRIBERS,
              rt FOR ZMOBILEDATA-TURNOVER,
              re FOR ZMOBILEDATA-ENTRYDATE.
    thanks'

Maybe you are looking for