Using BAPI_DOCUMENT_CREATE2 to create a document and checkin to VAULT

In a development we are using the function module BAPI_DOCUMENT_CREATE2
to create a document and check in the original file into the R/3 storage
system in one go (see subroutine below).
However, we got the requirement to use a Vault ("Tresor") as the storage
backend. Unfortunatly, just setting the documentfiles-storagecategory element to 'VAULT' results in 3 things:
- the document gets created OK
- the original file does NOT get checked in
- the error message "Original 1 wurde bereits eingecheckt und abgelegt" (...has already been checked in)
So please advise how to use the BAPI modules to achieve the checkin into
a Vault storage.
Could this have something to do with the undocumented documentfiles-originaltype element? What does this have to be set instead of the '1', thats working with SAP-SYSTEM storage?
*&      Form  l_create_doc_and_save
*       text
*      -->P_LG_IOTAB  text
*      <--P_YRAD_DOCFIELDSIOT  text
*AP 001 ins
FORM l_create_doc_and_save
               TABLES x_iotab STRUCTURE ccihs_am07iot
               CHANGING x_yrad_docfields STRUCTURE yrad_docfieldsiot.
* create a new document in DMS with data from x_yrad_docfieldsiot
* and set the new document in x_iotab
  DATA: l_files_tab LIKE bapi_doc_files2 OCCURS 0,
        l_drat_tab LIKE bapi_doc_drat OCCURS 0.
  DATA: l_docdata_wa LIKE bapi_doc_draw2,
        l_files_wa LIKE bapi_doc_files2,
        l_drat_wa LIKE bapi_doc_drat,
        l_return_wa LIKE bapiret2.
  DATA: l_doctype    LIKE bapi_doc_draw2-documenttype,
        l_docnumber  LIKE bapi_doc_draw2-documentnumber,
        l_docpart    LIKE bapi_doc_draw2-documentpart,
        l_docversion LIKE bapi_doc_draw2-documentversion.
*fill document data
  CLEAR l_docdata_wa.
  l_docdata_wa-documenttype = x_yrad_docfields-dokar.
  l_docdata_wa-statusintern = x_yrad_docfields-statusintern.
*  l_docdata_wa-documentnumber = x_yrad_docfields-doknr.
  CLEAR l_files_wa.
*  l_files_wa-storagecategory = lc_database.  " 'SAP-SYSTEM'
  l_files_wa-storagecategory = x_yrad_docfields-storagecategory.
  l_files_wa-docfile = x_yrad_docfields-docpath.
  l_files_wa-originaltype = '1'.   " <--
  l_files_wa-wsapplication = x_yrad_docfields-wsapplication.
  APPEND l_files_wa TO l_files_tab.
  CLEAR l_drat_wa.
  l_drat_wa-language = lc_d.  " 'DE'
  l_drat_wa-description = x_yrad_docfields-description_de.
  APPEND l_drat_wa TO l_drat_tab.
  CLEAR l_drat_wa.
  l_drat_wa-language = lc_e.  " 'EN'
  l_drat_wa-description = x_yrad_docfields-description_en.
  APPEND l_drat_wa TO l_drat_tab.
  CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
      documentdata               = l_docdata_wa
*   HOSTNAME                   =
*   DOCBOMCHANGENUMBER         =
*   DOCBOMVALIDFROM            =
*   DOCBOMREVISIONLEVEL        =
    IMPORTING
      documenttype               = l_doctype
      documentnumber             = l_docnumber
      documentpart               = l_docpart
      documentversion            = l_docversion
      return                     = l_return_wa
    TABLES
*   CHARACTERISTICVALUES       =
*   CLASSALLOCATIONS           =
      documentdescriptions       = l_drat_tab
*   OBJECTLINKS                =
*   DOCUMENTSTRUCTURE          =
      documentfiles              = l_files_tab
*   LONGTEXTS                  =
*   COMPONENTS                 =
* error occured?
  IF l_return_wa-type CA 'EA'.
    ROLLBACK WORK.
    MESSAGE ID '26' TYPE 'I' NUMBER '000'
            WITH l_return_wa-message.
  ELSE.
    COMMIT WORK.
    CLEAR x_iotab.
    x_iotab-zzdokar = l_doctype.
    x_iotab-zzdoknr = l_docnumber.
    x_iotab-zzdokvr = l_docversion.
    x_iotab-zzdoktl = l_docpart.
    x_iotab-linemod = ic_linemode-insert.
    IF sy-langu = lc_d.
      x_iotab-zzdktxt = x_yrad_docfields-description_de.
    ELSEIF sy-langu = lc_e.
      x_iotab-zzdktxt = x_yrad_docfields-description_en.
    ELSE.
      x_iotab-zzdktxt = x_yrad_docfields-description_de.
    ENDIF.
    APPEND x_iotab.
    CALL FUNCTION 'YRAD_LB34_SAVE_PEND_SET'
         EXPORTING
              i_flg_save_pend = true.
    CLEAR x_yrad_docfields.
  ENDIF.
ENDFORM.                    " l_create_doc_and_save

Hi Frank,
Did you manage to figure out what the problem was?
Thank you.
Regards,
Bruno

Similar Messages

  • Using Pages, I have created a document and inserted a Table for use in logging an inventaory. When I came to print this off however the lines for the table were missing but the text was in the Table format, weird! How do I print the Table?

    Using Pages, I have created a document and inserted a Table for use logging an inventory. When I came to print this document the lines and boarders of the Table feature did not print however the text did print in the table format. How do I get the lines and boarders to print also?

    Using Pages, I have created a document and inserted a Table for use logging an inventory. When I came to print this document the lines and boarders of the Table feature did not print however the text did print in the table format. How do I get the lines and boarders to print also?

  • Using a newly created Library document to create a list item and attach itself

    I have a workflow that moves a document from one library to another.
    When a document is moved to a certain library I want to create a list item with a link to the document in the list item.  Keep in mind there could be 10 files submitted to the library, so then in my list I would want 10 new list items created for
    each file, with a link to the individual file. or is there a way to attach the document to a newly created list item programmatically?
    is this possible?

    Hi,
    According to your post, my understanding is that you wanted to use a newly created Library document to create a list item and attach itself.
    I recommend to create a workflow assocaited to the second library, and start the workflow automatically when an item is created.
    Then add action as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • UCCX 8 - Dramatic change in the Create File Document step that is used by the Create XML Document step in order to read an XML file

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    For the last 5 years (and in IPCC3.x/4.x,UCCX/5.x/7.x) I've used the same basic subflow to read a XML document that contains holiday dates where the queue should be closed.  I've re-used this script on 20+ client installs and it's always worked.  The structure of the script allows you to pass the path and filename of the XML document as parameters to the subflow. (The document is in the repository)
    I loaded this script in UCCX 8.0.2 recently and it crashed with a Java.IO error.  It looked like it was trying to read the file system directly and not the repository. (In the Linux appliance model this kind of makes sense but why is the step trying to read the file system directly?)
    So I open a TAC case (SR# 615243125) and TAC tells me that the method of using the Create File Document step is not supported anymore and that I should specify the filename directly in the Create XML Document step
    The problem that I see (aside from having to edit all my scripts that use XML files) is that the Create XML Document step is looking for the input to be a type DOCUMENT and not a type STRING.  This seems to imply that I have to hardcode the document in each script that I deploy for a customer.  When it was a string it was easy to construct the full file path from parameters and pass to the subflow.
    Questions to the group
    #1 Am I missing something here?
    #2  Do you assume that you'll be able to load a script that worked fine in UCCX 7 into UCCX 8 and that it should completely function when you're doing everything according to the step reference documentation.
    #3 Cisco didn’t document this in any way that I can find.
    #4 How can you use the Create XML Document step in a fashion that would let you construct the path of the file and the filename previously in the script so you could pass it to a subflow ?  It would seem this functionality has been killed in UCCX 8
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    (Background)
    Create File Document Step
    The input filename is a STRING, could be an explicit path and filename in the repository or a variable that represents that path and string
    The output of this step is a DOCUMENT to be used in the Create XML Document step
    The string FILE_FullPathHolidayFiles references  en_us\folderName\documentName.xml
    The document was properly uploaded into the repository only, NOT trying to directly read c:\foo\blah…
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    The create XML document input can only be a type DOCUMENT

    #1 Am I missing something here?
    You are mixing two different issues together here.
    The Create File Document step is indeed not needed or supported for creating an XML document. That is why there is a unique step; to trigger XML parsing within the MIVR subsystem.
    Accessing the file system is restricted to a single folder within the VOS model (i.e. 8.0+). This folder is not backed up, replicated, or cleaned up automatically. It was intended to give developers some FS access as a temporary swap location only.
    #2  Do you assume that you'll be able to load a script that
    worked fine in UCCX 7 into UCCX 8 and that it should completely
    function when you're doing everything according to the step reference
    documentation.
    Assume nothing; read the documentation and attend one of the dozens of partner training sessions that CCBU put on advising of the upcoming changes.
    #3 Cisco didn’t document this in any way that I can find.
    You're right, I guess, on the Create File vs. XML Document step. AFAIK Cisco never wrote a notice into the Step Reference Guide explicitly stating that you cannot use the Create File Document although the documentation seemed pretty clear to me without it. File system restrictions are documented in the 8.0 release notes.
    Scripting and Development Series: Volume 2, Editor Step ReferenceUse the Create XML Document step to create a logical document that maps a document to another document variable (where the document has already been pre-parsed as an XML document and is ready to be accessed by the Get XML Document Data step).Use this step before the Get XML Document Data step to obtain data from a document formatted using the Extensible Markup Language (XML).
    #4 How can you use the Create XML Document step in a fashion that would
    let you construct the path of the file and the filename previously in
    the script so you could pass it to a subflow ?  It would seem this functionality has been killed in UCCX 8
    No it hasn't; just concatinate a string to build the Source Document parameter the step needs. Example:  "DOC[" + myFilePath + "]"

  • Where are the bullets for adobe. im creating a document and they are not in the toolbar

    where are the bullets for adobe. im creating a document and they are not in the toolbar

    ADOBE PRO   I JUST GOT IT A FEW MONTHS AGO

  • My airport extreme has connected to a Tplink router, i set my AE in Create network, so i get a problem of Double NAT. How can i repair this probleme because i have to use TPlink for my IP TV and i want to use AE to creat my network and the guest NW.

    my airport extreme has connected to a Tplink router, i set my AE in Create network, so i get a problem of Double NAT. How can i repair this probleme because i have to use TPlink for my IP TV and i want to use AE to creat my network and the guest NW. If we don't have a solution for this question, can i set my AE to use the IP TV and how??? I'm using a 4th Airport extreme

    No, not unless it is simply a network connection.
    How is your IPTV being provided.. if it is using a separate vlan or separate vpi/vci in the adsl connection. Who is your ISP?
    Is the TP-Link ADSL?
    Is the IPTV using a separate voice channel on adsl?
    Or a different vlan.
    Sorry but it is something where a definite answer is not possible unless you provide all the details.
    The setups are unique to each ISP around the world..
    Here is one for our local ISP.
    http://www.avenard.org/iptv/Setup.html
    He has a section on getting this working with apple router over wireless.. look
    http://www.avenard.org/iptv/IPTV_and_Wireless.html
    Google around and see if other people have had success.. the whole setup is tricky.. and it is hard if nobody has used it who actually understands networking.

  • How use jndi to create a organization and add a  user  to it.(ÈçºÎ´´½¨Ò»¸ö×éÖ¯µ¥Î»)

    how use jndi to create a organization and add a user to it¡£THANKS£¡
    ÈçºÎ´´½¨Ò»¸ö×éÖ¯µ¥Î»,²¢½«Ò»¸öÓû§Ìí¼Ó½øËü¡£Ð»Ð»£¡

    Hi,
    The command above about creating a group only works for the root site of the site collection, because the scope of the user group is site collection level, these groups
    can be used in all the sites in this site collection.
    With the existing groups in the root site, we can add users into them and grant specific permissions of a specific sub site to these groups.
    Here is a demo about how to assign permission to a group using Client Object Model(though in C#) for your reference:
    http://www.c-sharpcorner.com/UploadFile/54db21/set-permission-to-group-in-sharepoint-2010-programmatically/
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • I created a document and want to share it in word form via email and email window does not appear

    I created a document and want to share it via email in word, however, when the email window does not how up with the attachent in it ready for email addresses.  I have done this procedue before without any problem. TY

    Look at the suggested discussions on the right and see if you have the answer there.

  • I want to use Xcode to create an app and i need developer tools. so i need to join the devoper program only problem is I'm not 18

    i want to use Xcode to create an app and i need developer tools. so i need to join the devoper program only problem is I'm not 18

    You can get Xcode without joining the developer program. Just go to the App Store and download it (it's free).
    You'd only need to join the Developer program if you want to put your app into the App Store, this is for OS X.
    You will need to join the Developer program if you want to develop for IOS. In that case you will need a parent or guardian.

  • Free trial version of Illustrator - created a document - and no one else can open

    I download a Free trial version of Illustrator - created a document - and no one else can open as an illustrator file (extension .ai) and edit.  They have CS6 version 16 - it tells them that it was created in a newer version.  They are only able to open individual pages as .pdf.

    vanoevsa,
    File>Save As then choose the version in the dropdown list (CS6).

  • Example of using ActionScript to create Grid, GridRow, and Grid Item?

    Does anyone know where I can find a complete example of using
    ActionScript to create Grid, GridRow, and Grid Item?
    I got an error when trying to add a child to the GridRow.
    Flex 2 said this method (addChild) is not available to
    GridRow.

    This thread should help:
    http://www.actionscript.org/forums/showthread.php3?t=167806
    matt horn
    flex docs

  • Error when after creating My Documents and shared repositories

    Hi all,
    after setting up a fresh SAP Mobile Documents installation on NW 7.4 and creating the My Documents and shared repositories we see the message "repository not available" when logging in to the MCM User web interface. The NWA log shows the following errors:
    Connection failed: Cannot access http://localhost:50000/cmis/json: Connection refused: connect
    org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://localhost:50000/cmis/json: Connection refused: connect
    Creating sharing home folder for user svcmcm failed: org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://localhost:50000/cmis/json: Connection refused: connect
    Testing the connection to http://localhost:50000/cmis/json in the destination sometimes yields a negative initial result, followed by consistently positive results.
    Do you have any ideas or suggestions?
    Regards
    Daniel

    Hi Alex,
    thanks a lot; we are now able to connect and access Windows network shares after assigning the Content Admin Role to the MCM Users Group. We now however have the issue that our AD users can access all of the share's folders that the service user (assigned to the file system repository) has rights to. How can we enforce the individual user rights from the AD?
    Regards
    Daniel
    P.S.: We are trying to use assertion tickets in this approach.
    P.P.S.: We followed the preparatory steps under Integrating Documents from a Windows System into KM - Knowledge Management - SAP Library
    Message was edited by: Daniel Hügelmann

  • Use JAXP for creating XML document

    Hi,
    I have used JAXP to create a XML docuemnt. But when I use Jaxp to parse it, it returns parsing error ''null''.
    I open the XML document in XMLspy and save again, then it can be parsed.
    Any suggestion for that? Thanks a lot.

    Are there any differences between the version created with jaxp and the one with xmlspy? are you using the validating parser? if you aren't you might be having trouble with white space. just a guess.

  • In how many ways we can create new document and how to implements this ways?

    I found that we can create new document by 3 ways
    1)by using session object of application ,document list as follow
    InterfacePtr<IApplication> firstdoc(GetExecutionContextSession()->QueryApplication());
              InterfacePtr<IDocumentList> docList(firstdoc->QueryDocumentList());
      docList->NewDoc(25089,IDataBase::ProtectionLevel.kProtectSave, nil);
    but in this case i am not getting how to use newdoc method i.e which parameter we have to pass(not even clear from API reference )
    2)by using command
    InterfacePtr<IApplication> firstdoc(GetExecutionContextSession()->QueryApplication());
              InterfacePtr<IDocumentList> docList(firstdoc->QueryDocumentList());
      InterfacePtr<ICommand> new1(CmdUtils::CreateCommand(kNewDocCmdBoss));
              UIDList asd(docList);
              new1->SetItemList(asd);
              CmdUtils::ProcessCommand(new1);
    3)bu using some util or facade interface
    Utils<IDocumentCommands>()->New( . . .)
    in this case also  i am not geeting how to use new method 
    I try all this method but none of them working .i knew i am doing some mistake  in all these method so please correct me where i am wrong .
    Main problem is in the first parameter of newdoc method i.e what is class id how to use them 

    1. add to your project "SDKLayoutHelper.cpp", "SDKLayoutHelper.h"
    2. #include "SDKLayoutHelper.h"
    insert code:
    do{
             SDKLayoutHelper helper;
             UIDRef docRef = helper.CreateDocument();
             if (UIDRef::gNull == docRef)
                 break;
             helper.OpenLayoutWindow(docRef);
        }while(kFalse);
    Regards!

  • Using dbca to create a db and all the users are locked and expired

    I create a template using dbca on 10gR2 with schema and data and when I use that to build a clone on another machine the users passwords are all locked and expired. I am doing this in silent mode from the command line and I am looking for a flag that produces the unlock users passwords feature which seems to be there if you manually run dbca from the GUI.

    This is a unix script I use to unlock accouts. I should notice this script is used for educational pourposes, in a production database it is not a good practice to leave demo accounts unlocked and overall with login=password.
    sqlplus -S /nolog <<ENDSQL
         connect / as sysdba
         SET LINESIZE 132
         SET PAGESIZE 0
         SET TERMOUT OFF
         SET NEWPAGE 0
         SET SPACE 0
         SET ECHO OFF
         SET FEEDBACK OFF
         SET HEADING OFF
         SPOOL x.sql
         SELECT 'ALTER USER '||username||' IDENTIFIED BY '||username||' ACCOUNT UNLOCK;'
         FROM   dba_users
         WHERE  account_status LIKE '%LOCK%';
         SPOOL OFF
         @x.sql
         !rm x.sql
         exit
    <<ENDSQL~ Madrid.

Maybe you are looking for

  • How do I adjust contrast?

    In PE I have imported a film from a camera mini disk which plays fine - right contrast before importing.  But when I preview it in PE export from PE to an MPEG file for Youtube it is too dark.  I try applying the image effect in PE but it only works

  • SAP New GL Document Splitting with WBS Element

    Dear Experts, In my company, current document splitting is defined as follows: "Document Splitting Characteristics for GL Accounting" is at Profit Center & Segment Level "Document Splitting Characteristics for Controlling" is at Cost Center Level Ple

  • I have version 3.6.22 and it is not loading...shows "not responding"

    It started Friday afternoon. I have never had this problem before, and I installed originally on 2/15/09. I have not updated to the current version because I do not feel there is the same flexibility offered regarding available add-ons. Please help!!

  • Problems opening outline: Not enough memory available

    Dear all, since about 3 or 4 weeks I have problems with opening an outline in EAS console: After a double klick on the outline and about 1 minute waiting the following message pops up: "There is not enough memory available on the Administration Serve

  • CAN'T INSTALL 8.0.5.1 ON LINUX MANDRAKE

    Hi, everyone. I'm stuck. I seem to have completed all of the steps in the installation manual for Oracle Server 8.0.5.1 Enterprise Edition, but during the file copying phase I get an error: $bash: make: command not found Then, in an attempt to see if