About downloading the file

hi
i have this coding
DATA : BEGIN OF ITAB OCCURS 0,
       MATNR LIKE MARA-MATNR,
       ERNAM LIKE MARA-ERNAM,
       END OF ITAB.
  DATA: v_file TYPE string.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME.
SELECT MATNR ERNAM FROM MARA INTO TABLE ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM UPLOAD.
START-OF-SELECTION.
V_FILE = P_FILE.
PERFORM UPLOAD1.
FORM UPLOAD.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
   PROGRAM_NAME        = SYST-CPROG
  DYNPRO_NUMBER       = SYST-DYNNR
   FIELD_NAME          = 'P_FILE'
IMPORTING
   FILE_NAME           = P_FILE
ENDFORM.
FORM UPLOAD1.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
   DEF_FILENAME           = 'V_FILE'
   DEF_PATH               = ' '
  MASK                   = ' '
  MODE                   = ' '
  TITLE                  = ' '
IMPORTING
  FILENAME               =
  RC                     =
EXCEPTIONS
  INV_WINSYS             = 1
  NO_BATCH               = 2
  SELECTION_CANCEL       = 3
  SELECTION_ERROR        = 4
  OTHERS                 = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
  BIN_FILESIZE                  = ' '
  CODEPAGE                      = ' '
  FILENAME                      = 'V_FILE'
   FILETYPE                      = 'DAT'
   MODE                          = 'A'
  WK1_N_FORMAT                  = ' '
  WK1_N_SIZE                    = ' '
  WK1_T_FORMAT                  = ' '
  WK1_T_SIZE                    = ' '
  COL_SELECT                    = ' '
  COL_SELECTMASK                = ' '
  NO_AUTH_CHECK                 = ' '
IMPORTING
  FILELENGTH                    =
  TABLES
    DATA_TAB                      = ITAB
  FIELDNAMES                    =
EXCEPTIONS
  FILE_OPEN_ERROR               = 1
  FILE_WRITE_ERROR              = 2
  INVALID_FILESIZE              = 3
  INVALID_TYPE                  = 4
  NO_BATCH                      = 5
  UNKNOWN_ERROR                 = 6
  INVALID_TABLE_WIDTH           = 7
  GUI_REFUSE_FILETRANSFER       = 8
  CUSTOMER_ERROR                = 9
  NO_AUTHORITY                  = 10
  OTHERS                        = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
in this coding i can download the itab , after the selecting the file from selectionscreen , it storing the itab in another file ,  WHY IT IS LIKE THAT
PLS HELP ON THIS MATTER

Hii..
Jamshad...
You have to Pass the FileName as Variable (So V_File should not be in Single Quotes)
Check it Below : Changes are in BOLD....
And one more thing Use GUI_DOWNLOAD instead of  WS_DOWNLOAD(which is obselete)
FORM UPLOAD1.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
<b>DEF_FILENAME = V_FILE</b>
DEF_PATH = ' '
MASK = ' '
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME =
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
<b>FILENAME = V_FILE</b>
FILETYPE = 'DAT'
MODE = 'A'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = ITAB
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
<b>Reward if Helpful</b>

Similar Messages

  • About download the file into application server

    Hi,
    I have created the HR report for employee details like wbselement,manager details,
    department,desg,etc. and this output will be downloaded to application server.
    For this,am using open dataset and close dataset.
    what's my problem is ,  when i am trying to download the details in Appln server, it exceeds the maximum line size and some of fields are truncated. how to avoid this?
    Thankx,
    Sivasamy

    Hi,
    While you download the Sata into an application server, you can see upto 254 cahrecters only, you can not see more than then, but if you download the smae into an internal tabel then it will download all the data ...
    Regards
    Sudheer

  • Error While downloading the file A server Error has occurred, please try again later Downloading Yahoo mail Application Attachments  Trying to download My Photos and movie 3 items so i can delete them all

    I have icloud and a new iPhone5 ! They work good , took pictures and a few short movies, plugged in my phone to my iMac transfered Items to iPhoto then inported items to iMovie. when getting to know what i was doing i decided to delete pictures and movies i no longer wanted. when i looked for a few missing items i opend Finder and there some where buyt i had already trashed them and deleted the doubles. Still could not find missing pictures and movies 3 items and today after calling yahoo about a different complant with sending feed back for Yahoo mail Applications login . i opened up Attachments Not the Large Attachments just Attachments and there were the 3 items i had been hunting for to Trash and delete. the mail Attachments file does not have the Option to delet Files and photos and movies. When i tried to Download the 3 items a window shows up that says Error While Downloading the Files, A Server Error has occured, please Try Again later. nothing works how do i remove the Trapped photo and movie Blank Files and trash them?  Onece they get into my downloads i can do something with them as i understand.    That part of it kind of keeps me in Question also because why should i have to down load my own files of Attachments / Pictures and movies if they are comming from my iMac?    How much better is iLife11 then iPhoto08 and iMovie08 .  Thanks Greg

    Hello,
    Thank you for your post.
    This is a quick note to let you know that we are performing research on this issue.
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • TS1398 I have recently updated my iphone 5 to ios 6.0.2 but wi-fi is still slow. It takes a lot of time to download the files. But web browsing is OK. I have downloaded an app size 8 MB but it take around 15 minutes on my wifi. Please help Apple.

    I have recently updated my iphone 5 to ios 6.0.2 but wi-fi is still slow. It takes a lot of time to download the files. But web browsing is OK. I have downloaded an app size 8 MB but it take around 15 minutes on my wifi. Please help Apple.

    I couldn't find the edit button on my original post so I am posting an update here.
    I have gone through more apps and have had good luck on all but one more.  And it's not that the app doesn't work, I am talking about the Yahoo Weather app, It works fine, but when you swipe between cities the screen lags a bit and it sometimes doesn't move between pages the way it should.  On iOS 7.1.2 it was smooth as butter but on iOS 8.0, not so much.  I will post a note in the app store to let them know.  I really like the Yahoo app better than the new stock app.
    I have been going through my games and they all work fine. Angry Birds (Original and Stella), Canabalt, Minecraft, Bejeweled 2, Silly Walks, PopWords, Doodle Jump, Deep Green all seem to work just fine. 
    Starbucks app works as it should. 
    I will stop back again next week after I have had the weekend to play with it in detail and post my thoughts again.

  • I have iPad Air. I want to download games from safari but safari cannot download the file.so what should I do??

    I have iPad Air. I want to download games from safari but safari cannot download the file so what should I do??

    Hamzy 15 wrote:
    And what about the music?
    Music comes from the iTunes Store or by Syncing with your computer.
    >  http://support.apple.com/kb/HT1386

  • Download the file

    How to download the report output to the specified file
    Edited by: Anil Reddy on Dec 19, 2007 9:35 AM

    Hi Anil,
    There are different ways to do this. There is the ALV option that comes with the ability to download into spreadsheet format, and you can also use OLE to run Excel & create a spreadsheet. Since it is a report you asked about, ALV is the more logical way to go.
    OR
    standard SAP functionality: (from the menu) System --> List --> Save -->Local File choose excel format.
    or you can use the function module - GUI_DOWNLOAD for downloading the file to the presentations server.
    Here i am copying a sample code for downloading a file using
    GUI_DOWNLOAD.
    This code download the data from table kna1 to a text file along the
    header data.
    TABLES:  KNA1.
    PARAMETERS:  STATE LIKE KNA1-REGIO .
    TYPES:       BEGIN OF OUTREC,
                 KUNNR LIKE KNA1-KUNNR,
                 REGIO  LIKE KNA1-REGIO,
                 TELF1  LIKE KNA1-TELF1,
              END OF OUTREC.
    TYPES:
    BEGIN OF ty_output,
    name TYPE dbfieldnam,
    END OF ty_output.
    DATA:
    lt_dbfield TYPE STANDARD TABLE OF dbfield WITH HEADER LINE,
    lt_output TYPE STANDARD TABLE OF ty_output WITH HEADER LINE.
    CALL FUNCTION 'DB_GET_TABLE_FIELDS'
    EXPORTING
    field_info = 'A'
    tabname = 'KNA1'
    IMPORTING
    SUBRC =
    TABLES
    dbfields = lt_dbfield.
    LOOP AT lt_dbfield.
    lt_output-name = lt_dbfield-name.
    APPEND lt_output.
    ENDLOOP.
    DATA:     OUT_ITAB TYPE STANDARD TABLE OF OUTREC
                 INITIAL SIZE 10 WITH HEADER LINE,
           IN_ITAB TYPE STANDARD TABLE OF OUTREC
                 INITIAL SIZE 10 WITH HEADER LINE.
    SELECT * FROM KNA1 WHERE REGIO = STATE.
         MOVE-CORRESPONDING KNA1 TO OUT_ITAB.
         APPEND OUT_ITAB.
    ENDSELECT.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        =  'C:\XYZ.TXT'
       FILETYPE                        = 'ASC'
       APPEND                          = 'X'
       WRITE_FIELD_SEPARATOR           = 'X'
       HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        =  OUT_ITAB
       FIELDNAMES                    =   lt_output
       EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Reward points if useful.
    Regards
    Manoj Kumar

  • When opening pdf file I cannot choose between opening or downloading the file?

    Adobe offers just the download. How to change this?

    Hi, thanks for your reply. I use Mozzilla firefox the 15.01 version. How do I change the settings then?
    Martin
    Date: Fri, 21 Sep 2012 22:27:42 -0600
    From: [email protected]
    To: [email protected]
    Subject: When opening pdf file I cannot choose between opening or downloading the file?
        Re: When opening pdf file I cannot choose between opening or downloading the file?
        created by Pat Willener in Adobe Reader - View the full discussion
    That choice is not made by Adobe, but your browser, of which you give no details. 64-bit browsers cannot open PDF files, as the Adobe Reader plugin is a 32-bit app.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4718369#4718369
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4718369#4718369
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4718369#4718369. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • I need help. My ipad 2 was stuck in recovery mode. i tried to connect it to itunes and restore but after downloading the file and extracting the software there is a pop up message that says "the device is full" i dont know what to do. Its been 2 days now.

    I need help. My ipad 2 was stuck in recovery mode. i tried to connect it to itunes and restore but after downloading the file and extracting the software there is a pop up message that says "the device is full. Deleting files and emptying your recycle been will help you restore." how am i going to erase files if i can't open my ipad. i dont know what to do. Its been 2 days now. please help. thanks.

    yes i am sure. This are the exact words... "The iPad "iPad" could not be restored. The disk you are attempting to use is full. (Removing files and emptying the recycle bin will free up additional space". i tried some options, hard reset, redsnow, tinyumbrella but still it's stuck.

  • HT1420 my laptop has been stolen. I have bought a new one but I can't download the files (movies, articles,...) that I have in my ipad into my new ipad so I can put some of them in my daughters mini ipad. How can i do it?

    My laptop has been stole. I have bought a new one but I can't download the files (homemovies, articles, presentations) from my ipad to the new laptop so I can share with my daughters in their mini ipads. Any ideas?
    I am working with Windows 8

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Download the file to apllication server

    hai all,
    My requirement is i need to download the file in application server and i need to validate the file path that file already exist or not if exist it has to give the error message
    How can i do that.
    Pls send the fn modules are methods which is suitable for my requirement with code.
    I will reward the points,
    Thanks in advance
    Laxmi

    HI,
       report zexternalfile .
    tables : zzpublisher,
             sscrfields.
    data: it_publisher like standard table of zzpublisher,
          wa_publisher like zzpublisher.
    select * from zzpublisher into table it_publisher.
    call function 'GUI_DOWNLOAD'
      exporting
      BIN_FILESIZE                  =
        filename                      = 'C:\externalfiles\kamal.XLS'
      FILETYPE                      = 'ASC'
      APPEND                        = ' '
        write_field_separator         = 'X'
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = it_publisher
    EXCEPTIONS
      FILE_WRITE_ERROR              = 1
      NO_BATCH                      = 2
      GUI_REFUSE_FILETRANSFER       = 3
      INVALID_TYPE                  = 4
      NO_AUTHORITY                  = 5
      UNKNOWN_ERROR                 = 6
      HEADER_NOT_ALLOWED            = 7
      SEPARATOR_NOT_ALLOWED         = 8
      FILESIZE_NOT_ALLOWED          = 9
      HEADER_TOO_LONG               = 10
      DP_ERROR_CREATE               = 11
      DP_ERROR_SEND                 = 12
      DP_ERROR_WRITE                = 13
      UNKNOWN_DP_ERROR              = 14
      ACCESS_DENIED                 = 15
      DP_OUT_OF_MEMORY              = 16
      DISK_FULL                     = 17
      DP_TIMEOUT                    = 18
      FILE_NOT_FOUND                = 19
      DATAPROVIDER_EXCEPTION        = 20
      CONTROL_FLUSH_ERROR           = 21
      OTHERS                        = 22
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    <b>Reward useful points,</b>
    siva

  • Gui_download function to download the file in application server in bdc

    Can we use gui_download function to download the file in application server in bdc?
    Regards,
    pandu.

    for downloading the file on application sever you use the concept of Dataset. GUI_DOWNLOAD is for presentaion server.
    regards
    Abhi

  • One field is missing in downloading the file from report

    Hi Friends,
    I have a problem with downloading the file from SAP.
    Actually the report has to download 6 fields from the list of the report to a .txt file on the presentation server. But it is downloading only 5 fields. The missing field is DEA#. Actually now i have to fix that problem.
    I found that in the download process they have not inlcuded the DEA# field.
    Here in this 1 field is not getting dowloading from the list of the report to the text file.
    I'm giving a portion of the code.
    Like this they r calling the FM:
    FORM DOWNLOAD_FILE.
      CALL FUNCTION 'DOWNLOAD'
           EXPORTING
                FILENAME = P_OUTFIL
           TABLES
                DATA_TAB = I_OUTPUT.
      IF SY-SUBRC <> 0.
        WRITE:/ 'Error downloading file'.
      ENDIF.
    in code we have,
    data: v_output type t_output,
    data: i_output type t_output occurs 0.
    and,
    BEGIN OF T_OUTPUT,
           RECORD(200),
           END OF T_OUTPUT.
    when i debug the program,
    the record field is showing only the 5 fields not the missing 6th filed)DEA#).
    and we have another FORM :
    *&      Form  FORMAT_FILE_WITH_TABS
          Insert tabs between fields so when uploaded in Excel, the
          record will be separated into columns where a tab is found.
    FORM FORMAT_FILE_WITH_TABS.
      LOOP AT I_KNA1 INTO V_KNA1.
        CONCATENATE: V_KNA1-KUNNR
                     V_KNA1-NAME1
                     V_KNA1-NAME2
                     V_KNA1-STRAS
                     V_KNA1-ORT01
                     V_KNA1-REGIO
                     V_KNA1-PSTLZ
           INTO V_OUTPUT SEPARATED BY C_TAB.
        APPEND V_OUTPUT TO I_OUTPUT.
        CLEAR V_OUTPUT.
      ENDLOOP.
    ENDFORM.                               " FORMAT_FILE_WITH_TABS
    If you look into this FM, there is no mention of DEA# field,
    i hve tried to correct it by adding the "v_likp_dea" in the FM. when i did like this it is showing the DEA# field in the downloaded .txt file but only 1 value for all the records.
    My question is for each record i have to show its unique DEA#.
    I guess i could do this by putting it in loop, could anybody tell me how i can i do that, Please
    Thank you very much.
    Raj.

    In the subroutine format_file_with_tabs ,
    You should read  it_likp with the key that uniquely identifies for dea# . This should be done in the loop at i_kna1.
    Suppose kunnr identifies a unique dea# in it_likp internal table , then you should write
    FORM FORMAT_FILE_WITH_TABS.
    LOOP AT I_KNA1 INTO V_KNA1.
    clear v_likp.
    read table it_likp into v_likp
       with key kunnr = v_kna1-kunnr binary search.   (should sort the itab to use binary search with read. )
    CONCATENATE: V_KNA1-KUNNR
    V_KNA1-NAME1
    V_KNA1-NAME2
    V_KNA1-STRAS
    V_KNA1-ORT01
    V_KNA1-REGIO
    V_KNA1-PSTLZ
    v_likp-dea
    INTO V_OUTPUT SEPARATED BY C_TAB.
    APPEND V_OUTPUT TO I_OUTPUT.
    CLEAR V_OUTPUT.
    ENDLOOP.
    ENDFORM. " FORMAT_FILE_WITH_TABS
    Message was edited by: Kalidas Cheroolil

  • I have Adobe Acrobat 7.0 Professional that I want to migrate to my newer laptop running Windows 7. I downloaded the file 22020134.exe to reinstall it on my new computer and I go through the hops and when I put in the Serial Number it tells me its invalid.

    I have Adobe Acrobat 7.0 Professional that I want to migrate to my newer laptop running Windows 7. I downloaded the file 22020134.exe to reinstall it on my new computer and I go through the hops and when I put in the Serial Number it tells me its invalid.

    22020134.exe is the file Adobe say you must download and run to instal Acrobat 7.0 Pro. I went through the  process, the one described in your link, I downloaded the file, ran it, it runs well, except it tells me my serial number is invalid. Now what? Does this mean I now have to discard my Adobe Acrobat 7.0 Professional and start again with a $500 purchase? All I want to do is transfer what I have to another computer.  

  • I can not do the update , what should I do to fix this error ? "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    I can not do the update , what should I do to fix this error ?
    "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    Hi,
    Please refer to the help document below:
    Error downloading, installing, or updating Creative Cloud applications
    Regards,
    Sheena

  • Problem with ipad 2 safari cannot download the file for windows live photo gallery

    on ipad 2 safari cannot download the file for windows live photo gallery

    What you can download via Safari on the iPad is very limited - you can only download apps from the iTunes app store on your computer to sync to the iPad, or from the App Store app directly on the iPad

Maybe you are looking for