Create a Document with an original file stored on application server

Hello,
I start with document managment system : i am able to create new document (CV01N) manually, add a local file and check-in this file.
Now we need to store file which are stored on the SAP Application Server.
Firstly, in the GUI of transaction CV01N, i don't know how to browse file on application server. All files i can't attach as original, are files i can access from my computer.
Is it possible to access also on application server files ?
Moreover, i have to define function module which have to
- Create a document (DMS)
- Attach an orginial file which is stored on application server
- Check-in the file
This function module will be called from a web application
I define this kind of function and run it correctly with a local file (stored on my computer) : i call BAPI "BAPI_DOCUMENT_CREATE2" and "BAPI_DOCUMENT_CHECKIN2"
But i don't how to do with a file stored on application server. I see also note 504692 and try a program like ZZUZTEST_TEST_CHECKIN which use FM CVAPI_DOC_CHECKIN but it return an error Error uploading  E:\usr\sap\TD1\DVEBMGS00\data\FACTURE.txt" (this path and file exist on application server and is really the file i want to checkin)
Please could you confirm what i search, is possible or not.
If possible, could help me with some explanations and guidelines and perhaps a sample ?
Thank you very much.
Regards,
Eric
The function used
FUNCTION Z_TEST_CHECKIN.
Checkin the first original of a document info record *
from the application server and/or in the background *
  data   : w_host like BAPI_DOC_AUX-HOSTNAME.
  data: lf_line(255).
  data: ls_draw like DRAW,
        ls_message_cvapi like messages,
        lt_files_cvapi type standard table of CVAPI_DOC_FILE,
        lt_files_cvapi_header like CVAPI_DOC_FILE.
  data: lt_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE,
        vo_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE.
  ls_draw-dokar = 'ZFT'.
  ls_Draw-doknr = '0000000000000004500000032'.
  ls_Draw-dokvr = '00'.
  ls_Draw-doktl = '000'.
Read Originals contained in the document info record
  CALL FUNCTION 'CVAPI_DOC_GETDETAIL'
    EXPORTING
      pf_batchmode    = 'X'
      pf_hostname     = ' '
      pf_dokar        = ls_draw-dokar
      pf_doknr        = ls_draw-doknr
      pf_dokvr        = ls_draw-dokvr
      pf_doktl        = ls_draw-doktl
      pf_active_files = 'X'
    IMPORTING
      psx_draw        = ls_draw
    TABLES
      pt_files        = vo_originals
    EXCEPTIONS
      not_found       = 1
      no_auth         = 2
      error           = 3
      OTHERS          = 4.
  IF sy-subrc <> 0.
    WRITE 'Error returned by CVAPI_DOC_GETDETAIL'.          "#EC NOTEXT
    EXIT.
  ENDIF.
Check if we can really access the file from the application server
  read table vo_originals index 1.
  open dataset vo_originals-filename for input in text mode ENCODING DEFAULT.
  if not sy-subrc is initial.
    message e500(26) with vo_originals-filename 'not found'.
  endif.
  read dataset vo_originals-filename into lf_line.
  if not sy-subrc is initial.
    message e500(26) with vo_originals-filename 'read error'.
  endif.
  lt_originals             = vo_originals.
  lt_originals-STORAGE_CAT = 'SAP-SYSTEM'.
  append lt_originals.
  w_host = sy-host.
  CALL FUNCTION 'CVAPI_DOC_CHECKIN'
  EXPORTING
  PF_DOKAR = ls_draw-dokar
  PF_DOKNR = ls_draw-doknr
  PF_DOKVR = ls_draw-dokvr
  PF_DOKTL = ls_draw-doktl
PS_DOC_STATUS =
  PF_FTP_DEST = 'SAPFTPA'
  PF_HTTP_DEST = 'SAPHTTPA'
*PF_HOSTNAME =  w_host
PS_API_CONTROL =
PF_REPLACE = ' '
PF_CONTENT_PROVIDE = 'SRV'
  IMPORTING
  PSX_MESSAGE = ls_message_cvapi
  TABLES
  PT_FILES_X = lt_originals
PT_COMP_X =
PT_CONTENT =
  IF ls_message_cvapi-msg_type CA 'EA'.
    ROLLBACK WORK.
    MESSAGE ID '26' TYPE 'I' NUMBER '000'
    WITH ls_message_cvapi-msg_txt.
  ELSE.
    COMMIT WORK and wait.
  ENDIF.
ENDFUNCTION.

This is a bit tricky. I spent lots of hours about this .
You have to set PF_HOSTNAME with your name of your AS and gives the path to the file on the server.
You wrote
*PF_HOSTNAME = w_host
But beware: if you have more thän one AS you have to fix one AS for upload or you have to find the servers name of the file. A better way can be to share one folder by each AS.
You also have to decide between HTTP or FTP.
You wrote:
  PF_FTP_DEST = 'SAPFTPA'
  PF_HTTP_DEST = 'SAPHTTPA'
You must define only one ! Then you have to check your settings in SM59 about working right.
Pls rate, if this was helpful.
Regards,
Markus

Similar Messages

  • Opening a file stored at application server

    Experts,
        I have put a document on application server using DATASET .
       Now I want to open the same file from there only.
       ho to do that.
    Thnx in Advance
    Chetan

    Hi Chetan ,
    U can use following code to open the file u created in application server.
    1.
    data: <dataset_name>(25)  value '.\tmp\file_sarang_01.txt'.
    open dataset <dataset_name> for input in text mode encoding UTF-8
    read dataset <dataset_name> into itab_wa.
    Append itab_wa to itab.
    close dataset <dataset_name>
    loop at itab.
    write: itab-field1 , itab-field2 .
    endloop.
    2.  U can use transaction CG3Y  , to save file from application server to presentation server directly.(A short cut for u)
    I hope this solves ur problem
    Reagrds.
    Note: Reward if useful

  • How to create the document with originals and checkin that document

    I am using this 2 bapi for creating DMS ,
    BAPI_DOCUMENT_CREATE2
    BAPI_TRANSACTION_COMMIT
    BAPI_DOCUMENT_CHECKIN2
    BAPI_TRANSACTION_COMMIT
    at last we want to c in DRAO table the created doc no should be updated here.
    But it not updating.how can i update in the table..
    Please tell via code..

    How do you call BAPI_DOCUMENT_CREATE2?
    I just tried with the example given in the documentation and with a little adjustment I created a document with an original which appears in the DMS_DOC_FILES table.
      DATA: ls_doc    LIKE bapi_doc_draw2,
            ls_return LIKE bapiret2.
      DATA: lf_doctype    LIKE bapi_doc_draw2-documenttype,
            lf_docnumber  LIKE bapi_doc_draw2-documentnumber,
            lf_docpart    LIKE bapi_doc_draw2-documentpart,
            lf_docversion LIKE bapi_doc_draw2-documentversion.
      DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
            lt_drat  LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE.
      ls_doc-documenttype    = 'Z01'.
      ls_doc-documentversion = '01'.
      ls_doc-documentpart    = '000'.
      ls_doc-statusextern   = 'DR'.
      ls_doc-laboratory     = '001'.
      REFRESH lt_files.
      CLEAR lt_files.
      lt_files-docfile      = 'c:\BP\test.docx'.
      APPEND lt_files.
      CLEAR lt_drat.
      REFRESH lt_drat.
      lt_drat-language    = 'EN'.
      lt_drat-description = 'Info Rec Description'.
      APPEND lt_drat.
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
            EXPORTING: documentdata         = ls_doc
            IMPORTING: documenttype         = lf_doctype
                       documentnumber       = lf_docnumber
                       documentpart         = lf_docpart
                       documentversion      = lf_docversion
                       return               = ls_return
           TABLES: documentdescriptions = lt_drat
                   documentfiles        = lt_files.
      IF ls_return-type CA 'EA'.
        ROLLBACK WORK.
        MESSAGE ID '26' TYPE 'I' NUMBER '000'
                WITH ls_return-message.
      ELSE.
        COMMIT WORK.
      ENDIF.
    Best Regards,
    Martin

  • I created a document with pages. the documetn was stored in the Cloud. Now I can't open it anymore!

    Yesterday I created a document with pages. The documetn was stored in the Cloud. Today I can't open it anymore! According to the help info I need a new version! 'You need a newer version of Pages. You can download a newer version at the Mac App store'

    What version of Pages are you using on your Mac. I note you have a mobile device do you use pages there, have you opened the document from there, if so what version of pages are you using on the mobile.
    Do you perhaps have both versions of pages on the Mac and are simply trying to open it with the wrong one (the older one)

  • Status Change with Compulsory Original File Attachment

    Hi,
    We have created a document with 3 statuses (Created, Acknowledged, Released).
    DIR will be created with "Created" status.
    When the status will change to u201CAcknowledgedu201D system should check whether the DIR has a original file checked in. i.e. Changing status should be have mandatory condition of original is attached.
    Same for the transition from "Acknowledged" to "Released"
    How to do this?
    Thanks & Regards,
    Pavan

    Hi Pradeep,
    Does the status type help?
    Also does the BAdi suggested can be used only for the single document type or will be across all the document types?
    regards,
    Pavan

  • Create custom document with wrong size

    Hi,
    I have a problem (on Sun Solaris 5.8) when I create custom document with more than 10MB size.
    I've created an agent which detects the events on a custom data type
    MYDOCUMENT (extension .mydoc).
    When I put a new document test1.mydoc (size of 10MB for example), my agent detects the new document, creates a copy, sets the class object to
    MYDOCUMENT , removes the original document and puts the copy into the same folder.
    But sometimes, the copy created has a wrong size (less then 10MB).
    How can I configure the nfs server to be sure that the agent waits for the complete size of the added document.
    I need HELP !!!!
    Thanks

    Hi Pavithra,
                    yeah you can create your custom table by entering fields in Standard.  for more details
    refer below screen shots
    Regards,
      Thangam.P

  • Created a document with FM Author 12 and added a template in FM12 to the document

    Created a document with FM Author 12 and added a template in FM12 to the document. Can't open the document again in FM Author 12 "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel".

    Should both programs be in "Authoring" mode?

  • Need to create the document with originals and checkin that document

    HI Guys,
    My requirement is to write a method to  create the document with originals and checkin that document of DMS.
    Plz suggest the approach to get this requirement solved.
    Regards,
    RSK

    Hi Bala,
    Thanks for the reply.
    Iam writing the code under method like below.
    Importing:
    ls_doc type bapi_doc_draw2.
      APPEND is_files TO it_files.
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          documentdata               = ls_doc
       IMPORTING
         documenttype               = iv_doctype
         documentnumber             = iv_docnumber
         documentpart               = iv_docpart
         documentversion            = iv_docvers
         return                     = iv_return
       TABLES
        documentfiles              = it_files.
    Iam checking with document number , document type, document part, document version... it is throwing error message as
    error while checking in and storing: version number(25).
    Please advice whether it is correct approach?
    Regards,
    RSK
    Edited by: shravan kumar ravula on Dec 22, 2011 11:24 AM
    Edited by: shravan kumar ravula on Dec 22, 2011 1:26 PM
    Edited by: shravan kumar ravula on Dec 22, 2011 1:26 PM

  • Help! How do I create a document with an imported PDF in 300dpi using a FOGRA27 colour profile?

    I am a new Indesign user and I have been working with GIMP for the last year creating single colour print-ready PDFs. But now I need to create a document with a FOGRA27 CMYK colour profile and a resolution of at least
    How do I create a document with an imported PDF in 300dpi using a FOGRA27 colour profile?
    I can import the PDF by creating a new document and finding the PDF in places, but it's bad quality.
    The only colour profile I can find under View - Proof Setup is FOGRA39, but I need FOGRA27!
    Help help help, I need to get these files printed in two days!
    Thanks so much..
    xx

    Proof Colors doesn't change the file's color management, it just lets you see what the color values would look like if they are printed unchanged on different output devices. If you want to actually convert the color from one CMYK space to another, it's probably better to do that in Acrobat—Tools>Print Production>Convert Colors.
    There's very little difference between Fogra27 and Fogra39—Fogra27 allows more total ink 350 vs. 330.
    There's nothing you can do to improve the quality of low res images

  • Trying to save a document with a new file name

    I have a IMacOSX Lion
    I am very new to apple products
    How do I save an existing document with a new file name thereby having two documents the old one and the new one with changes? Once a document has been saved once opening File no longer offers the save or Save as choice. Clicking on Save a version does not work either. Please help!

    What application are you using?
    Most Apple apps have adopted a new file saving scheme for what you describe. In Pages, for instance, you go to the File menu and select Duplicate. You end up with two documents, one labeled xxx copy (if the original was xxx). Now you can save xxx copy by using Save from the File menu, and change the name to whatever you want.
    Hope this helps you. Best of luck.

  • Creating a document with hyperlinks to a glossary

    I am creating a document with hyperlinks to a glossary. How can I permit my reader to return to the page that the hyperlink originated on? Thanks!

    The last time I did this I put each glossary term on its own (much smaller) page, then created a link to return to previous view that covered the entire page so no matter where they clicked they would go back to where they came from. Or you could create a button that jumps to previous view. Of course this only works when each glossary term is linked just once. If the same term is used on different pages you link them all to the glossary but the link on the glossary page will only return to the first instance.

  • I saved a word file onto my imac.  when i go to open file in documents with pages the file is grey and unable to open.  the workable files are highlighted in bold.  is there a way to open this file????

    i saved a word file onto my imac.  when i go to open file in documents with pages the file is grey and unable to open.  the workable files are highlighted in bold.  is there a way to open this file????

    THis is safe for Mac's? Sorry, I have just never heard of this site before.
    And there are literally tens of thousands of sites of which I've not heard, too. Not this one.
    It's legit. There are lots of links in Apple Support Communities to the LibreOffice web site, as well as others that are legitimate open-source developers of options to buying MS Office, such as NeoOffice and OpenOffice. I have Open Office installed on one of my older Macs that can't run Office 2011 and it is rock-solid.
    I've been here too long to start posting bogus urls now.

  • How to create shipment document with out inbound delivery document

    Dear Friends
    How to create shipment document with out outbound/inbound delivery document.
    In my client scenario, there is no inbound delivery for normal purchases.
    Just there are raising the PO to vendor, then they are doing MIGO for goods receipt.
    Can we do shipment creation with reference to PO?
    If it is possible, how it will be?
    Please let it solve
    With regards
    Lakshmikanth

    Dear Sameer,
    Please go to transaction VT01N here you enter Transportation planning point and shipment type then press enter.
    Now system will take you to the shipment document creation screen here you click on Select deliveries or press F6 now system will take you to the select outbound deliveries screen in this screen you enter selection data then execute, now deliveries will get assigned to that shipment.
    After assigning the deliveries enter the remaining data then complete the shipment finally save the shipment document.
    For more information please go through this SAP help link
    Note:- Shipment process need to be carry out for the deliveries before PGI.
    http://help.sap.com/saphelp_47x200/helpdata/en/f5/04898047bd11d2bf750000e8a7386f/frameset.htm
    I hope this will help you,
    Regards,
    Murali.

  • Intercompany stock transfer: IV billing documents creates FI document with

    Hi,
    Intercompany stock transfer: IV billing documents creates FI document with wrong vendor.
    How can I make sure that the correct vendor is posted in the selling company code?
    Best regards,
    Eric.

    Hi Jürgen,
    I also tried this option but then the following error appeared:
    "Message no. F5598: Posting keys for account determination for transaction BUV do not exist".
    Some point is forcing the PGI to ask for BUV operation (Tx. OBYA).
    Thank you for your contribution.

  • I would like to create a document with imbedded video, to email, and airdrop to an iPad mini. What program should I use?

    I would like to create a document with imbedded video, to email, and airdrop to an iPad mini. What program should I use?

    Thank you for using the Apple Support Communities
    I would suggest using Apple's Pages which allows support for imbedding videos from the device's camera roll. Pages also allows for sharing via email, Air Drop, and Messages.

Maybe you are looking for

  • Win 7 Wifi not working after upgrading to 10.9.4

    After the update I am not able to get Wifi connection on my Bootcamp 5.1.2 with Windows 7 Professional. The wifi icon gets a red X and it can't se any network at all where it earlier could se several networks. Its running on a Macbook Pro Retina, Mid

  • CCMS for application errors in SAP R/3

    Hi Experts, I am working on File->ABAP Proxy scenario. My client has configured CCMS in solution manager system to receive alerts from PI as well as from SAP ECC system. One thing which is not clear to me is how to capture the application errors rais

  • Help! I-Web error message

    I am trying to save my draft web pages in i-Web and an error message keeps appearing: "The document i-Web could not be saved." I have done everything else I am supposd to do, as far as can tel. P. Andrew Sandlin MacBook Pro   Mac OS X (10.4.9)  

  • If box is 100 or 0 how do I 0 out that box?

    My question is I have a group of 15 boxes titled Factor_weight_1 thru Factor_Weight_14 I also have a 15th box that it titled Factor_Weight_Total. The first 14 Each of the 14 boxes can be between 0 and 100 and when added together must total 100 in the

  • Empty table & lead selection

    Hi folks, We are having a small problem with our new web dynpro application. Basically we have table, which is populated when the application is started. Under the table we have "detail area", and it shows more detailed information about the selected