Skip to Content
avatar image
Former Member

Binary download to unmapped drive (NOT!!!!! GUI_DOWNLOAD)

Is there a download function other than GUI_DOWNLOAD that will download a binary file to a client file system directory that is not physically on a user's PC and not mapped by the user on his or her PC?

Please advise at your earliest convenience.

Thanks

djh

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 08, 2007 at 07:49 PM

    I think there's a SAP whitepaper that addresses this.

    Rob

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2007 at 07:57 PM

    Hi David,

    I didn't clearly understand the question,

    Do you Want to download a file into another pc that is not mapped on the PC where you are working?

    If this is the question, and the target file system can be access by local network, maybe you should try donwload the file using:

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

    my_file = '//any_network_dir/any_file.any'.

    Try.

    OPEN DATASET my_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    loop at (your binary file) assigning (any_fieldsymbol). "If necesary

    transfer (any_fieldsymbol) TO my_file.

    endloop. "If necesary

    CLOSE DATASET my_file.

    catch cx_(any exception)

    endtry.

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

    Since de GUI_ functions only work in foreground mode on the calling PC and you don't have the mapping with the foreing file system, you can't dowload this file in ussing GUI_ functions,

    I hope it helps,

    Regards,

    John.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2007 at 08:48 PM

    I am not sure if it is possible. If the file system is not physically on the user's PC and not even mapped, then the user cannot even save a file using MS Word, leave alone doing it from SAP. Unless I understood your question completely wrong, I don't think it is possible.

    Add comment
    10|10000 characters needed characters exceeded

    • At least I haven't heard of one that would allow a file to be created on a ghost (I am using the term losely to indicate that it is not visible in any directory browser) directory. Mind if I ask what is the scenario you are looking to find a solution for?

  • avatar image
    Former Member
    Oct 09, 2007 at 03:27 AM

    FM and TABLES

    http://72.14.235.104/search?q=cache:71IXBMWcX_8J:reflexcontracts.co.uk/SAP_R3_QUICK_REF.xlsupdatetable+tse05&hl=en&ct=clnk&cd=1&gl=in

    FUNCTION MODULES

    http://www.erpgenie.com/abap/functions.htm

    http://www.sapdevelopment.co.uk/fmodules/fmssap.htm

    http://www.erpgenie.com/abap/index.htm

    http://www.geocities.com/victorav15/sapr3/abapfun.html

    Rewards if useful.........

    Minal

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 09, 2007 at 01:48 PM

    Rob -

    That's a neat RFC - thanks very much for providing the link. It's not relevant to our needs here, but it is good to know of for future reference,

    djh

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 09, 2007 at 04:26 PM

    Hi Srinivas -

    This need arises only because the client has not yet moved from storage of internal GOS attachments in the DB table SOFFDB1 to storage of such attachments in a BDS subsystem or external content server etc. (I've blogged and posted about this at length before - so I apologize for boring folks who are already familiar with this sad story.)

    OK - you've got a jpg binary sitting in SOFFDB1.

    The client wants you to pop this jpg in an SAP picture control, and when the picture is double clicked, the client wants you to bring up a full-size copy in the SAP HTML viewer control.

    Of course, you need a URL to pass the picture control or the HTML viewer control - neither of these classes have a method "load_binary_direct" that you can pass your jpg to.

    So what we had to do is read the jpg out of SOFFDB1, download it to a drive, and then pass the directory path of this file as a "file:// ...." URL to the two controls.

    Now, we have users in multiple plants across the world that have to execute the code that does this, and all these users will have to have the same drive letter mapped on their workstations - the drive we use when we download the jpg that we've retrieved from SOFFDB1.

    But if SAP could write directly to an unmapped drive using a "raw" path, then we'd avoid the problem of trying to find a drive letter that none of the users have already used on their workstations.

    What's interesting is that the HTML viewer can <b>read</b> from such an unmapped path - it's just that the GUI_DOWNLOAD function can't write to an unmapped path.

    Hope that clarified why I asked the question.

    Of course, if we got rid of SOFFDB1 and went to an external content server, the whole problem would go away because every stored binary would have a URL - same as if we went to BDS. (By the way - where is BDS - its area has been removed from the online documentation ....?)

    Better yet, we could go to Documentum - which we're in the process of doing ...

    Best regards

    djh

    Add comment
    10|10000 characters needed characters exceeded

    • I got it. Have you tried looking into the approach that when you normally try to download or upload to pc file, system brings in a default directory?

      May be that is where you can create a temporary directory and download the file to. Take a look at the method GET_UPLOAD_DOWNLOAD_PATH of CL_GUI_FRONTEND_SERVICES class and also at GET_SAPGUI_WORKDIR method. This is the class that probably will help you in achieving what you want.

  • Oct 09, 2007 at 09:38 PM

    Funny you should say that, Srinivas, because that, of course, is exactly what happens.

    SO_OBJECT_DOWNLOAD calls the download method of cl_gui_frontend_services which of course calls our old friend GUI_DOWNLOAD. (We start with SO_OBJECT_DOWNLOAD to get type compatibility with the format of the binary file we've pulled out of the table SOFFDB1 using a different function in SO30.)

    But before GUI_DOWNLOAD is called, SAP tries to interpret the path that you've given SO_OBJECT_DOWNLOAD, and if it can't interpret this path in terms of the mapped and local drives on the workstation that's executing the code, then it creates whatever directories it needs under the SAP default work directory on C, and then puts the file there.

    So, you might ask - why not just let each users' temp files go to this path on the user's C drive.

    Well the answer is as follows.

    In order to avoid constantly extracting the same binaries over and over again from SOFFDB1, we write any given binary to our designated mapped drive the first time we have to get it from the database. Then the next time this binary is requested, we check to see if we have it on the mapped drive, and if we do, we just pass the URL to the picture control and the viewer control.

    In effect - we have created our own mini-content-server on the mapped drive.

    And since many different users can reqest the same binary, we need a single common place to look for the binaries on disk, not a hundred C drives scattered around the world - that's why we don't leave the files on each user's C drive.

    Anyway, as I said earlier, please bear in mind that all of the above is one HUMONGOUS kluge which is going to go away as soon as we have Documentum or an external content server up-and-running, whichever comes first.

    So we're not doing all of the above because we want to - it's our only choice right now.

    Best regards

    djh

    Add comment
    10|10000 characters needed characters exceeded