Download  350MB of data from Application Server to Presentation server

i want to Download  350MB(Around 2.5Million record of Table BSEG) of data from Application Server to Presentation server..
i have tried with the transaction CG3Y and program using open dataset,read dataset,close dataset,ws_download...but went in vain,,,ended with TIMEOUT ERROR..will OPEN DATASET 'path' FOR OUTPUT FILTER 'Compress'  be helpful
..please help me ..its urgent..

you can do the FTP with Unix commands..
initially connect to the application server  by using command
FTP <app server ip>,then it willl ask for username and password... after successful connection you  can use the following commnads to transfer file
lcd <destination path name>(set the dest path)
cd <source path>(set the sorce path),
get <filename to be transfererd>( do the transfer)....
You can do same with ABAP code also, for this you need to use some function modules like..
FTP_CONNECT ( to establish the connection)
FTP_COMMAND ( to execute the commands like cd, lcd get,put)
finally FTP_DISCONNECT to close the open connection...
for further details refer standard program RSFTP002,RSFTP003....
   reward points if helpful...

Similar Messages

  • Dump while downloading data from Application Server File in 4.6 system

    Hi,
    When we are trying to upload data from Application Server to internal table using dataset statements, it is resulting in a dump. System we are using is 4.6c.
    When we faced similar kind of issue in ECC version, we have used the statement, Ignoring Conversion Errors.
    Please let me know how to handle this situation in 4.6 System.
    Thanks for your inputs.
    Regards,
    Phani

    Hi All,
    I am sorry. My question was wrong. It should be while uploading data from internal table to application server, if there are any special characters, it is going to dump.
    I will let you know the dump details and code at the earliesst.
    Sorry and Thanks again for your prompt response.
    Regards,
    Phani.

  • How to bring the data from application server to presentation server

    hi,
    i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this  topic.folowing is the code .
    *& Report  ZPFA_HIER_LOAD
    REPORT  ZFPA_HIER_LOAD.
    *---- Declaration of Oracle connectioN
    DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
    DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
    DATA : mfilename type string.
    data: begin of matab1 occurs 0,
          MFL1(9) TYPE C,
          MFL2(5) TYPE C,
          MFL3(9) TYPE C,
          MFL4(2) TYPE C,
          MFL5(8) TYPE C  ,
         end of matab1 .
    data: setid(8) type c.
    data: begin of source occurs 0,
          setid(8) type c,
          end of source.
    *PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
    *PARAMETERS : m_bsenty(8). " type c obligatory.
    *mfilename = P_PFILE.
    EXEC SQL.
      SET CONNECTION :con_name
    ENDEXEC.
    EXEC SQL.
      CONNECT TO :con_name
    ENDEXEC.
    EXEC SQL PERFORMING get_source.
      SELECT set_id FROM UNIT_SET INTO
      :setid
      ORDER BY SET_ID
    ENDEXEC.
    start-of-selection.
    LOOP AT SOURCE.
      REFRESH matab1. CLEAR matab1.
      EXEC SQL PERFORMING evaluate.
    SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
    :MFL5
    where set_id = :SOURCE-SETID ORDER BY MEM_ID
      ENDEXEC.
      if SOURCE-SETID = '80000000'.
       mfilename = '/tmp/aesorg'.
      elseif SOURCE-SETID = '80000006'.
       mfilename = '/tmp/Consolidation_Manager'.
      elseif SOURCE-SETID = '80000010'.
       mfilename = '/tmp/10org'.
      elseif SOURCE-SETID = '80000012'.
       mfilename = '/tmp/20org'.
      elseif SOURCE-SETID = '80000018'.
       mfilename = '/tmp/30org'.
      elseif SOURCE-SETID = '80000025'.
       mfilename = '/tmp/40org'.
      Endif.
      mfilename = '/usr/test.dat'.
    ************************This was i tried***********************
      open dataset mfilename for output in text mode encoding default." IN
    *TEXT MODE ENCODING DEFAULT.
    if sy-subrc <> 0.
    exit.
    endif.
    close dataset mfilename.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         FILENAME         = MFILENAME
         FILETYPE         = 'ASC'
       TABLES
         data_tab         = matab1
       EXCEPTIONS
         file_write_error = 1
         invalid_type     = 2
         no_authority     = 3
         unknown_error    = 4
         OTHERS           = 10.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
      clear matab1.
    ENDLOOP.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
    close dataset mfilename.
         MFL5 = '0'.
       CLEAR MFL5.
    FORM evaluate.
      if MFL5 = -1.
        MFL5 = ''.
      ENDIF.
      concatenate MFL1 ','   into MFL1.
      concatenate MFL1 ','   into MFL3.
      matab1-MFL1 = MFL1.
      matab1-MFL2 = 'ZBUE,'.
      matab1-MFL3 = MFL3.
      matab1-MFL4 = ' ,'.
      matab1-MFL5 = MFL5.
      append matab1 .
      CLEAR MFL1.
      CLEAR MFL2.
      CLEAR MFL3.
      CLEAR MFL4.
      CLEAR MFL5.
    ENDFORM.
                     "evaluate
    *&      Form  GET_SOURCE
          text
    FORM GET_SOURCE.
      source-setid = setid.
      append source.
      clear source.
    ENDFORM.                    "GET_SOURCE

    Hi Rammohan,
    You cannot use OPEN DATASET to transfer data from application server to presentation server.
    You can do the following :
    <b>Do 1st point in BACKGROUND</b>
    1. Read the data file from application server into an internal table using OPEN DATASET
    <b>Do 2nd point in Foreground</b>
    2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
    You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
    Best regards,
    Prashant

  • Downloading file from application server to presentation server

    Hi,
          We have a requirment to download file from application server to presentation server.  The problem is while down loading, some of the filds showing some junk values. Instead of that junk values we have some Russian texts there.  These Russian texts only coming as junk all other data is correct.  The file in the appplication server is in .dbf format. We are downloading using WS_DOWNLOAD. file type is BIN and code page we didn't specified.
    Thanks in Advance
    Jijeesh.P.G
    Message was edited by: Jijeesh.P.G
            Jijeesh P G

    hi jijeesh,
       Welcome to SDN.
    u can use to download file from application server to presentation server using the t/c CG3Y. in that it will ask the source file path and the target file path.
    if u want to find the source file path in the application server, u can use the transaction AL11 to find that one.
    Regards....
    Arun.
    Reward points if useful.

  • How to upload data from application server

    Hi,
    please help me out in uploading the data from application server which is a tab delemited file into an internal table.
    Thanks
    kumar

    hi,
    Use this sample code as an example.
    table declaration
    tables: mara.
    *data declaration
    data: begin of it_lfa1 occurs 0,
    vendor like lfa1-lifnr,
    land1 like lfa1-land1,
    name1 like lfa1-name1,
    ort01 like lfa1-ort01,
    end of it_lfa1.
    selection screen
    selection-screen: begin of block b1 with frame.
    parameters: p_file type rlgrap-filename obligatory.
    selection-screen: end of block b1.
    at selection screen
    at selection-screen on value-request for p_file.
    *& start-of-selection
    start-of-selection.
    perform transfer_file using p_file.
    perform write.
    *& Form transfer_file
    text
    -->P_P_FILE text
    form transfer_file using p_p_file.
    data: l_message(30) type c.
    ***opening dataset for reading
    open dataset p_p_file for input in text mode encoding default message
    l_message.
    if sy-subrc ne 0.
    message i001(zerr2) with p_p_file.
    endif.
    *******transferring data from file to app server.
    do.
    read dataset p_p_file into it_lfa1.
    if sy-subrc = 0.
    append it_lfa1.
    clear it_lfa1.
    else.
    exit.
    endif.
    enddo.
    *******closing dataset
    close dataset p_p_file.
    endform. " transfer_file
    *& Form write
    text
    --> p1 text
    <-- p2 text
    form write .
    loop at it_lfa1.
    write:/ it_lfa1-vendor,
    it_lfa1-land1,
    it_lfa1-name1,
    it_lfa1-ort01.
    endloop.
    endform. " write
    Thanks
    Aneesh.

  • How to get data from application server

    hi experts,
    when i load data from application server(.csv file) to ODS, data all goes one column.
    in infopackage exterdata tabstrip  i have given the below values.
    escape sign is "
    data separator is ,
    separator for thousands is ,
    my sample data:
    "1010000";"A410";"03.2008";"113.5704531"
    "1010000";"A410";"04.2008";"93.1146410"
    any ideas..
    Siri

    Hi Siri,
    You should look in the T.Code :RSCUSTV1
    BW:Settings for Flat File
    Thousand separator 
    Dec. point separator 
    Field separator         
    Field delimiter 
    Then you can use the Same Characterstics while creating the Flat file & also passing the same in Info Package
    This will resolve your issue
    Regards
    Hari

  • Error while loading data from application server

    Hi all,
    Am facing a problem while loading data from application server.
    The error i get is ....
    *" The argument ' Rental/Lease ' cannot be interpreted as a number while assigning character to application structure*.
    'Rental/Lease' is a value for a character infoobject length 30. I checked for the sequence of fields in data source and the sequnce of values am receiving in application server and the sequence match.
    when i copy these values into a CSV onto a desktop and load,load is successful.
    Please let me know your views.
    Thanks&Regards,
    Praveen

    It looks like the system is trying to convert Rental/Lease to a number format.   Is the info object type CHAR or NUMC or ???  I would look there.
    Also, make  sure / is in RSKC.
    Brian

  • What is the easiest way to export all tables data from Oracle to MS SQL Server?

    Hello MS,
    I would like to export all tables from Oracle 11.2 to MS SQL Server 2012 R1.
    Using the tool "Microsoft SQL Server Migration Assistant v6.0 for Oracle" did not work for me because there are too many warnings and errors regarding the schema creation (MS cannot know it because they are not the schema designer). My idea is
    to leave/skip the schema creation to the application designer/supplier and instead concentrate on the Oracle data export and MS SQL data import.
    What is the easiest way to export all tables data from Oracle to MS SQL Server quickly?
    Is it:
    - the „MS SQL Import and Export Data“ Tool
    - the “MS SQL Integration Services” Tool
    - not Oracle dump *.dmp format because it is a propritery binary format
    - flat file *.csv (delimited format)
    Thanks!

    Hi lingodingo,
    If you want to directly export all tables from Oracle database to SQL Server, I suggest you use SQL Server Import and Export Wizard. Because you just need to follow the wizard with GUI, this is the easiest way.
    If you want to make some modification for the tables‘ data before loading to SQL Server, I suggest you use SQL Server Integration Services package. For more details, please refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/38b2bed2-9d4e-48d4-a33f-1d9eed1c062d/flat-file-to-sql-server?forum=sqldatamining
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to transfer file from application server to presentation server in background?

    Hi Experts,
    How to transfer file from application server to presentation server in background?
    Thanks in advance
    Namita

    Thanks Raman and Challa,
    We want to move file from application server to Shared folder, not on local machine. We checked FM which you guys have provided but those are not able to read file from application server.
    We need this program to run in background so that we can use this in daily process chain.
    Appreciate your inputs on this.
    Thanks,
    Namita

  • Load Data from a table on one server's database, to the same table structure in multiple server databases

    Hi,
    I have a situation where i have to load data from one server/database table to multiple servers/databases.
    Example:
    I need to load data from dbo.TABLE_A  (on Server: Server_A & Database: Database_A)  to the same table on the list of server databases like
    Server: Server_B , Database: Database_B
    Server: Server_C , Database: Database_C
    Server: Server_D , Database: Database_D
    Server: Server_E , Database: Database_E
    Server: Server_F , Database: Database_F
    Server: Server_G , Database: Database_G
    Server: Server_H , Database: Database_H
    so on and so forth on 250 such server database combinations.
    The table structure is the same on all the servers.
    If i make the source or destination dynamic, it throws an error while mapping ?
    I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
    Please suggest on how to load data from one source to multiple server/databases.
    Thank you.

    I just need to transfer one table's data. its like i have to use a query to pick data for
    the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
    to append the new records.

  • Send POST data from custom POD to PHP server

    Hi all,
    I tried to send data from custom POD to PHP server with POST method. I used HTTPService component and URLLoader, but nothing happend. All attempts failed, HTTPService return "fault" and URLLoader return "0" that means I can't send data to the server.
    I'm googling around during few hours... please give me some advice, how I can send data from custom POD to PHP server.
    Thanks

    Figured it out, hope it will help someone
    A bit tricky but it works fine, now I can send and retrive data from PHP server.
    Add .htacces file in folder where deployed PHP request handler and modify it, see below:
    RewriteEngine on
    RewriteBase /foldername
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\?*$ filename.php?_route_=$1 [L,QSA]
    Thanks

  • Retrieving data from an ArrayList and presenting them in a JSP

    Dear Fellow Java Developers:
    I am developing a catalogue site that would give the user the option of viewing items on a JSP page. The thing is, a user may request to view a certain item of which there are several varieties, for example "shirts". There may be 20 different varieties, and the catalogue page would present the 20 different shirts on the page. However, I want to give the user the option of either viewing all the shirts on a single page, or view a certain number at a time, and view the other shirts on a second or third JSP page.
    See the following link as an example:
    http://www.eddiebauer.com/eb/cat_default.asp?nv=2|21472|9&tid=&c=&sc=&cm_cg=&lp=n2f
    I am able to retrieve the data from the database, and present all of them on a JSP, however I am not sure how to implement the functionality so that they can be viewed a certain number at a time. So if I want to present say 12 items on a page and the database resultset brings back 30 items, I should be able to present the first 12 items on page1, the next 12 items on page2, and the remaining 6 items on page3. How would I do this? Below is my scriplet code that I use to retrieve information from the ArrayList that I retrieve from my database and present them in their entirety on a single JSP page:
    <table>
    <tr>
    <%String product=request.getParameter("item");
    ArrayList list=aBean.getCatalogueData(product);
    int j=0, n=2;
    for(Iterator i=list.iterator(); i.hasNext(); j++){
    if(j>n){
    out.print("</tr><tr>");
    j=0;
    Integer id=(Integer)i.next();
    String name=(String)i.next();
    String productURL=(String)i.next();
    out.print("a bunch of html with the above variables embedded inside")
    %>
    </tr>
    </table>
    where aBean is an instace of a JavaBean that retrieves the data from the Database.
    I have two ideas, because each iteration of the for loop represents one row from the database, I was thinking of introducing another int variable k that would be used to count all the iterations in the for loop, thus knowing the exact number. Once we had that value, we would then be able to determine if it was greater than or less than or equal to the maximum number of items we wanted to present on the JSP page( in this case 12). Once we had that value would then pass that value along to the next page and the for loop in each subsequent JSP page would continue from where the previous JSP page left off. The other option, would be to create a new ArrayList for each JSP page, where each JSP page would have an ArrayList that held all the items that it would present and that was it. Which approach is best? And more importantly, how would I implement it?
    Just wondering.
    Thanks in advance to all that reply.
    Sincerely;
    Fayyaz

    -You said to pass two parameters in the request,
    "start", and "count". The initial values for "start"
    would be zero, and the inital value for "count" would
    be the number of rows in the resultSet from the
    database, correct?Correct.
    -I am a little fuzzy about the following block of code
    you gave:
    //Set start and count for next page
    start += count; // If less than count left in array, send the number left to next next page
    count = ((start*3)+(count*3) < list.size()) ? (count) : ((list.size() - (start*3))/3)
    Could you explain the above block of code a little
    further please?Okay, first, I was using the ternary operators (boolean) ? val_if_true : val_if_false;
    This works like an if() else ; statement, where the expression before the ? represents the condition of the if statement, the result of the expression directly after the ? is returned if the condition is true, and the expression after the : is returned if the condition is false. These two statments below, one using the ternary ? : operators, and the other an if/else, do the same thing:
    count = ((start*3)+(count*3) < list.size()) ? (count) : ((list.size() - (start*3))/3);
    if ((start*3)+(count*3) < list.size()) count = count;
    else count = ((list.size() - (start*3))/3);Now, why all the multiplying by 3s? Because you store three values in your list for each product, 1) the product ID, 2) the product Name, and 3) the product URL. So to look at the third item, we need to be looking at the 9th,10th, and 11th values in the list.
    So I want to avoid an ArrayIndexOutOfBounds error from occuring if I try to access the List by an index greater than the size of the list. Since I am working with product numbers, and not the number of items stored in the list, I need to multiply by three, both the start and count, to make sure their sum does not exceed the value stored in the list. I test this with ((start*3)+(count*3) < list.size()) ?. It could have been done like: ((start + count) * 3 < list.size()) ?.
    So if this is true, the next page can begin looking through the list at the correct start position and find the number of items we want to display without overstepping the end of the list. So we can leave count the way it is.
    If this is false, then we want to change count so we will only traverse the number of products that are left in the list. To do this, we subtract where the next page is going to start looking in the list (start*3) from the total size of the list, and devide that by 3, to get the number of products left (which will be less then count. To do this, I used: ((list.size() - (start*3))/3), but I could have used: ((list.size()/3) - start).
    Does this explain it enough? I don't think I used the best math in the original post, and the line might be better written as:
    count = ((size + count)*3 < list.size()) ? (count) : ((list.size()/3) - start);All this math would be unnecessary if you made a ProductBean that stored the three values in it.
    >
    - You have the following code snippet:
    //Get the string to display this same JSP, but with new start and count
    String nextDisplayURL = encodeRedirectURL("thispage.jsp?start=" + start + "&count=" + count + "&item=" + product);
    %>
    <a href="<%=nextDisplayURL%>">Next Page</a>
    How would you do a previous page URL? Also, I need to
    place the "previous", "next" and the different page
    number values at the top of the JSP page, as in the
    following url:
    http://www.eddiebauer.com/eb/cat_default.asp?nv=2|21472
    9&tid=&c=&sc=&cm_cg=&lp=n2f
    How do I do this? I figure this might be a problem
    since I am processing the code in the middle of the
    page, and then I need to have these variables right at
    the top. Any suggestions?One way is to make new variable names, 'nextStart', 'previousStart', 'nextCount', 'previousCount'.
    Calculate these at the top, based on start and count, but leave the ints you use for start and count unchanged. You may want to store the count in the session rather than pass it along, if this is the case. Then you just worry about the start, or page number (start would be (page number - 1) * count. This would be better because the count for the last page will be less than the count on other pages, If we put the count in session we will remember that for previous pages...
    I think with the details I provided in this and previous post, you should be able to write the necessary code.
    >
    Thanks once again for all of your help, I really do
    appreciate the time and effort.
    Take care.
    Sincerely;
    Fayyaz

  • Object level security will be done by bi-server or presentation server

    hi all
    object level security will be done by bi-server or presentation server?
    r both will be done by bi-server?
    Tnks

    Hi,
    object level security will be done by bi-server or presentation server?It would be maintained by both the servers,as the end user sends a request that would be sent to presentation server and then in turn to BI server....while in this processboth checks is there any security implemented on it.
    Ya in simple words authorization and authentication.
    Hope it helps you.
    By,
    KK

  • Problem while downloading data from Application server.

    Hi
    I have create a file on the application server.
    When i tried to download the file from application server into Excel file , all the fields in the file appear in the same column.
    How can place the fields separately in different columns in the Excel.
    Thanks
    Subha
    Edited by: subhacp on Sep 5, 2011 8:32 AM

    Hi,
    Try to use below function module where you need not to do anything new, just give path of the directory where you want to store on your workstation in the parameter  I_FILE_FRONT_END  and give path of your application server from where you want to pick file which is in .XLS format in the FM parameter I_FILE_APPL  .
    It will simply copy the file from Apllication server to your workstation in the same format and with the same characters.
    CALL FUNCTION 'C13Z_FILE_DOWNLOAD_BINARY'
      EXPORTING
        I_FILE_FRONT_END          = pr_down
        I_FILE_APPL               = l_w_file
        I_FILE_OVERWRITE          = 'X'
    * IMPORTING
    *   E_FLG_OPEN_ERROR          =
    *   E_OS_MESSAGE              =
    EXCEPTIONS
       FE_FILE_OPEN_ERROR        = 1
       FE_FILE_EXISTS            = 2
       FE_FILE_WRITE_ERROR       = 3
       AP_NO_AUTHORITY           = 4
       AP_FILE_OPEN_ERROR        = 5
       AP_FILE_EMPTY             = 6
       OTHERS                    = 7
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Hope it will solve your query.

  • File download from application server to presentation server

    Hi,
         We have requirment to upload a file to application server in .dbf format and then download it to presentation server.  while downloading the file to presentation server some of the fields  getting junk values.  we are downloading file to excel sheet.  some of the fields values are Russian texts.  Those fields only getting junk values, all other fields are getting correct values.
    Please advice.
    Regards,
    chandra.

    hi
    sample code below should help you......
    <u>Download to presentation server</u>
    This program can be used to download files from Application server to presentaion server.
    1)Maximum length of each field is considered to be 40 characters.
    2)Maximum length of the field can be changed by specifying the length in selection screen parameter
    3)First line of the Application server file should contain the description of each field.
    4)Each field should be delimited by #.
    *& Report ZDOWNLOADFILE *
    REPORT ZDOWNLOADFILE
    MESSAGE-ID B1 .
    INCLUDES *
    INCLUDE ZDOWNLOADFILE_TOP.
    INCLUDE ZDOWNLOADFILE_FORM.
    EVENT-AT SELECTION-SCREEN *
    AT SELECTION-SCREEN ON pa_appl.
    PERFORM check_file_exists USING pa_appl.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_appl.
    PERFORM f4_dxfilename USING pa_appl.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_pres.
    PERFORM f4_filename USING pa_pres.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_del.
    PERFORM f4_dxfilename USING pa_del.
    EVENT INITIALIZATION *
    INITIALIZATION.
    PERFORM initialization.
    EVENT START-OF-SELECTION *
    START-OF-SELECTION.
    PERFORM determine_fields. "Determine number of columns
    PERFORM build_itab. "Create internal table based on number
    "of columns
    PERFORM build_header. "To prepare header for the file
    PERFORM download_data. "Download data to presentation server
    PERFORM delete_files. "Delete files from application server
    *& Include ZDOWNLOADFILE_TOP *
    TYPES: BEGIN OF ty_header,
    text(100) TYPE c,
    END OF ty_header.
    DATA: c_fnh_mask type dxfields-filemask value '.',
    search_dir type dxfields-longpath value '/sapglobal/users'.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    Internal tables *
    DATA: gt_header TYPE STANDARD TABLE OF ty_header,
    gt_fieldcat TYPE lvc_t_fcat.
    Work areas *
    DATA: gs_header TYPE ty_header,
    gs_fieldcat TYPE lvc_s_fcat.
    DATA: wa_filename TYPE string.
    DATA: wa_count(2) TYPE N,
    wa_start(3) TYPE N,
    wa_end(3) TYPE N,
    wa_len(3) TYPE N.
    DATA: wa_data(12000) TYPE c,
    wa_off TYPE I,
    itab_appl TYPE REF TO DATA,
    itab_line TYPE REF TO DATA,
    col(2) TYPE c.
    DATA: wa_field(30) TYPE c.
    DATA: lv_index TYPE sy-tabix.
    DATA: gs_adrp type adrp,
    gs_usr02 type usr02,
    gs_usr21 type usr21,
    gs_char50(50).
    CONSTANTS: co_slash(1) value '/'.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
    <wa>,
    <fs_line>,
    <wa_line>.
    SELECTION SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-f01.
    PARAMETERS: pa_appl LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-f02.
    PARAMETERS: pa_pres LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE text-f03.
    PARAMETERS: pa_del LIKE rlgrap-filename .
    PARAMETERS: pa_deld AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE text-f04.
    PARAMETERS: pa_len(3) TYPE c.
    SELECTION-SCREEN END OF BLOCK B4.
    *& Include ZDOWNLOADFILE_FORM *
    *& Form f4_dxfilename
    text
    -->P_pa_appl text
    form f4_dxfilename using p_file.
    DATA: wa_file LIKE dxfields-longpath.
    CLEAR: wa_file.
    call function 'F4_DXFILENAME_TOPRECURSION'
    exporting
    i_location_flag = 'A'
    i_server = ' '
    i_path = search_dir
    filemask = c_fnh_mask
    fileoperation = 'R'
    importing
    o_path = wa_file
    exceptions
    rfc_error = 1
    error_with_gui = 2
    others = 3
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    p_file = wa_file.
    endif.
    endform. " f4_dxfilename
    *& Form f4_filename
    text
    -->P_pa_pres text
    form f4_filename using p_data.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    IMPORTING
    FILE_NAME = p_data
    endform. " f4_filename
    *& Form check_file_exists
    text
    -->P_pa_appl text
    form check_file_exists using p_file.
    DATA: wa_file LIKE rlgrap-filename.
    wa_file = p_file.
    OPEN DATASET wa_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc = 8.
    MESSAGE E714
    WITH text-m01 p_file text-m02.
    ELSE.
    CLOSE DATASET p_file.
    ENDIF.
    endform. " check_file_exists
    *& Form build_header
    text
    --> p1 text
    <-- p2 text
    form build_header .
    *Select user details
    clear gs_usr21-persnumber.
    select single persnumber
    into (gs_usr21-persnumber)
    from usr21
    where bname = sy-uname.
    concatenate sy-uname
    co_slash
    gs_adrp-name_text(36)
    co_slash
    into gs_char50.
    condense gs_char50.
    clear gs_usr02-class.
    select single class
    into (gs_usr02-class)
    from usr02
    where bname = sy-uname.
    concatenate gs_char50
    gs_usr02-class
    into gs_char50.
    condense gs_char50.
    Write report technical name
    write 'Name: ' TO gs_header+0(10).
    gs_header+11(*) = sy-repid.
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write user data
    write 'User: ' TO gs_header+0(10).
    gs_header+11(*) = gs_char50.
    CONCATENATE gs_header gs_char50 INTO
    gs_header SEPARATED BY SPACE.
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write System data
    write 'System: ' TO gs_header+0(10).
    write: sy-sysid to gs_header+11(3).
    write: co_slash to gs_header+14(1).
    write: sy-mandt to gs_header+15(3).
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write System date and time
    write 'System: ' TO gs_header+0(10).
    write sy-datum to gs_header+11(10).
    write sy-uzeit to gs_header+22(8).
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write Local date and time
    write 'Local: ' TO gs_header+0(10).
    write sy-datlo to gs_header+11(10).
    write sy-timlo to gs_header+22(8).
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    APPEND gs_header TO gt_header.
    endform. " build_header
    *& Form determine_fields
    text
    --> p1 text
    <-- p2 text
    form determine_fields .
    DATA: wa_data(600) TYPE c.
    CLEAR: wa_count,wa_start,wa_end,wa_data.
    wa_start = 0.
    wa_end = 1.
    OPEN DATASET pa_appl FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    READ DATASET pa_appl INTO wa_data.
    wa_len = STRLEN( wa_data ).
    DO wa_len TIMES.
    IF wa_data+wa_start(wa_end) EQ
    cl_abap_char_utilities=>horizontal_tab.
    wa_count = wa_count + 1.
    ENDIF.
    wa_start = wa_start + 1.
    ENDDO.
    CLOSE DATASET pa_appl.
    wa_count = wa_count + 1.
    endform. " determine_fields
    *& Form build_itab
    text
    --> p1 text
    <-- p2 text
    form build_itab .
    DATA: wa_len(4) TYPE c.
    CLEAR: wa_len.
    IF pa_len IS INITIAL.
    wa_len = 40.
    ELSE.
    wa_len = pa_len.
    ENDIF.
    col = 1.
    DO wa_count TIMES.
    CONCATENATE 'FIELD' col INTO wa_field.
    gs_fieldcat-fieldname = wa_field.
    gs_fieldcat-outputlen = wa_len.
    gs_fieldcat-datatype = 'CHAR'.
    gs_fieldcat-col_pos = col.
    col = col + 1.
    APPEND gs_fieldcat TO gt_fieldcat.
    CLEAR: wa_field.
    ENDDO.
    *Create the internal table dynamically based on the file structure,
    *this table will be used to download data through GUI_DOWNLOAD fm
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = gt_fieldcat
    IMPORTING
    EP_TABLE = itab_appl
    *Assign the pointer to the field symbol
    ASSIGN itab_appl->* TO <itab>.
    CREATE DATA itab_line LIKE LINE OF <itab>.
    *Create a work area for the dynamic internal table
    ASSIGN itab_line->* TO <wa_line>.
    col = 1.
    OPEN DATASET pa_appl FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET pa_appl INTO wa_data.
    IF sy-subrc <> 0.
    CLOSE DATASET pa_appl.
    RETURN.
    ELSE.
    wa_start = 0.
    lv_index = 1.
    DO wa_count TIMES.
    ASSIGN COMPONENT lv_index OF STRUCTURE <wa_line> TO <fs_line>.
    FIND cl_abap_char_utilities=>horizontal_tab
    IN wa_data+wa_start(*) MATCH OFFSET wa_off.
    IF sy-subrc = 0.
    IF wa_off NE 0.
    <fs_line> = wa_data+wa_start(wa_off).
    ENDIF.
    wa_start = wa_start + wa_off + 1.
    lv_index = lv_index + 1.
    ELSE.
    <fs_line> = wa_data+wa_start(*).
    ENDIF.
    ENDDO.
    APPEND <wa_line> TO <itab>.
    CLEAR: <wa_line>,<fs_line>.
    ENDIF.
    ENDDO.
    endform. " build_itab
    *& Form download_data
    text
    --> p1 text
    <-- p2 text
    form download_data .
    clear: wa_filename.
    wa_filename = pa_pres.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = wa_filename
    filetype = 'DAT'
    tables
    data_tab = gt_header
    exceptions
    access_denied = 15
    call function 'GUI_DOWNLOAD'
    exporting
    filename = wa_filename
    filetype = 'DAT'
    append = 'X'
    tables
    data_tab = <itab>
    exceptions
    access_denied = 15
    endform. " download_data
    *& Form initialization
    text
    --> p1 text
    <-- p2 text
    form initialization .
    REFRESH: gt_header,gt_fieldcat,gt_header.
    endform. " initialization
    *& Form delete_files
    text
    --> p1 text
    <-- p2 text
    form delete_files .
    IF pa_deld EQ 'X'.
    DELETE DATASET pa_appl.
    ENDIF.
    IF pa_del IS NOT INITIAL.
    DELETE DATASET pa_del.
    ENDIF.
    endform. " delete_files
    <b>reward points if helpful.</b>
    thanks
    vijay

Maybe you are looking for

  • Help! My Stacks subfolders no longer organize by date

    Hi all, Been running Snow Leopard for about 48hrs now and noticed my system has been a little more sluggish. Not too pleased about that, but I have a bigger problem: when I view the contents of a subfolder through Stacks it no longer organizes by dat

  • Receiving error message: "Firefox is unable to determine if there is an update available".

    I am running Firefox 31.0 on Mac OS X 10.6.8. I have it set to automatically check for updates, but not to automatically install them. Lately, I keep getting the error message "Update Failed" & "Firefox is unable to determine if there is an update av

  • Is it Possible in JSP

    Hi! i want to do a mini program in jsp page.. Actually i want to create 3 text box ..[CALCULATOR] 1 for giving frist number and another for giving 2nd number and 3rd for result..everything is to be done in same page.. i have tried ...but cant get res

  • Select only some rows

    Hi all, I've a query with more than 500 rows as result. I'm only interested to show the first 50 rows. Did you know any way to prepare the select sentence to do it? I prefer avoid use cursors to do that. Regards, dbajug

  • Fedex Delivery Question

    if i not going to be home. can a person over 18 sign for my iphone if i not there. thanks in advance.