When handling local files , should I call flush() at all?

When handling local files, I am confused by the flush() method.
A lot of tutorial pages say it's safer to call flush() before close(). After thinking for a while, I'm asking mysel: Does flush() applies only to buffered stream(right?)? If a stream is not buffered, program should not call flush(). For buffered stream, the corresponding close() method of the wrapper or stream class should invoke flush() method. If they don't , it's an implementation bug, which should be fixed. So for both buffered and unbuffered stream, no need to call flush() before close()(right?).
Then the question is: when do we need to call flush() method? If we don't need call flush() at all, why are there flush() methods in almost every stream/wrapper class?
Please let me know what is wrong, either me or something else.
Any feedback is appreciated.
Gang

"The close method of FilterOutputStream calls its flush method, and then calls the close method of its underlying output stream." (Javadoc)
By inheritance this also applies to BufferedOutputStream and its descendants. However FileOutputStream does not extend FOS or BOS so it has nothing to flush(), so flushing it does nothing at any time even before closing.
In general flush() writes buffered bytes out of the JVM into the operating system. When you do have buffering, which in practice you should (e.g. new BufferedOutputStream(new FileOutputStream(...))), you should flush at points when you really want to be rid of the data. When operating on sockets you should always flush before try to read the next data from the socket. You can flush more often if you like but it is often counter-productive.

Similar Messages

  • Handle LOCAL files during a web session

    I'm developing an application with Forms 6i.
    Please consider the following command line:
    text_io.fopen('c:\tmp.txt','r')
    In client/server mode the file "tmp.txt" is searched on the local computer (on
    the client).
    In web mode the file "tmp.txt" is searched on the server.
    How can I open the "tmp.txt" file on the CLIENT computer, also in web mode?
    Is there a way to handle local files during a web session?
    Thank you in advance!

    There is a java upload bean available on OTN (somewhere in the javabean/pjc section of examplecode) ... this one lets you do what you want, but it's violating the java sandbox functionality and hence need to be certified/signed to use in a browser - which i personally think is somehwat a hassle ... also it just copies the file to the middletier - you still will need to then read it from there.
    i've found that using the webdb/portal approach for file handling is much easier. if you alerady run on web then you probably anyway have installed 9ias or a webdb/portal server somewhere ... using web.show_document builtin and a very small webdb procedure (something like 10 lines of code) will allow you to easily upload a file directly into the database into an blob!
    have a search through this forum ... i posted a working example a few days back (somewhen last week) on this forum!
    Cheers,
    Stefan

  • [Info] Allow pkgbuild/makepkg to handle local files

    Hi there !
    As a fan of both Humble Indie Bundle and Archlinux,
    I found myself confronted with makepkg incapacity to locate local files.
    So i decided to write a dlagent for "file:" in makepkg.conf.
    As a side note, "local:" would be a better name, but aur/worldofgoo and aur/anomaly use "file:" so be it.
    It reads like this :
    DLAGENTS=( ...
    'file::/bin/ln -s $(zenity --file-selection --title="Select ressource %u" --file-filter $(basename %u)) %o')
    It simply opens a file browser displaying only files with a name matching the expected one, and then symlinks it to the build location.
    I am still usatisfied as it is possible to return a directory with a name not matching the pattern, but it seems impossible to prevent that with zenity.
    I wanted to share it with the community, but there is no wiki for makepkg.conf, so I ended up here ;-)
    Maybe it is even possible to include it by default (but then makepkg would depend on zenity, which is rater stupid).
    Any comment/improvement would be much appreciated.
    Layus
    Last edited by Layus (2012-10-29 18:24:39)

    Yes... I forgot that because building with yaourt is very interactive.
    1) ==> Select packages (numbers) to install :
    2) ==> Edit PKGBUILD ? [Y/n] (if yes edit, then same question again, until you refuse)
    3) ==> Edit readme.install [Y/n]
    4) ==> Start compiling <pkg> ? [Y/n]
    4') select tarball with zenity
    5) ==> Do you want to install <pkg> (or verify it)
    6) sudo : enter password for <user> :
    7) Proceed to install ? [Y/n] (pacman prompt)
    So inserting one interactive step seemed meaningless but of course makepkg is supposed to be fully automatic.
    So be it, this idea shall only stay here in case anyone searches for the same functionality.
    Thank you for the comment, and be sure I will continue to muck a lot

  • Infinite Beachball when Open/Place File Dialog is Called

    (Apologies on the novel below. If it helps a soul out there from a descent into madness, well, at least one of us got out okay.)
    I am having a heck of a morning that is bleeding over from last night (and it has nothing to do with Mardi Gras time in New Orleans). I have recently set up my laptop (a new MBP) with Yosemite and AICS 5.1 and 6 (haven't yet made the move to subscription CC). I use the laptop at my office, where we have a simple network (one router, a switch, and several NAS drives). All day yesterday I worked on the system and had no issues. I took the computer home (another simple network with router, switch, nas drive) and whenever I attempted to either Place a file into an existing document or Open a file from within Illustrator the file dialog window would open. However, even though the window would indicate the Desktop directory was being accessed, the list of files would not populate and, after a couple seconds, the cursor would beachball forever. Uncertain to its reason, I attempted several remedies (cleaning font cache, uninstalling a couple system preference panes, paring down font menu, removing sidebar items, deleting all preferences, making changes to Dropbox settings). The only thing that worked in getting the dialogs not to beachball was to install a temporary user account and load AI from there (not a practical solution, ultimately). Also, it is important to note, this Open/Place problem occurs in AICS5.1 as well as AICS6. Things that do work regarding file access: if I Save a file from within AI the file dialog comes up and no problem. If I double-click or otherwise open a file from the Finder or a search utility the document will open.
    This morning I brought my computer to work and attempted the Place command. The window opened and paused, and then a curious thing happened. I heard my NAS awaken. After several seconds, the dialog window populated, and all was righted. I could Open and Place files with no issue. The three network shares that I have at the office all reconnected (I had disconnected from all of them before quitting the network last night).
    At this point, my hypothesis is that AI was having some trouble with network shares and even though I had unmounted the shares AI was still remembering them (and having trouble letting go). To test this, I loaded AI with the shares mounted, quit AI, and then unmounted the shares. I then disconnected from the network and loaded AI. Attempting the Place command in a new document brought up the dialog window and directory file list (!). I then pressed [CMD] + D to get to the desktop files/shortcut folders and wham -- infinite beachball!
    My desktop has a bunch of helpful aliases for navigating local and network shares. There are links to my Dropbox folder, my client art folder, a screenshot folder, and four links to network shares. I made these shortcuts by mounting the share, going up a level in the root directory, and option-commanding the share over to the desktop. I don't know if this is a good or holy way to do it, but it's the way I've been doing it on 10.6.8. In any case, I took all of the icons on the desktop and threw them in a temp holding folder. I then loaded AI, new document, Place, go to Desktop directory -- no beachball. Open the temp folder, infinite beachball, force quit. Create a subfolder within the temp folder. Put all the network share aliases in there. AI, New, Place, Desktop directory (ok), temp directory (ok), subfolder (beachball party), force quit.
    Mind you, this is all with the network disconnected. When I get info any of the aliases the Finder beachballs!! After a few seconds, though, the Finder begrudgingly allows me to see the file information.
    So, there's something screwy with the way those aliases are behaving. When they are 'looked at' by the AI file dialog (or the Finder) the system wants to reach out and touch them, say hello. The Finder, although flummoxed, eventually regains composure and shakes off the hang. AI, however, can't break free.
    The temporary way forward, I suppose, is to remove those aliases from the Desktop and put them in a safe, out of the way place. I will probably create a few AppleScripts or Automator apps in their stead for mounting NAS shares, and assign to function keys. Hopefully someone out there with bigger lightbulbs over their head can shed some light on the problem and offer other suggestions for a more robust fix. In any case, it's probably a Yosemite problem, given the Finder's odd behavior.
    Cheers!
    -g-

    Open Finder, press Option key, select Go > Library, open Preferences and delete com.apple.desktop.plist

  • Premiere Pro CC quits unexpectedly when handling video files

    Premiere Pro CC quits unexpectedly (serious error message) when importing footage. The formats I've tried and failed with include H.264, Prores422 and DNxHD. When I reopen a project containing one of these formats, it crashes again even if I click on one of the imported files. I'm using an early 2013 Macbook Pro and trying to edit Nikon D800 footage. At this point I'm not sure what other information I can provide.

    Hi HWImaging,
    Welcome to Adobe forums
    Please check the graphic card,if you are using non-NVIDIA display graphics then remove cuda drivers from following locations:
    Delete the following:
    /System/Library/Extensions/CUDA.kext
    /Library/Frameworks/CUDA.framework
    /Library/LaunchAgents/com.nvidia.CUDASoftwareUpdate.plist
    /Library/PreferencePanes/CUDA/Preferences.prefPane
    /System/Library/StartupItems/CUDA/
    /usr/local/cuda
    If issue persists, try this:
    Give your user account read/write permissions to the Adobe Preferences folder.
    http://helpx.adobe.com/creative-cloud/kb/ame-premiere-crash-launch-export.html
    Please reply if issue still persists
    Thanks

  • [SOLVED] No audio in Chrome (even when playing local files)

    I'm running Arch on a Vizio CT14-A4 laptop.  Audio works in other programs, but sometimes it doesn't work in Chrome.  In the past this problem has magically disappeared and reappeared, but today it persists after multiple reboots.  I updated my system, still no dice.
    Initially I assumed it was a Flash issue, but now I believe it is a browser-level issue since there is no sound even for local .mp3 files (that play fine in mpd).
    Could Chrome be accessing the wrong playback device?  I have one card with two subdevices:
    $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: PCH [HDA Intel PCH], device 0: CS4210 Analog [CS4210 Analog]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    The first entry is the one I want to use.  Since it's device 0 on card 0 and I don't have a .asoundrc, it should be accessed by default.  Is there a way to check whether Chrome is overriding default behavior and using the second entry?
    Edit (much later): Turns out this was a mixing problem, I don't remember how I fixed it.  Essentially audio could only be played from one source at a time.  Not Chrome-specific.  Marking solved.
    Last edited by chikinn (2015-05-25 17:18:33)

    Oh, sorry, I should have mentioned: I'm using Alsa, not Pulse.
    I'm trying to get any audio content working in Chrome, doesn't matter what.  The fuser command gave the same output whether I was playing a local MP3 file or streaming a YouTube video.
    In ~/.mpd/mpd.conf, I have the following:
    audio_output {
    type "alsa"
    name "alsa-mpd-ncmpcpp"
    Regarding your last sentence,
    emeres wrote:Does is use hardware directly, hw:0,0 or whatever you specified in device?
    I don't know whether I specified anything in device or whether mpd uses hardware directly.  How can I check?  (I'm still a bit new to Linux!)

  • How to open local file in BSP

    Hi,
    My requirement is we have to provide one hyperlink and when user click on that one local file should open. The Hyper link contain the path of local file, I Tried with the following option, its working fine in HTML code but not in BSP.
    <a href="C:\My File.PDF">here</a>
    Any Suggestion.
    Thanks

    Hi Ricardo,
    Thanks for the quick response, but my requirement is not downloading and uploading files, my requirement is ' I Have to provide one hyperlink in BSP Page, and when user click on this link one local file should open. For exa. try to save this code ( mention in Sub Line ) in text file and save it as HTML Extention.
    <a href="C:\My Filel.PDF">Open my File</a> "
    when you execute this file as a result on the web page you will get text 'Open my File' and when you click on there than a file which is stored in location C:\My File.PDF will open, same thing I would like to do in BSP.
    Thanks and Regards
    Ravi

  • Open a Local file from JSP

    Hi All,
    I want to access a local file from a JSP. On click of the link the local file should open. The location of the local file is
    O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    and the hyper link on the JSP shows
    file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    somehow the file does not open from the JSP page but it opens from the browser if I type
    'file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc' in the address bar.
    Can anybody please help.
    regards,
    Shardul.

    if you'd like to show the real path to the user, use simply an ftp server !
    however, if you prefer a secure solution, so use a servlet:
    example:
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SendWord extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        //get the 'file' parameter
        String fileName = (String) request.getParameter("file");
        if (fileName == null || fileName.equals(""))
          throw new ServletException(
              "Invalid or non-existent file parameter in SendWord servlet.");
        // add the .doc suffix if it doesn't already exist
        if (fileName.indexOf(".doc") == -1)
          fileName = fileName + ".doc";
        String wordDir = getServletContext().getInitParameter("word-dir");
        if (wordDir == null || wordDir.equals(""))
          throw new ServletException(
              "Invalid or non-existent wordDir context-param.");
        ServletOutputStream stream = null;
        BufferedInputStream buf = null;
        try {
          stream = response.getOutputStream();
          File doc = new File(wordDir + "/" + fileName);
          response.setContentType("application/msword");
          response.addHeader("Content-Disposition", "attachment; filename="
              + fileName);
          response.setContentLength((int) doc.length());
          FileInputStream input = new FileInputStream(doc);
          buf = new BufferedInputStream(input);
          int readBytes = 0;
          while ((readBytes = buf.read()) != -1)
            stream.write(readBytes);
        } catch (IOException ioe) {
          throw new ServletException(ioe.getMessage());
        } finally {
          if (stream != null)
            stream.close();
          if (buf != null)
            buf.close();
      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        doGet(request, response);
    }hope that helps

  • [Desktop] Bring Back Local File Info Editing and Dates Added!

    I would like to see the functionality for changing the track info for local files and the sorting of when the local file was added to come back. I used these functions a lot because I have a large amount of music saved on my computer, and I add more often. I liked the ability to change the track's info to make it easier to search for and more organized. The date added function was also essential for organizing my local files because I would have to search through thousands of files just to find the file that I just added. Since these functions were on an older version of Spotify, I don't understand why they would be omitted in the newer versions. Also, fixing the bugs that prevent local files to be synced to my phone for offline playing would be helpful as well.

    Updated: 2015-07-09Hi and thanks for your contribution! A similar idea has also been suggested here:
    https://community.spotify.com/t5/Live-Ideas/Desktop-Restore-Option-to-Edit-Local-File-Information/idi-p/1045037
    Add your kudos and comments there please!

  • ALV issue: when save list using Local File command will get run time error!

    help!!!!
    report list using ALV method when to save this list using Local File.
    i will get GETWA_NOT_ASSIGNED run time error information.
    how resolve it?
    source code :
    REPORT   ZIFT0103.
    TABLES :  MARA,MARC,CDHDR,CDPOS,MAKT.
    ******DEVK909212****************
    ****&#21033;&#29992;&#24037;&#21378;&#26469;&#21306;&#20998;&#19981;&#21516;&#30340;SERVER&#30340;FTP ADDRESS ,user ,PASSWORD
    DATA: FTP_WERKS LIKE MARC-WERKS.
    ********&#23450;&#20041;&#19968;&#20010;RANGE&#29992;&#26469;&#25235;&#21462;MARC&#30340;&#20449;&#24687;
    RANGES:R_MATNR FOR MARA-MATNR OCCURS 0.
    ********&#23450;&#20041;&#19968;&#20010;INTERNAL TABLE &#26469;&#25235;&#21462;MARC &#30340;&#20449;&#24687;
    DATA:BEGIN OF IT_MARC OCCURS 0,
          MATNR LIKE MARC-MATNR,
          WERKS LIKE MARC-WERKS,
          USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         FLAG_UI TYPE C,
         END OF IT_MARC.
    *******&#23450;&#20041;&#23384;&#25918;&#21271;&#20140;&#30340;&#25968;&#25454;&#30340;&#21464;&#37327;
    DATA : BEGIN OF FTP_BEIJING OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_BEIJING .
    ******&#23450;&#20041;&#31119;&#28165;&#30340;&#25968;&#25454;&#21464;&#37327;
    DATA : BEGIN OF FTP_FUQING OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_FUQING .
    *******DEVK909212*****************
    DATA : BEGIN OF FTP_ITEMDOC1 OCCURS 0 ,
                  MATNR(25) ,
                  MAKTX(30) ,
           END OF FTP_ITEMDOC1 .
    DATA : BEGIN OF FTP_ITEMDOC OCCURS 0 ,
                  MATNR(25) ,
                  MATNR1(25) ,
                  MAKTX(30) ,
           END OF FTP_ITEMDOC .
    DATA: WA_ZMSGTA TYPE ZMSGTA ,
          l_ersda  like MARA-ERSDA .
    ***********DEVK909553********************
    ****&#29992;&#26469;&#20915;&#23450;&#25191;&#34892;FTP&#36824;&#26159;&#26174;&#31034;LIST**********
    DATA:g_tcode_flag.
    ***********DEVK909553********************
    Error message process ******************************
    DEFINE EXPLAIN_MSG.
       break soe_richard.
      CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
        EXPORTING
          ID                = &1   "SY-MSGID
          NUMBER            = &2   "SY-MSGNO
          LANGUAGE          = SY-LANGU
          TEXTFORMAT        = &3
          LINKPATTERN       =
          MESSAGE_V1        = &4                                "SY-MSGV1
          MESSAGE_V2        = &5                                "SY-MSGV2
          MESSAGE_V3        = &6                                "SY-MSGV3
          MESSAGE_V4        = &7                                "SY-MSGV4
        IMPORTING
          MESSAGE           = &8   "WA_ZMSGTA-MSE1
          RETURN            =
        TABLES
          TEXT              =
    END-OF-DEFINITION.
    DEFINE ERROR_MSG_UPDATA.
      CALL FUNCTION 'ZINSERT_MSG'  "IN UPDATE TASK
        EXPORTING
          XZMSGTA      = &1    "WA_ZMSGTA
        EXCEPTIONS
          UPDATE_ERROR = 1
          OTHERS       = 2.
    END-OF-DEFINITION.
    IF SY-TCODE = 'ZIFT103' .
      g_tcode_flag = 'L'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          PERCENTAGE = 0
          TEXT       = '&#35831;&#32784;&#24515;&#31561;&#20505;,&#31995;&#32479;&#27491;&#22312;&#25235;&#25968;&#25454;'.
    ENDIF.
    l_ersda = sy-datum - 1 .  "&#21462;&#21069;&#19968;&#22825;&#20135;&#29983;&#30340;&#29289;&#26009;&#21495;&#30721;&#12290;
    DATA:BEGIN OF it_change OCCURS 0,
         OBJECTID TYPE CDHDR-OBJECTID,
         USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         TABKEY   TYPE CDPOS-TABKEY,
         END OF it_change.
    DATA:BEGIN OF it_cDhdr OCCURS 0,
         OBJECTID type CDHDR-OBJECTID,
         CHANGENR TYPE CDHDR-CHANGENR,
         USERNAME TYPE CDHDR-USERNAME,
         UDATE    TYPE CDHDR-UDATE,
         END OF it_cdhdr.
    DATA:search_len TYPE I.
    DATA:BEGIN of it_insert OCCURS 0,
         MATNR TYPE MARA-MATNR,
         WERKS TYPE MARC-WERKS,
         END OF it_insert.
    DATA:BEGIN OF it_MAKT OCCURS 0,
         MATNR TYPE MAKT-MATNR,
         MAKTX TYPE MAKT-MAKTX,
         END OF it_makt.
    DATA IT_MARA TYPE TABLE OF MARA WITH HEADER LINE.
    DATA:BEGIN OF IT_OUT OCCURS 0,
         MATNR TYPE MARA-MATNR,
         WERKS TYPE MARC-WERKS,
         MTART TYPE MARA-MTART,
         MEINS TYPE MARA-MEINS,
         MATKL TYPE MARA-MATKL,
         MAKTX TYPE MAKT-MAKTX,
         PSTAT TYPE MARA-PSTAT,
         BRGEW TYPE MARA-BRGEW,
         NTGEW TYPE MARA-NTGEW,
         GEWEI TYPE MARA-GEWEI,
         FERTH TYPE MARA-FERTH,
         KZUMW TYPE MARA-KZUMW,
         ERNAM TYPE MARA-ERNAM,
         ERSDA TYPE MARA-ERSDA,
         END OF IT_OUT.
    *-- DECLARE DATA FOR ALV
    TYPE-POOLS: slis.
    DATA  : g_variant LIKE disvariant,
            g_save(1) TYPE c,
            g_exit(1) TYPE c,
            gx_variant LIKE disvariant.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE, "
          gt_events   TYPE slis_t_event,
          gt_list_top_of_page TYPE slis_t_listheader,
          gs_print TYPE slis_print_alv,
          gs_layout         TYPE slis_layout_alv .
    ******&#21482;&#33021;&#25235;&#20986;&#31995;&#32479;&#26377;&#20570;&#26356;&#25913;&#30340;&#25968;&#25454;***************
    ******&#32780;&#31532;&#19968;&#27425;INSERT MARA&#30340;&#25968;&#25454;&#25235;&#19981;&#20986;&#26469;********
    START-OF-SELECTION.
    SELECT AOBJECTID AUSERNAME AUDATE BTABKEY
    INTO TABLE it_change
    FROM ( CDPOS AS B INNER JOIN CDHDR AS A ON
         AOBJECTCLAS = BOBJECTCLAS AND
         AOBJECTID   = BOBJECTID   AND
         ACHANGENR   = BCHANGENR )
    WHERE A~OBJECTCLAS = 'MATERIAL'
    AND   A~UDATE = l_ersda
    AND   B~TABNAME = 'MARC'
    AND   B~CHNGIND = 'I'.
    LOOP AT it_change.
       search_len = STRLEN( it_change-TABKEY ).
       search_len = search_len - 4.
       IF search_len > 0.
         IT_MARC-WERKS = it_change-TABKEY+search_len(4).
       ENDIF.
       IT_MARC-MATNR = it_change-objectid+0(18).
       IT_MARC-USERNAME = it_change-username.
       IT_MARC-UDATE    = It_change-udate.
       IT_MARC-FLAG_UI  = 'U'.
       APPEND IT_MARC.
       CLEAR IT_MARC.
       CLEAR R_MATNR.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = IT_MARC-MATNR.
       APPEND R_MATNR.
    ENDLOOP.
    ****CDPOS is Cluster TABLE &#25152;&#20197;&#27809;&#26377;&#21150;&#27861;&#29992;INNER JOIN******
      SELECT OBJECTID CHANGENR USERNAME UDATE
      INTO TABLE it_cdhdr
      FROM CDHDR
      WHERE OBJECTCLAS = 'MATERIAL'
      AND   UDATE = l_ersda.
    AND   TCODE = 'MM02'.
      LOOP AT IT_cdhdr.
        SELECT * FROM CDPOS
        WHERE OBJECTCLAS = 'MATERIAL'
        AND   OBJECTID  = IT_CDHDR-OBJECTID
        AND   CHANGENR  = IT_CDHDR-CHANGENR
        AND   TABNAME   = 'MARC'
        AND   CHNGIND = 'I'.
          search_len = STRLEN( CDPOS-TABKEY ).
          search_len = search_len - 4.
          IF search_len > 0.
            IT_MARC-WERKS = CDPOS-TABKEY+search_len(4).
          ENDIF.
          IT_MARC-MATNR = IT_cdhdr-objectid+0(18).
          IT_MARC-USERNAME = IT_cdhdr-username.
          IT_MARC-UDATE    = IT_cdhdr-udate.
          IT_MARC-FLAG_UI  = 'U'.
          APPEND IT_MARC.
         CLEAR IT_MARC.
          CLEAR R_MATNR.
          R_MATNR-SIGN = 'I'.
          R_MATNR-OPTION = 'EQ'.
          R_MATNR-LOW = IT_MARC-MATNR.
          APPEND R_MATNR.
          CLEAR IT_MARC.
        ENDSELECT.
      ENDLOOP.
      IF g_tcode_flag = 'L'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = 20
            TEXT       = '&#22788;&#29702;&#22909;&#24403;&#22825;CHANGE&#30340;&#25968;&#25454;'.
      ENDIF.
    *******&#25235;&#24403;&#22825;&#20570;&#20102;INSERT&#30340;&#25968;&#25454;*************
    *******&#19981;&#38656;&#35201;***********************
    SELECT BMATNR BWERKS INTO TABLE IT_INSERT
    FROM MARC AS B JOIN MARA AS A
    ON   AMATNR = BMATNR
    WHERE A~ERSDA = l_ersda.
    LOOP AT IT_INSERT.
       IT_MARC-MATNR = IT_INSERT-MATNR.
       IT_MARC-WERKS = IT_INSERT-WERKS.
       IT_MARC-FLAG_UI = 'I'.
       APPEND IT_MARC.
       CLEAR IT_MARC.
       CLEAR R_MATNR.
       R_MATNR-SIGN = 'I'.
       R_MATNR-OPTION = 'EQ'.
       R_MATNR-LOW = IT_MARC-MATNR.
       APPEND R_MATNR.
    ENDLOOP.
    IF g_tcode_flag = 'L'.
       CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
           PERCENTAGE = 40
           TEXT       = '&#22788;&#29702;&#22909;&#24403;&#22825;INSERT&#30340;&#25968;&#25454;'.
    ENDIF.
      IF g_tcode_flag = 'L'.
        PERFORM get_MAKTX.
        PERFORM get_mara.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            PERCENTAGE = 100
            TEXT       = '&#22788;&#29702;&#22909;&#25968;&#25454;,&#24182;&#24320;&#22987;&#26174;&#31034;&#25968;&#25454;'.
        PERFORM do_data.
        PERFORM display_alv.
      ELSE.
        PERFORM get_MAKTX.
        PERFORM do_ftp.
      ENDIF.
    *&      Form  get_marktx
          text
    FORM get_maktx.
      SELECT MATNR MAKTX INTO TABLE IT_MAKT FROM MAKT
      WHERE MATNR IN R_MATNR AND SPRAS = '1'.
    ENDFORM.                    "get_marktx
    *&      Form  get_mara
          text
    FORM get_mara.
      SELECT * INTO TABLE it_mara FROM MARA
      WHERE MATNR IN R_MATNR.
    ENDFORM.                    "get_mara
    *&      Form  do_data
          text
    FORM do_data.
      SORT IT_MARC BY MATNR WERKS.
      DELETE ADJACENT DUPLICATES FROM IT_MARC COMPARING MATNR WERKS.
      LOOP AT IT_MARC.
        CLEAR IT_MAKT.
        CLEAR IT_MARA.
        READ TABLE IT_MAKT WITH KEY MATNR = IT_MARC-MATNR.
        READ TABLE IT_MARA WITH KEY MATNR = IT_MARC-MATNR.
        MOVE-CORRESPONDING IT_MARA TO IT_OUT.
        IT_OUT-MAKTX = IT_MAKT-MAKTX.
        IT_OUT-WERKS = IT_MARC-WERKS.
        IF IT_MARC-FLAG_UI = 'U'.
          IT_OUT-ERNAM = IT_MARC-USERNAME.
        ENDIF.
        APPEND IT_OUT.
        CLEAR IT_OUT.
      ENDLOOP.
    ENDFORM.                    "do_data
    *SELECT AMATNR BMAKTX INTO CORRESPONDING
    *FIELDS OF FTP_ITEMDOC1 FROM MARA AS A JOIN MAKT AS B
    *ON AMATNR = BMATNR WHERE A~ERSDA = l_ersda
    *AND B~SPRAS = '1' . "&#20195;&#34920;&#20026;&#20013;&#25991;&#35828;&#26126;&#12290;
    APPEND FTP_ITEMDOC1.
    *******DEVK909212****************
    *******&#28155;&#21152;RANGE*****************
    CLEAR R_MATNR.
    R_MATNR-SIGN = 'I'.
    R_MATNR-OPTION = 'EQ'.
    R_MATNR-LOW = FTP_ITEMDOC1-MATNR.
    APPEND R_MATNR.
    CLEAR  FTP_ITEMDOC1.
    *******DEVK909212****************
    *ENDSELECT.
    *******DEVK909212****************
    ****get WERKS information from MARC*******
    *SELECT MATNR WERKS INTO TABLE IT_MARC
    *FROM MARC
    *WHERE MATNR IN R_MATNR.
    *******DEVK909212****************
    ******DEVK909212****************
    **MARK**************************
    *LOOP AT FTP_ITEMDOC1 .
    MOVE : FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_ITEMDOC-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_ITEMDOC-MAKTX.
    APPEND FTP_ITEMDOC.
    CLEAR FTP_ITEMDOC.
    *ENDLOOP.
    ******DEVK909212****************
    ******DEVK909212***********************************
    **&#26681;&#25454;IT_MARC&#20013;&#20449;&#24687;&#65292;&#24448;&#21271;&#20140;&#21644;&#31119;&#28165;&#30340;TABLE&#20889;&#25968;&#25454;*****
    FORM do_ftp.
      LOOP AT IT_MARC.
    ***&#31119;&#28165;&#30340;
        IF IT_MARC-WERKS = '1010' OR IT_MARC-WERKS = '1020'
           OR IT_MARC-WERKS = '1023' .
         READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
         MOVE : FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_FUQING-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_FUQING-MAKTX.
          CLEAR IT_MAKT.
          READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
          MOVE : IT_MARC-MATNR TO FTP_FUQING-MATNR,
             IT_MARC-MATNR TO FTP_FUQING-MATNR1,
             IT_MAKT-MAKTX TO FTP_FUQING-MAKTX.
          APPEND FTP_FUQING.
          CLEAR FTP_FUQING.
        ENDIF.
    ***&#21271;&#20140;&#30340;
        IF IT_MARC-WERKS = '1041' OR IT_MARC-WERKS = '1042'.
         READ TABLE FTP_ITEMDOC1 WITH KEY MATNR = IT_MARC-MATNR.
         MOVE : FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR,
            FTP_ITEMDOC1-MATNR TO FTP_BEIJING-MATNR1,
            FTP_ITEMDOC1-MAKTX TO FTP_BEIJING-MAKTX.
          CLEAR IT_MAKT.
          READ TABLE IT_MAKT WITH KEY = IT_MARC-MATNR.
          MOVE : IT_MARC-MATNR TO FTP_BEIJING-MATNR,
                 IT_MARC-MATNR TO FTP_BEIJING-MATNR1,
                 IT_MAKT-MAKTX TO FTP_BEIJING-MAKTX.
          APPEND FTP_BEIJING.
          CLEAR FTP_BEIJING.
        ENDIF.
      ENDLOOP.
    ****&#28165;&#26970;&#37325;&#22797;&#30340;&#25968;&#25454;**********
      SORT FTP_FUQING.
      DELETE ADJACENT DUPLICATES FROM FTP_FUQING.
      SORT FTP_BEIJING.
      DELETE ADJACENT DUPLICATES FROM FTP_BEIJING.
    ***&#20256;&#36865;&#25968;&#25454;********
      REFRESH FTP_ITEMDOC.
      FTP_ITEMDOC[] = FTP_FUQING[].
      FTP_WERKS = '1010'.
      PERFORM ftp_work.
      REFRESH FTP_ITEMDOC.
      FTP_ITEMDOC[] = FTP_BEIJING[].
      FTP_WERKS = '1041'.
      PERFORM ftp_work.
    ******DEVK909212***********************************
    ENDFORM.                    "do_ftp
    *&      Form  ftp_work
         &#25226;&#20197;&#21069;FTP&#30340;&#24037;&#20316;&#20570;&#19968;&#20010;FORM
    *******DEVK909212**************************
    FORM ftp_work.
    *******DEVK909212**************************
      CHECK FTP_ITEMDOC[] IS NOT INITIAL.
    FTP function *****************************************************
      DATA : HDL TYPE I,
             L_SLEN TYPE I ,
             ERROR,
             KEY TYPE I VALUE 26101957,
             DEST TYPE RFCDES-RFCDEST VALUE 'SAPFTPA'.
      DATA: FTP_RESULT TYPE TABLE OF TEXT.
      DATA: P_FILE TYPE RLGRAP-FILENAME.
      DATA: L_USER(16) TYPE C VALUE 'SFIS',
            L_PWD(16) TYPE C VALUE 'SFIS',
            L_HOST(16) TYPE C VALUE '172.16.31.17'.
    *******DEVK909212**************************
    *****&#26681;&#25454;&#19981;&#21516;&#30340;&#24037;&#21378;&#26469;&#25235;FTP&#30340;&#20449;&#24687;
      CALL FUNCTION 'Z_FTP_SFIS'
        EXPORTING
          BLART = 'S'
          WERKS = FTP_WERKS
        IMPORTING
          HOST  = L_HOST
          USER1 = L_USER
          PASS1 = L_PWD.
    *******DEVK909212**************************
      CONCATENATE l_ersda '.KP' INTO P_FILE.
      SET EXTENDED CHECK OFF.
      ERROR = 0.
      CHECK HDL IS INITIAL.
    Connect to server
      L_SLEN = STRLEN( L_PWD ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = L_PWD
          SOURCELEN   = L_SLEN
          KEY         = KEY
        IMPORTING
          DESTINATION = L_PWD.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
         TEXT = 'Connect to FTP Server'.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = L_USER
          PASSWORD        = L_PWD
          HOST            = L_HOST
          RFC_DESTINATION = DEST
        IMPORTING
          HANDLE          = HDL
        EXCEPTIONS
          NOT_CONNECTED   = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE        = HDL
          COMMAND       = 'ascii'
        TABLES
          DATA          = FTP_RESULT
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3.
      IF SY-SUBRC <> 0.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = P_FILE
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = FTP_ITEMDOC
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      IF SY-SUBRC <> 0.
        EXPLAIN_MSG SY-MSGID SY-MSGNO ' ' SY-MSGV1 SY-MSGV2 SY-MSGV3
                    SY-MSGV4 WA_ZMSGTA-MSE1.
        MOVE: 'B' TO WA_ZMSGTA-BLART,
              l_ersda  TO WA_ZMSGTA-REFNUMBER,
              SY-MSGTY TO WA_ZMSGTA-MSGTY,
              'MARA' TO WA_ZMSGTA-TBMA_VAL.
        ERROR_MSG_UPDATA WA_ZMSGTA.
        EXIT.
      ENDIF.
    *******DEVK909212**************************
    *******CLOSE FTP******************
      CHECK NOT HDL IS INITIAL.
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          HANDLE = HDL.
      CALL FUNCTION 'RFC_CONNECTION_CLOSE'
        EXPORTING
          DESTINATION = DEST
        EXCEPTIONS
          OTHERS      = 1.
      CLEAR HDL.
    ENDFORM.                    "ftp_work
    *******DEVK909212**************************
    FORM DISPLAY_ALV .
    *-- PREPARE ALV DATA
      PERFORM EVENTTAB_BUILD USING GT_EVENTS[].
      PERFORM COMMENT_BUILD  USING GT_LIST_TOP_OF_PAGE[].
    *-- LAYOUT SETTING
      PERFORM PREPARE_ALV_FIELD USING GT_FIELDCAT[].
    *-- ALV DISPLAY
      PERFORM CALL_REUSE_ALV_GRID_DISPLAY.
    ENDFORM.                    " display_alv
    *&      Form  eventtab_build
          text
         -->P_GT_EVENTS[]  text
    FORM EVENTTAB_BUILD USING PT_EVENTS TYPE SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = PT_EVENTS.
      READ TABLE PT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        LS_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY PT_EVENTS FROM LS_EVENT INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " eventtab_build
    *&      Form  comment_build
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM COMMENT_BUILD  USING PT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER,
            L_DATE(30),
            l_v_BWKEY like T001W-BWKEY,  "Valuation area
            l_v_BUKRS like T001K-BUKRS.  "Firm/Company
    Listen&#57692;erschrift: Typ H
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  not used for this type
    select single BWKEY
       into l_v_BWKEY
       from t001w
       where WERKS IN s_WERKS.
    select single BUKRS
       into l_v_BUKRS
       from t001k
       where BWKEY = l_v_BWKEY.
    SELECT SINGLE butxt INTO LS_LINE-INFO
        FROM t001
       WHERE bukrs = l_v_BUKRS.
    APPEND LS_LINE TO PT_TOP_OF_PAGE.
    Kopfinfo: Typ S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25253;&#34920;&#21517;&#31216;&#65306;'.
      LS_LINE-INFO = SY-TITLE.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25171;&#21360;&#26085;&#26399;&#65306;'.
      WRITE SY-DATUM TO LS_LINE-INFO.
    ls_line-info = sy-datum.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#25171;&#21360;&#26178;&#38291;&#65306;'.
      WRITE SY-UZEIT TO LS_LINE-INFO.
    ls_line-info = sy-uzeit.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = '&#20351;&#29992;&#32773;&#65306;'.
      LS_LINE-INFO = SY-UNAME.
      APPEND LS_LINE TO PT_TOP_OF_PAGE.
    ENDFORM.                    " comment_build
    *&      Form  prepare_alv_field
          text
         -->P_GT_FIELDCAT[]  text
    FORM PREPARE_ALV_FIELD USING P_FIELDCAT TYPE  SLIS_T_FIELDCAT_ALV.
      DATA: LS_LINE TYPE  SLIS_FIELDCAT_ALV.
    *-- DEFINE MARCO
      DEFINE APPEND_ALV_FIELD.
        CLEAR LS_LINE.
        LS_LINE-FIELDNAME = &1.
        LS_LINE-TABNAME = &2.
        LS_LINE-REPTEXT_DDIC = &3.
        LS_LINE-SELTEXT_L = &3.
        LS_LINE-SELTEXT_M = &3.
        LS_LINE-SELTEXT_S = &3.
        LS_LINE-QFIELDNAME = &4.
        LS_LINE-QTABNAME = &5.
        LS_LINE-NO_OUT    = &6.
        LS_LINE-NO_ZERO   = &7.
        LS_LINE-OUTPUTLEN = &8.
        APPEND LS_LINE TO P_FIELDCAT.
      END-OF-DEFINITION.
      APPEND_ALV_FIELD: 'MATNR' 'IT_OUT' '&#26009;&#21495;'
                      'O' 'X' ''.
      APPEND_ALV_FIELD: 'WERKS' 'IT_OUT' '&#24037;&#21378;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MTART' 'IT_OUT' 'MTyp'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MEINS' 'IT_OUT' 'BUn'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MATKL' 'IT_OUT' '&#29289;&#26009;&#32452;\&#20998;&#32676;&#30721;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'MATKX' 'IT_OUT' '&#29289;&#26009;&#25551;&#36848;'
                        'O' 'X' ''.
      APPEND_ALV_FIELD: 'PSTAT' 'IT_OUT' '&#32500;&#25252;&#29366;&#24577;'
                        'O' 'X' ''.
      APPEND_ALV_FIELD: 'BRGEW' 'IT_OUT' '&#27611;&#37325;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'NTGEW' 'IT_OUT' '&#20928;&#37325;'
                       'O' 'X' ''.
      APPEND_ALV_FIELD: 'GEWEI' 'IT_OUT' 'WUn'
                      'O' 'X' ''.
      APPEND_ALV_FIELD: 'FERTH' 'IT_OUT' '&#23545;&#22806;&#26426;&#31181;&#21517;'
                     'O' 'X' ''.
      APPEND_ALV_FIELD: 'KZUMW' 'IT_OUT' '&#39640;&#20851;&#31246;&#26631;&#35782;'
                   'O' 'X' ''.
      APPEND_ALV_FIELD: 'ERNAM' 'IT_OUT' '&#21019;&#24314;&#32773;'
                 'O' 'X' ''.
      APPEND_ALV_FIELD: 'ERSDA' 'IT_OUT' '&#21019;&#24314;&#26085;&#26399;'
              'O' 'X' ''.
    ENDFORM.                    " prepare_alv_field
    *&      Form  call_reuse_alv_grid_display
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_REUSE_ALV_GRID_DISPLAY .
      gs_layout-f2code              = 'DISPLAY'.
      gs_print-no_print_listinfos   = 'X'.
      gs_layout-colwidth_optimize   = 'X'.       "&#21015;&#23485;&#24230;&#33258;&#21160;&#26681;&#25454;&#20869;&#23481;&#20248;&#21270;
    gs_layout-f2code              = '&ETA'.    "double check&#24377;&#20986;&#35814;&#32454;&#20449;&#24687;
      gs_layout-zebra               = 'X'.       "&#28165;&#21333;&#26465;&#32441;&#26174;&#31034;
      gs_layout-no_vline            = ''.        "&#26159;&#21542;&#26174;&#31034;&#21015;&#38388;&#38548;&#32447;
      gs_layout-box_fieldname       = ''.        "&#26159;&#21542;&#26174;&#31034;checkbox
      gs_layout-confirmation_prompt = ''.        "&#25512;&#20986;&#28165;&#21333;&#26159;&#21542;&#25552;&#31034;
      gs_layout-detail_titlebar     = '&#35814;&#32454;&#20449;&#24687;'."&#35814;&#32454;&#28165;&#21333;&#30340;&#26631;&#39064;
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM                = SY-CPROG
          I_BACKGROUND_ID                   = 'ALV_BACKGROUND'
         I_CALLBACK_PF_STATUS_SET          = 'ALV_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'ALV_USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = GT_LIST_TOP_OF_PAGE[]
          IT_FIELDCAT                       = GT_FIELDCAT[]
          IT_EVENTS                         = GT_EVENTS[]
          I_STRUCTURE_NAME                  = 'IT_OUT'
          I_SAVE                            = 'A'
          IS_LAYOUT                         = GS_LAYOUT
          IS_PRINT                          = GS_PRINT
        TABLES
          T_OUTTAB                          = IT_OUT
        EXCEPTIONS
          PROGRAM_ERROR                     = 1
          OTHERS                            = 2
      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.                    " call_reuse_alv_grid_display
    *&      Form  PREPARE_ALV_FIELD
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    ENDFORM.                    "TOP_OF_PAGE

    Hi,
    Please check your field catalog and refer field names once again.
    Check spelling, or Check strucutre properly.
    There are something wrong in your catalog definition
    aRs.

  • DW8 grabs remote file when I try to edit local file

    DW8 acts like it was programmed this way, but it is not
    correct behavior. Perhaps someone can shed some light on this for
    me.
    I have the local website on a mapped network drive to a
    different server, and the remote (live) site is on another server
    only accessible via FTP. When I have the Files View drop-down set
    to Local View and the [Connects to remote host] button is NOT
    depressed, I should be able to double-click an .htm file and have
    it open up for editing. So, I do that and it then asks if I want to
    Get Dependent Files. I always say NO to this question. When the
    file opens, for some reason it has grabbed the REMOTE version from
    the live server (via FTP, I assume) without telling me it is doing
    that, and it has overwritten the local copy of the file. This is
    bad because other people in the office use different web editors,
    and they did work on that file prior to me trashing it....rats!!!
    WHY is DW8 grabbing the remote file for editing when I don't
    want it to? I want to edit the dang LOCAL file like I expect!! What
    am I doing wrong? Or is DW8 doing it wrong, and everyone in the
    world just expects it to be that way? How can I edit ONLY the local
    version of a file that exists on the remote server? I found that if
    the file is NOT on the remote server, then it simply opens the
    local file for editing as usual. I do not remember MX2004 acting
    this way because I never had that problem prior to my DW8 upgrade.
    Perhaps a clue is the dialog box that pops up asking if I
    want to "get dependent files"...the word GET is suspicious to
    me....
    HELP!!!! TIA!

    CI/CO uses the remote site as the resource for files, not the
    local site.
    The scheme is -
    1. You check out from the remote site
    2. You edit and save intermediate steps locally
    3. When editing is finished, you check in to the remote site
    This way, nobody can GET a file that you have already checked
    out until you
    check it back in.
    When you double click a local file in the File manager, if
    that file is NOT
    checked out to you, it will be checked out to you FROM THE
    REMOTE site. If
    it is checked out to you, it will open from your local site.
    > That action
    > doesn't make sense.
    Unfortunately, it makes complete sense.
    Read your help files on CI/CO again....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "i.am.mushu" <[email protected]> wrote in
    message
    news:[email protected]...
    > Yes I do. Why does that make it grab the remote file
    though?? That action
    > doesn't make sense. I want to be able to edit the file
    locally (mapped
    > network
    > drive) then when I do a PUT or CheckIn I want it to go
    to the remote
    > server.
    > When I am working on it locally, I want the .LCK file to
    exist as a
    > warning
    > that it is being worked on currently. Nothing in this
    outline suggests
    > that it
    > makes sense for DW8 to go grab the REMOTE file and
    OVERWRITE the local
    > file
    > before opening it for me to edit...?!?
    >
    >
    quote:
    Originally posted by:
    Newsgroup User
    > Do you have Checkin/Checkout enabled?
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    > ==================
    >
    >
    > "i.am.mushu" <[email protected]> wrote
    in message
    > news:[email protected]...
    > > DW8 acts like it was programmed this way, but it is
    not correct
    > > behavior.
    > > Perhaps someone can shed some light on this for me.
    > >
    > > I have the local website on a mapped network drive
    to a different
    > > server,
    > > and
    > > the remote (live) site is on another server only
    accessible via FTP.
    > > When
    > > I
    > > have the Files View drop-down set to Local View and
    the [Connects to
    > > remote
    > > host] button is NOT depressed, I should be able to
    double-click an .htm
    > > file
    > > and have it open up for editing. So, I do that and
    it then asks if I
    > > want
    > > to
    > > Get Dependent Files. I always say NO to this
    question. When the file
    > > opens, for
    > > some reason it has grabbed the REMOTE version from
    the live server (via
    > > FTP, I
    > > assume) without telling me it is doing that, and it
    has overwritten the
    > > local
    > > copy of the file. This is bad because other people
    in the office use
    > > different
    > > web editors, and they did work on that file prior
    to me trashing
    > > it....rats!!!
    > >
    > > WHY is DW8 grabbing the remote file for editing
    when I don't want it to?
    > > I
    > > want to edit the dang LOCAL file like I expect!!
    What am I doing wrong?
    > > Or
    > > is
    > > DW8 doing it wrong, and everyone in the world just
    expects it to be that
    > > way?
    > > How can I edit ONLY the local version of a file
    that exists on the
    > > remote
    > > server? I found that if the file is NOT on the
    remote server, then it
    > > simply
    > > opens the local file for editing as usual. I do not
    remember MX2004
    > > acting
    > > this
    > > way because I never had that problem prior to my
    DW8 upgrade.
    > >
    > > Perhaps a clue is the dialog box that pops up
    asking if I want to "get
    > > dependent files"...the word GET is suspicious to
    me....
    > >
    > > HELP!!!! TIA!
    > >
    >
    >
    >
    >
    >
    >

  • Firefox freezes when using "Save link as" or doing anything that needs to browse local file directory?

    System: Windows XP, Firefox 17.0.1.
    Firefox freezes when doing anything that needs to browse local directory such as saving file, uploading, etc....For example, can't save any image using "save link as". When attaching a file in email, whenever the browsing to other location on the hard drive will freeze firfox, which turns to "not responding"....

    We're sorry to hear that your Firefox seems to be crashing. Please perform the following steps to give us a crash report ID that helps us find out more about the cause of the crash.
    #Enter about:crashes in the Firefox location bar (that's where you enter your website names) and press Enter. You should now see a list of submitted crash reports.
    #Copy the most recent 5 report IDs that you see in the crash report window and paste them into your forum response.
    Thanks in advance for your help!
    More information and further troubleshooting steps can be found in the [[Firefox crashes]] article.

  • SystemManager.as : 'should never get here' when uploading multiple files

    I have a code for uploading multiple files. The code works so that when complete event from the first upload is received, the second upload is started. The code works fine on Flash Player 9, but now when I changed my compiler settings to require version 10, the program no longer works.
    Also this only seems to occur when I execute the code from the Flash Builder. I have compiled the code with ant requiring FP version 10. This swf is bundled inside a war and can executed without any problems. I actually set the ant compiler to require FP 10 some time ago already.
    I get error 2174, which is for trying to upload multiple files at the same time. Although, I don't understand why I get this, since the uploads should not be done simultaneously as I explained above.
    The interesting thing here is when I try to debug it. At some point when stepping in the code, I get the following error thrown. It's thrown by the code pasted at the end. Interesting is the else block that throws the error, the comment says 'should never get here'.
    A bug in the framework or in Flex Builder?
    Using IE 8 with FP 10.0.32.18 (on Win XP if that matters).
    Thanks.
    Error
         at mx.managers::SystemManager/updateLastActiveForm()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:5087]
         at mx.managers::SystemManager/activateForm()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2352]
         at mx.managers::SystemManager/activate()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2307]
         at mx.managers::FocusManager/creationCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:1592]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
         at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
         at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
         at Function/http://adobe.com/AS3/2006/builtin::apply()
         at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
         at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]
         private function updateLastActiveForm():void
              // find "form" in the forms array and move that entry to
              // the end of the array.
              var n:int = forms.length;
              if (n < 2)
                 return;     // zero or one forms, no need to update
              var index:int = -1;
              for (var i:int = 0; i < n; i++)
                 if (areFormsEqual(form, forms[i]))
                      index = i;
                      break;
              if (index >= 0)
                 forms.splice(index, 1);
                 forms.push(form);
              else
                 throw new Error();     // should never get here

    Thanks for the reply Alex.
    In both cases the URL is http. The only difference is that in one case everything is on server inside a war running on Tomcat to which I make connection via browser. In the other case the server side stuff is running on local computer on Tomcat and the Flex code is not bundled inside the war.
    In both cases the URL is in form of http://... When running locally, the URL is http://localhost:8080/myAppName. I don't know how the network card driver translates this URL, but what you said might have something to do with it.

  • Is it possible to load flat file data residing on a local machine via BODS 4.2 or flat file should reside on BODS server?

    Hi All,
    I have a requirement to load data from flatfiles stored on particular location, on a machine on which BODS client istallation is there.
    I am able to create a flat file format by browsing the file location and giving file name.I can view the file data also.
    But when I execute the job, job failswith the error "Cannot open file <D:/BODS_flatfiles/result.txt>. Check its path and permissions".
    Please let me know whether it is possible to load data from flat file on a local machine, which has BODS4.2 client installated on it or the flat file should reside in a path in BODS job server ?
    Thanks,
    Deepa

    Hi Deepa,
    If you get solution then please mark answer as correct and close the tread!
    Thanks,
    Swapnil

  • HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

    Well this morning I woke up to see that my site hosted on Windows Azure was producing 50X errors and in general being incredibly slow (up to 60 seconds response time).
    Now after looking through the DetailedErrors folder I see that the error received is:
    HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
    I tried creating a new test website and host it and guess what? I receive the exact same error here as well.
    What could be causing this?

    hi,
    Do you use windows azure website in Europe ? According to azure dashboard shown,
    Some customers may experience intermittent time out errors or slow response when accessing their web sites. Please see this image: 
    And now, you could try it again.
    If I misunderstand, please let me know.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • I can't get Itunes to work with windows 8.1

    I saved my ITunes file from my old XP computer to my external hard drive. On my new Win 8.1 computer I downloaded the  64 bit version of Itunes. I changed the default location of the ITune file to my D(data) drive. My C drive is solid state and I did

  • Question about File upload functionality in Weblogic

    Hi,     We're currently trying to deploy a web application on the weblogic 12c server (via war file). And the app needs to upload a text file onto the a temperary directory within weblogic server. And on the web page side, we use JQuery File upload p

  • N70 - CALLER CAN'T HEAR ME!

    Anyone experienced a problem with their N70 where you accept a call and begin to talk however after a few seconds I can no longer hear the caller. If I switch to loudspeaker mode it sometimes works ok again but not when in handset mode. Have been to

  • Complex use of private synonyms

    I need to write a create user script that sets up our database. for production this is easy, but for development and test it gest complicated. We have 1 user that contains all of our data tables. another user that has all our code and our logging dat

  • Location data not uploaded to flickr ?

    am i right in assuming that when uploading to flickr from iphoto, that the map places are not uploaded to flickr with the image ? i tested one that has been placed on the map in iphoto, but when viewing the image in flickr there is no location info o