Skip to Content
author's profile photo Former Member
Former Member

Split download file into multiple files

I want to split my internal table into multiple files when downloading. The split will be determined by contents of a specific field. The number of files to download can only be determined at runtime.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2006 at 03:50 AM

    Hi,

    You can split the data and download the data in multiple files based on the specific field value...

    THanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2006 at 03:53 AM

    try this...

    *declare itab1 same as itab

    data : filename(25).

    loop at itab.

    <b> move-corresponding itab to itab1.

    append itab1.</b>

    at end of BUKRS.

    *use GUI_DOWNLOD FM here

    *pass itab1 every time here

    *change the filename everytime

    concatenate 'Company_' itab-bukrs into filename.

    <b> refresh itab1.</b>

    endat.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2006 at 04:02 AM

    chk this thread with the same question and same answer given by Rameshbabu Chirumamilla

    split-download-file-into-multiple-files

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 05:13 AM

    Hi all,

    my requirement is i want to split records into multiple files not basing on the field condition but basing on the arithmetic operations..

    like I have 12 records and separation no is given that is 5.Now i have to divide the records by 12 so that first 5 records go into first flatfile and next 5 to second flat file and remaining 2 records to 3rd flatfile.

    Is it possible.Please help me solve this issue

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I think you just need a counter ...

      You create a 2nd itab for the file creation (collector).

      You loop over the main itab and based on your rule and the sy-tabix you fill the 2nd itab, write it to the file (work station or server), refresh collector itab and continue the loop.

      Write process, file creation depends on used technology.

      Example solution:

      ****************

      c_constant type i value '5'.

      split type i.

      v_count type i.

      v_file_count.

      describe itab1 lines to v_count.

      loop at itab1 into wa.

      split = split + 1.

      move wa into wa_collector.

      append wa_collector to itab2.

      If split EQ c_constant

      or sy-tabix EQ v_count.

      v_file_count = v_file_count + 1.

      < open file / export however you already planed to do it>

      < Filename will be dynamic on counter and other variable choice>

      clear split.

      refresh itab2.

      endif.

      enloop.

      ****************

      But that was a very rough an simple one.

      When I would write it into the program I would change the fixed parts. And you need to check from the example if the check agains the counted entries is sufficient to write the last two entries in the thrid file.

      That can be done more dynamic, based on input fields, arithmetic rules, counting of entries etc. check the mod command ect. I have done things like that often with other purpose.

      BR,

      P.S.: The more I check the example above, the more I think you should take it really only as an sample idea. I would indeed make it nicer with less counters etc. and some assign ...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.