BAPI_DOCUMENT_SETSTATUS after BAPI_DOCUMENT_CREATE2

Hi Guys,
I am trying to create a DMS document with BAPI_DOCUMENT_CREATE2, and then change the document status using BAPI_DOCUMENT_SETSTATUS but I get the error 'Document XXXXX does not exist' when I remove the BAPI_TRANSACTION_COMMIT after BAPI_DOCUMENT_CREATE2 and if I put it back I ge tthe error 'Document currently locked by USERNAME'. The document is being created successfully, but the change status is not working. Check out the following code:
CALL FUNCTION 'BAPI_DOCUMENT_ENQUEUE'
    EXPORTING
      DOCUMENTTYPE          = lf_doctype
      DOCUMENTNUMBER        = lf_docnumber
      DOCUMENTPART          = lf_docpart
      DOCUMENTVERSION       = lf_docversion
* IMPORTING
*   RETURN                =
  CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
      DOCUMENTDATA               = ls_doc
*   HOSTNAME                   =
*   DOCBOMCHANGENUMBER         =
*   DOCBOMVALIDFROM            =
*   DOCBOMREVISIONLEVEL        =
*   CAD_MODE                   = ' '
*   PF_FTP_DEST                = ' '
*   PF_HTTP_DEST               = ' '
*   DEFAULTCLASS               = 'X'
   IMPORTING
     DOCUMENTTYPE               = lf_doctype
     DOCUMENTNUMBER             = lf_docnumber
     DOCUMENTPART               = lf_docpart
     DOCUMENTVERSION            = lf_docversion
     RETURN                     = ls_return
   TABLES
     CHARACTERISTICVALUES       = lt_char
*   CLASSALLOCATIONS           =
     DOCUMENTDESCRIPTIONS       =  lt_drat
*   OBJECTLINKS                = lt_drad
*   DOCUMENTSTRUCTURE          =
     DOCUMENTFILES              = lt_files
*   LONGTEXTS                  =
*   COMPONENTS                 =
  IF ls_return-type CA 'EA'.
    ROLLBACK WORK.
    MESSAGE ID '26' TYPE 'I' NUMBER '000'
    WITH ls_return-message.
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*     EXPORTING
*       WAIT          =
*     IMPORTING
*       RETURN        =
  ENDIF.
  CALL FUNCTION 'BAPI_DOCUMENT_DEQUEUE'
      EXPORTING
        DOCUMENTTYPE          = lf_doctype
        DOCUMENTNUMBER        = lf_docnumber
        DOCUMENTPART          = lf_docpart
        DOCUMENTVERSION       = lf_docversion
*   IMPORTING
*     RETURN                =
  CALL FUNCTION 'BAPI_DOCUMENT_ENQUEUE'
      EXPORTING
        DOCUMENTTYPE          = lf_doctype
        DOCUMENTNUMBER        = lf_docnumber
        DOCUMENTPART          = lf_docpart
        DOCUMENTVERSION       = lf_docversion
* IMPORTING
*   RETURN                =
  lf_statusextern = 'IW'.
  lf_statusintern = 'IW'.
  CALL FUNCTION 'BAPI_DOCUMENT_SETSTATUS'
    EXPORTING
      documenttype    = lf_doctype
      documentnumber  = lf_docnumber
      documentpart    = lf_docpart
      documentversion = lf_docversion
      statusextern    = lf_statusextern
      statusintern    = lf_statusintern
*      statuslog       = lf_statuslog
    IMPORTING
      return          = lss_return.
  IF lss_return-type CA 'EA'.
    ROLLBACK WORK.
    MESSAGE ID '26' TYPE 'I' NUMBER '000'
    WITH lss_return-message.
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*     EXPORTING
*       WAIT          =
*     IMPORTING
*       RETURN        =
  ENDIF.
  CALL FUNCTION 'BAPI_DOCUMENT_DEQUEUE'
    EXPORTING
      DOCUMENTTYPE          = lf_doctype
      DOCUMENTNUMBER        = lf_docnumber
      DOCUMENTPART          = lf_docpart
      DOCUMENTVERSION       = lf_docversion
* IMPORTING
*   RETURN                =
Your assistance will be greatly appreciated.

Hi,
After creation of Document via  'BAPI_DOCUMENT_CREATE2' 
call FM
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT          = 'X'    .
try to debug before going on with status change FM and check if the document is getting created or not i.e  lf_docnumber
also, i would suggest that instead of going for separate FM " BAPI_DOCUMENT_SETSTATUS"  u can set the status in FM
BAPI_DOCUMENT_CREATE2.
the import parameter "DOCUMENTDATA" has fields as STATUSEXTERN and STATUSINTERN. where u can pass the status values 'IW' etc.
Please let me know in case of any issues.
Regards,
Ravi Aswani

Similar Messages

  • Problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2

    Hi experts,
    I'm getting problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2.
    I have a scenario where is defined the document type ZC1, document part 200, authorization group 0002 and for all of these  documents the storage category "Cofre DMS1". And the status which demands the storage category is 'FR'.
    I've been fullfiling the BAPI_DOCUMENT_CREATE2 in this way:
    "Tables
    data: it_doc like bapi_doc_draw2,
          it_return like bapiret2,
          it_files like bapi_doc_files2 occurs 0 with header line,
          it_objs like bapi_doc_drad occurs 0 with header line.
    "Variables
    data: wl_doctype like bapi_doc_draw2-documenttype,
          wl_docnumber like bapi_doc_draw2-documentnumber,
          wl_docpart like bapi_doc_draw2-documentpart,
          wl_docversion like bapi_doc_draw2-documentversion.
    it_doc-documenttype = 'ZC1'.
    it_doc-documentpart = '200'.
    it_doc-documentversion = '00'.
    it_doc-description = 'Test of documents creation via BAPI'.
    it_doc-username = sy-uname.
    it_doc-statusextern = 'FR'.
    it_doc-authoritygroup = '0002'.
    refresh it_files[].
    clear it_files.
    it_files-originaltype = '1'.
    it_files-storagecategory = 'Cofre DMS1'.
    it_files-wsapplication = 'PDF'.
    it_files-docfile = 'c:\110307.pdf'.
    it_files-description = 'Test file'.
    append it_files.
    refresh it_objs[].
    clear it_objs.
    it_objs-objecttype = 'EKPO'.
    it_objs-objectkey = '47000497600010'.
    append it_objs.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata = it_doc
      IMPORTING
        documenttype = wl_doctype
        documentnumber = wl_docnumber
        documentpart = wl_docpart
        documentversion = wl_docversion
        return = it_return
      TABLES
        objectlinks = it_objs
        documentfiles = it_files.
    After execute the BAPI process I got the following error:
    E26 087 - Data carrier COFRE DMS1 not defined
    Does anybody have a sugestion to help me, please?
    Thks
    David
    Edited by: David Tsutsui on Mar 18, 2010 10:52 AM

    Please refer to this thread, it tells why you need a data carrier you can also configure the same in DC20.
    Data Carriers for Storage the Originals of DMS

  • BAPI_DOCUMENT_CREATE2

    Hi,
    I am new to ABAP, could you please let me know what are the mandatory fields that I need to provide to create the Document Number in this BAPI BAPI_DOCUMENT_CREATE2. Please provide the complete details.
    Also let me know will it allow us to create an external document number, i.e this document no can flow from another system to SAP R/3
    Regards,
    Nithiyanandam

    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
                 objectlinks          = lt_drad
                 documentfiles        = lt_files.
    above are mandatory fields . after calling bapi_document_create2 ..check for sy-subrc and call BAPI_TRANSACTION_COMMIT as i have shown below.
    ** Did an error occur ??
          if ls_return-type ca 'EA'.
            rollback work.
            message id '26' type 'I' number '000'
                    with ls_return-message.
          else.
            commit work.
            call function 'BAPI_TRANSACTION_COMMIT'
    *     EXPORTING
    *       WAIT          = WAIT
    *     IMPORTING
    *       RETURN        = RETURN
            write:/ lf_doctype,
                    lf_docnumber,
                    lf_docpart,
                    lf_docversion.
          endif.
          clear: lt_drad, lt_files, ls_doc.
          refresh: lt_drad, lt_files.

  • DMS BAPI_DOCUMENT_CREATE2 Class type Technical Document Category, object ty

    Hello Experts!
    The problem is that DMS import functionality stoped working after supp. pack implementation.
    The process is based on BAPI_DOCUMENT_CREATE2 functionality.
    The first problem was an error "The status set requires a previous status" which was causes dy note 1157678
    (http://wiki.sdn.sap.com/wiki/display/PLM/Error-Thestatussetrequiresapreviousstatus)
    After setting break point/de-implementing that note additional error appeared:
    "Class type Technical Document Category, object ty"
    Does anyone have idea what caused the problem, or which sap note did that? before SP19 implementation that error was not displayed.
    Current highest support package is SAPKH60403.
    Thanks in advance for help,
    Rgds,
    LB

    Hi,
    That error refers to updating characteristics for classification (addnl data tab in DIR).
    Does anyone know what could cause the problem after support pack implementation?
    Is it possible that bapi_document_create2 > api_document_maintain2 disables an option to update classification?

  • BAPI_DOCUMENT_CREATE2 fails in Background

    Hi everyone,
    I wrote an ABAP-report calling BAPI 'BAPI_DOCUMENT_CREATE2'.
    This ABAP has to create a document and upload files per FTP into DMS (Checkin)
    Works Online fine (cause the BAPI avoids FTP as a GUI is online available)  but miserably fails in background:
    Message: RFC callback calls are not allowed in the ABAP...
    This message comes from a failed call of the FM 'SYSTEM_START_REG_SERVER'
    in the FM  'CV120_FTP_START_REG_SERVER' as described in an old thread (Error in Check in of Originals by BAPI In background)
    Sample of the BAPI-call:
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          documentdata         = documentdata
          pf_ftp_dest          = 'SAPFTPA'
        IMPORTING
          documenttype         = documenttype
          documentnumber       = documentnumber
          documentpart         = documentpart
          documentversion      = documentversion
          return               = return
        TABLES
          documentdescriptions = documentdescriptions
          objectlinks          = objectlinks
    *      documentstructure    = documentstructure.
    *      documentfiles        = documentfiles
    *      documentstructure    = documentstructure.
          documentfiles        = documentfiles.
    I tried a lot, even in 2 steps (first create the doc per BAPI, second checkin per call of CVAPI_DOC_CHECKIN)
    but in everycase, i always get the same problem...
    Any help will greatly be appreciated : i daily and manually (ok, even if 1 report launch per day is sufficent) have to upload aprox.
    2000 PDFs ...
    Thanks in advance for answering...
    Edited by: Guillaume Delorme on May 5, 2010 11:08 AM

    Hi everyone,
    Due to holidays, i gotta  post under another account...
    There was a logical mistake in my problem:
    -> i thought i had to do the physical checkin of the files while or after the BAPI_DOCUMENT_CREATE2-call.
    In my case, the content-server is reachable from the app-server as it's been defined in the AL11.
    The content-server is directly defined in table TDWD with complete directorypath as a vault-server (NO DVA-VAULT).
    The SAP-FBs do actually handle two cases for file-checkin that can suit my concern::
    -> DVA-Vault?->FTP-Connect for filetransfer
    -> No DVA-Vault? ->Local GUI-Upload  for filetransfer
    For background-processing fails always the GUI-Upload -> normal
    I don't use any DVA-Vault -> i must do something else.
    Solution: Ridiculously easy...
    *-> FIRST :Physical Checkin over a stupid TRANSFER DATASET for the file.
    *If OK:
    *->SECOND: Call of  BAPI_DOCUMENT_CREATE2 with reference to the transferred File
    *      ->Structure BAPI_DOC_DRAW2:
    *          -> Short Dataname in BAPI_DOC_DRAW2-docfile1
    *          -> Datacarrier in BAPI_DOC_DRAW2-datacarrier1 (actually the key for the VAULT-server)
    *          -> App.type in BAPI_DOC_DRAW2-wsapplication1.
    *          -> Description, Documentype, username, laboratory are must-fields with my customizing too.
    *       ->Internal Table BAPI_DOC_FILES2:
    *          -> Short Dataname in BAPI_DOC_FILES2-docfile
    *          -> Datacarrier in  BAPI_DOC_FILES2-storagecategory (actually the key for the VAULT-server)
    *          -> App.type in BAPI_DOC_FILES2-wsapplication.
    *          -> no other fields required for this table
    *       ->(...)
    *endif.
    Now it runs fine every 5 minutes and i handle about 3000 documents a day...
    I give points to Phillip van den Heever who reminded me the AL11-Setting and i mark this topic solved as soon as i can...
    Thanks to everyone and greets,
    Guillaume Delorme

  • Bapi_document_create2 does not work correctly with attached file.

    Hi all.
    I hava a problem with bapi. I programmed below.
            ls_docdata-documenttype = 'BBS'.
            ls_docdata-description  = 'JJW test'.
            ls_file-documenttype = 'BBS'.
            ls_file-ORIGINALTYPE = 1.
            ls_file-storagecategory = 'ZSTW_KPRO'.
            ls_file-wsapplication = 'TXT'.
            ls_file-docfile = entity_filename.
            append ls_file to lt_files.
            CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
              EXPORTING
                documentdata       = ls_docdata
                PF_FTP_DEST = 'SAPFTP'
                PF_HTTP_DEST = 'SAPHTTP'
              IMPORTING
                documenttype               =      lv_documenttype
                documentnumber           =     lv_documentnumber
                documentpart                =     lv_documentpart
                documentversion           =     lv_documentversion
                return                           =     ls_return
              tables
                documentfiles     = lt_files.
            call function 'BAPI_TRANSACTION_COMMIT'.
    If I don't attach the file, DIR is created but if attach some files, it does not work. What should I do??
    regards.

    Hi,
    You can use the below to attach the file from BSP to SAP. But it doesnt use the BAPI - 'BAPI_DOCUMENT_CREATE2'. It works perfectly for me. Let me know if you have any questions.
    Note: This code put the file into SAP Directory "/userapps/master_data/" as well as it upload the file into Transaction WTY since i am using Business object:BUS2222. You may need to modify the Business object if you ahve the one, otherwise you can just put it into SAP DIR.
    FUNCTION ZATTACH_CREATE.
    *"*"Update function module:
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(FILE) TYPE  SAPB-SAPFILES
    *"     VALUE(STR_FILE_CONTENT) TYPE  XSTRING
    *"     VALUE(OBJECT_KEY) TYPE  BAPIBDS01-OBJKEY
      DATA: LOGICAL_SYSTEM TYPE BAPIBDS01-LOG_SYSTEM,
            CLASSNAME TYPE  BAPIBDS01-CLASSNAME,
            CLASSTYPE TYPE  BAPIBDS01-CLASSTYPE.
      DATA:  IT_FILES TYPE TABLE OF  BAPIFILES,
            IT_SIGNATURE TYPE TABLE OF  BAPISIGNAT,
       FILES TYPE  BAPIFILES,
      SIGNATURE TYPE   BAPISIGNAT.
      DATA: I_TOADD TYPE TOADD,
            FILENAME_ALL TYPE SAPB-SAPFILES,
            FILE_PATH TYPE SAPB-SAPFILES,
            FILE_PATH_MEMORY(250) TYPE C,  " path für SAP memory
            FILE_PATH_LENGTH TYPE I,       " length of the file_path
           FILE_CONTENT_LENGTH TYPE I,       " length of the file_CONTENT
           FILE_NAME TYPE SAPB-SAPFILES,
            FILE_EXTENSION TYPE TOADD-DOC_TYPE.     " file-extension.
      DATA: I_FILE_CONTENT TYPE TABLE OF BAPICONTEN.
      DATA: WA_FILE_CONTENT TYPE  BAPICONTEN,
       STRING_CONTENT TYPE STRING,
       STRING_CONTENT1 TYPE STRING.
      DATA:
       I_FILES TYPE TABLE OF BAPIFILES ,
            I_SIGNATURE TYPE TABLE OF BAPISIGNAT ,
            I_COMPONENTS TYPE TABLE OF BAPICOMPON ,
           COMPONENTS TYPE BAPICOMPON ,
            I_PROPERTIES TYPE TABLE OF SDOKPROPTY ,
            I_PROPERTIES2 TYPE TABLE OF BAPIPROPER ,
            I_PROPERTIES_DEL TYPE TABLE OF BAPIDPROPT ,
           MIMETYPE TYPE TOADD-MIMETYPE,
      COMPID TYPE BAPICOMPON-COMP_ID,  " compid for popup
            COMPID_FLAG(1) TYPE C,           " compid can't be changed
            MODIFY_FLAG(1) TYPE C,           " document is modified
            ATTRI_FLAG(1) TYPE C,            " attri can't be changed
            TITLE_FLAG(1) TYPE C,            " titel of the popup
            CANCEL_FLAG(1) TYPE C,           " cancel button Yes/No
            BUTTON_TEXT(10) TYPE C,
            INFO_TEXT(100) TYPE C,
      VERSION_NR TYPE BDN_CON-DOC_VER_NO,     " version_nr for popup
            VERSION_LANGU2 TYPE T002T-SPTXT, " language field in POPUP
            VERSION_LANGU TYPE BDN_CON-LANGU," SPRAS language field
            TITLE_TEXT(100) TYPE C,          " title of the popup
            DESCRIPTION TYPE BDN_CON-DESCRIPT.      " descr. for popup
    *FILENAME_ALL = fileUpload_event->file_name.
    * Transfering into SAP File server.
      FILE_CONTENT_LENGTH = XSTRLEN( STR_FILE_CONTENT ).
      FILENAME_ALL = FILE .
      STRING_CONTENT = STR_FILE_CONTENT.
      DATA: OUT_LINES TYPE TABLE OF XSTRING.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = STR_FILE_CONTENT
    *   APPEND_TO_TABLE       = ' '
    * IMPORTING
    *   OUTPUT_LENGTH         =
        TABLES
          BINARY_TAB            = I_FILE_CONTENT.
      DELETE DATASET '/userapps/master_data/claim1.txt'.
      OPEN DATASET '/userapps/master_data/claim1.txt' FOR APPENDING
        IN TEXT MODE ENCODING DEFAULT.
    *  LOOP AT I_FILE_CONTENT INTO WA_FILE_CONTENT.
    *    TRANSFER STR_FILE_CONTENT TO '/userapps/master_data/claim1.txt'.
      TRANSFER STRING_CONTENT TO '/userapps/master_data/claim1.txt'.
    *  ENDLOOP.
      CLOSE DATASET '/userapps/master_data/claim1.txt'.
      OPEN DATASET '/userapps/master_data/claim1.txt' FOR INPUT
           IN TEXT MODE ENCODING DEFAULT.
      READ DATASET '/userapps/master_data/claim1.txt'  into STRING_CONTENT1.
    * -- split filename                                                 -- *
        DATA: LENGTH TYPE I.
      DATA: PATH2(1200).  " LIKE sapb-sapfiles.
      DATA: L_FILE(1200),
            L_DIR(1200),
            L_DELIMITER        TYPE C,
            L_OFFSET           TYPE I,
            L_BYTES            TYPE I,
            L_DELIMITER_OFFSET TYPE I,
            L_DELIMITER_BYTES  TYPE I,
            L_CHAR             TYPE C,
            L_PREVIOUS_CHAR    TYPE C,
            L_LAST_CHAR        TYPE C.
      PATH2 = FILENAME_ALL.
      LENGTH = STRLEN( PATH2 ).
      L_OFFSET = 0.
      WHILE L_OFFSET < LENGTH.
        L_LAST_CHAR = L_CHAR. "remember last character
        L_BYTES = CHARLEN( PATH2+L_OFFSET ).
        L_CHAR = PATH2+L_OFFSET(L_BYTES). "get current character
        IF L_CHAR = '/' OR L_CHAR = '' OR L_CHAR = ':'.
          IF L_DELIMITER IS INITIAL OR L_DELIMITER = ':'.
            "Typically we deal with absolute paths, so the first
            "delimiter is best. This allows for UNIX paths with
            "'' in the directory or file name
            L_DELIMITER = L_CHAR.
          ENDIF.
          IF L_CHAR = L_DELIMITER.
            L_DELIMITER_OFFSET = L_OFFSET.
            L_DELIMITER_BYTES = L_BYTES.
            "remember character in front of delimiter:
            L_PREVIOUS_CHAR = L_LAST_CHAR.
          ENDIF.
        ENDIF.
        L_OFFSET = L_OFFSET + L_BYTES.
      ENDWHILE.
      IF NOT L_DELIMITER IS INITIAL.
        L_OFFSET = L_DELIMITER_OFFSET + L_DELIMITER_BYTES.
        L_FILE = PATH2+L_OFFSET.
        IF L_PREVIOUS_CHAR = ':' OR L_DELIMITER = ':'.
          "path ends with or after drive identifer, include the delimiter
          L_DIR = PATH2(L_OFFSET).
        ELSEIF NOT L_DELIMITER_OFFSET IS INITIAL.
          "do not include a trailing delimiter for compatibility reasons
          L_DIR = PATH2(L_DELIMITER_OFFSET).
        ELSE.
          CLEAR L_DIR.
        ENDIF.
      ELSE.
        L_DIR = SPACE.
        L_FILE = PATH2.
      ENDIF.
      FILE_PATH = L_DIR.
      FILE_NAME = L_FILE.
    * -- set new file_path to SAP memory                                -- *
      FILE_PATH_LENGTH = STRLEN( FILE_PATH ).
      IF FILE_PATH <> SPACE AND FILE_PATH_LENGTH < 250.
        FILE_PATH_MEMORY = FILE_PATH.
        SET PARAMETER ID 'OAP' FIELD FILE_PATH_MEMORY.
      ELSE.
        FILE_PATH_MEMORY = SPACE.
        SET PARAMETER ID 'OAP' FIELD FILE_PATH_MEMORY.
      ENDIF.
    * -- data declaration ------------------------------------------------ *
      DATA:
            SINGLE_C TYPE C.
      CLEAR: SINGLE_C.
      LENGTH = STRLEN( FILE_NAME ).
      IF LENGTH > 0.
        WHILE LENGTH > 0.
          SINGLE_C = FILE_NAME+LENGTH(1).
          IF SINGLE_C CO '.'.
            LENGTH = LENGTH + 1.
            EXIT.
          ELSE.
            LENGTH = LENGTH - 1.
          ENDIF.
        ENDWHILE.
        IF LENGTH > 0.
          FILE_EXTENSION = FILE_NAME+LENGTH.
        ELSE.
          FILE_EXTENSION = SPACE.
        ENDIF.
      ELSE.
        FILE_EXTENSION = SPACE.
      ENDIF.
      IF FILE_EXTENSION <> SPACE.
        SET LOCALE LANGUAGE SY-LANGU.
        TRANSLATE FILE_EXTENSION TO UPPER CASE.              "#EC TRANSLANG
        SET LOCALE LANGUAGE SPACE.
      ENDIF.
    * TR001++
      DATA: I_TOADV TYPE TABLE OF TOADV.
      DATA: WA_TOADV TYPE TOADV.
      DATA: OBJECT TYPE SAEOBJART.
      SELECT * FROM TOADV INTO CORRESPONDING FIELDS OF TABLE
              I_TOADV WHERE STANDARD = 'X'.
      DELETE I_TOADV WHERE AR_OBJECT CS 'BDS' OR AR_OBJECT CS 'ZSEST'.
      READ TABLE I_TOADV INTO WA_TOADV WITH KEY DOC_TYPE = FILE_EXTENSION.
    * -- get name and description for the document                      -- *
      CLEAR: COMPID,
             DESCRIPTION,
             VERSION_NR,
             MODIFY_FLAG,
             COMPID_FLAG,
             ATTRI_FLAG,
             TITLE_FLAG.
      COMPID_FLAG    = ' '.              " -> compid can't be changed
      MODIFY_FLAG    = 'S'.              " -> popup in save modus
      ATTRI_FLAG     = 'X'.              " -> attri's can be changed
      COMPID         = FILE_NAME.
      VERSION_NR     = '00000001'.
      VERSION_LANGU2 = SY-LANGU.
      TITLE_FLAG     = '1'.              " -> BDN
    * -- get the mimetype of the docuclass                              -- *
    *PERFORM MIMETYPE_GET(OAALL) USING FILE_EXTENSION
    *                            CHANGING I_TOADD.
      DATA: I_DOCUMENTCLASS TYPE TOADD-DOC_TYPE.
      MOVE FILE_EXTENSION TO I_DOCUMENTCLASS.
      SET LOCALE LANGUAGE SY-LANGU.
      TRANSLATE I_DOCUMENTCLASS TO UPPER CASE.               "#EC TRANSLANG
      SET LOCALE LANGUAGE SPACE.
      SELECT SINGLE * FROM TOADD INTO I_TOADD WHERE
                                 DOC_TYPE EQ I_DOCUMENTCLASS.
      IF SY-SUBRC NE 0.                    " nothing found -> default!
        I_TOADD-DOC_TYPE = I_DOCUMENTCLASS.
        I_TOADD-MIMETYPE = 'application/x-docType'.             "#EC NOTEXT
      ENDIF.
      MOVE I_TOADD-MIMETYPE TO MIMETYPE.
    * -- fill file and signature structure                              -- *
      CLEAR: I_FILES, I_SIGNATURE.
      REFRESH : I_FILES, I_SIGNATURE.
      DESCRIPTION = FILE_NAME.
      FILES-DOC_COUNT = 1.
      FILES-DIRECTORY = FILE_PATH.
      FILES-FILENAME  = FILE_NAME.
      FILES-MIMETYPE  = MIMETYPE.
      APPEND FILES TO I_FILES.
    * -- fill components and signature structure                        -- *
      COMPONENTS-DOC_COUNT  = 1.
      COMPONENTS-COMP_COUNT = 1.
      COMPONENTS-MIMETYPE   = MIMETYPE.
      COMPONENTS-COMP_ID         = FILE_NAME.
      APPEND COMPONENTS TO I_COMPONENTS.
      SIGNATURE-DOC_COUNT  = 1.
      SIGNATURE-PROP_NAME  = 'BDS_DOCUMENTCLASS'.
      SIGNATURE-PROP_VALUE = FILE_EXTENSION.
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME = 'BDS_CONTREP'.
    *IF BDS_DOCTYPE_LIST-CONTREP = SPACE.
      SIGNATURE-PROP_VALUE = ' '.                               "#EC NOTEXT
    *ELSE.
    *  I_SIGNATURE-PROP_VALUE = BDS_DOCTYPE_LIST-CONTREP.
    *ENDIF.
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME  = 'BDS_DOCUMENTTYPE'.
      SIGNATURE-PROP_VALUE = WA_TOADV-AR_OBJECT. "'ZSRVCXLS'."TR001+
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME  = 'DESCRIPTION'.
      SIGNATURE-PROP_VALUE = DESCRIPTION.
      APPEND SIGNATURE TO I_SIGNATURE.
      SIGNATURE-PROP_NAME  = 'LANGUAGE'.
      SIGNATURE-PROP_VALUE = VERSION_LANGU.
      APPEND SIGNATURE TO I_SIGNATURE.
      CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
        EXPORTING
    *   LOGICAL_SYSTEM        =
          CLASSNAME             = 'BUS2222' "classname_select
          CLASSTYPE             = 'BO'" classtype_select
        CLIENT                = SY-MANDT
          OBJECT_KEY            = OBJECT_KEY
        BINARY_FLAG           = 'X'
    * IMPORTING
    *   OBJECT_KEY            =
        TABLES
          SIGNATURE             = I_SIGNATURE
          COMPONENTS            = I_COMPONENTS
        CONTENT               = I_FILE_CONTENT
    *   ASCII_CONTENT         =
    * EXCEPTIONS
    *   NOTHING_FOUND         = 1
    *   PARAMETER_ERROR       = 2
    *   NOT_ALLOWED           = 3
    *   ERROR_KPRO            = 4
    *   INTERNAL_ERROR        = 5
    *   NOT_AUTHORIZED        = 6
    *   OTHERS                = 7
      COMMIT WORK AND WAIT.
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFUNCTION.
    Message was edited by:
            Raja T

  • Bapi_Document_Create2: Check In Problem

    Hi All,
    we want to perform Transaction CV01n via FM.
    I tried the BAPI_DOCUMENT_CREATE2 to to the Job but i cant find the correct Parameter to Check in Documents into the Archiv.
    The Parameters lt_files-storagecategory = 'SAP-System' and lt_files-storagecategory = 'VAULT' are shown but the Archiv is missing.
    I found the Destiation Link in Transactin OAC0 (Content repository), it has te Value XY and The Type is ARCHLINK.
    Any Ideas on this toppic?
    Best Regards
    SR

    Hi everyone,
    Due to holidays, i gotta  post under another account...
    There was a logical mistake in my problem:
    -> i thought i had to do the physical checkin of the files while or after the BAPI_DOCUMENT_CREATE2-call.
    In my case, the content-server is reachable from the app-server as it's been defined in the AL11.
    The content-server is directly defined in table TDWD with complete directorypath as a vault-server (NO DVA-VAULT).
    The SAP-FBs do actually handle two cases for file-checkin that can suit my concern::
    -> DVA-Vault?->FTP-Connect for filetransfer
    -> No DVA-Vault? ->Local GUI-Upload  for filetransfer
    For background-processing fails always the GUI-Upload -> normal
    I don't use any DVA-Vault -> i must do something else.
    Solution: Ridiculously easy...
    *-> FIRST :Physical Checkin over a stupid TRANSFER DATASET for the file.
    *If OK:
    *->SECOND: Call of  BAPI_DOCUMENT_CREATE2 with reference to the transferred File
    *      ->Structure BAPI_DOC_DRAW2:
    *          -> Short Dataname in BAPI_DOC_DRAW2-docfile1
    *          -> Datacarrier in BAPI_DOC_DRAW2-datacarrier1 (actually the key for the VAULT-server)
    *          -> App.type in BAPI_DOC_DRAW2-wsapplication1.
    *          -> Description, Documentype, username, laboratory are must-fields with my customizing too.
    *       ->Internal Table BAPI_DOC_FILES2:
    *          -> Short Dataname in BAPI_DOC_FILES2-docfile
    *          -> Datacarrier in  BAPI_DOC_FILES2-storagecategory (actually the key for the VAULT-server)
    *          -> App.type in BAPI_DOC_FILES2-wsapplication.
    *          -> no other fields required for this table
    *       ->(...)
    *endif.
    Now it runs fine every 5 minutes and i handle about 3000 documents a day...
    I give points to Phillip van den Heever who reminded me the AL11-Setting and i mark this topic solved as soon as i can...
    Thanks to everyone and greets,
    Guillaume Delorme

  • Document number in BAPI_DOCUMENT_CREATE2

    Hi All,
    Can some one tell me, do  i haive to pass the number to  DOKNR in BAPI_DOCUMENT_CREATE or it will take care the DOKNR creation itself, if i have to pass the number, can i pass the number which is generated randomly using NUMBE_GET_NEXT.
    And also let me know is  there any standard object for material to generate number number using NUMBER_GET_NEXT.
    Thanks,
    Krish.
    Edited by: kishore_krish on Nov 25, 2010 8:10 AM

    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
                 objectlinks          = lt_drad
                 documentfiles        = lt_files.
    above are mandatory fields . after calling bapi_document_create2 ..check for sy-subrc and call BAPI_TRANSACTION_COMMIT as i have shown below.
    ** Did an error occur ??
          if ls_return-type ca 'EA'.
            rollback work.
            message id '26' type 'I' number '000'
                    with ls_return-message.
          else.
            commit work.
            call function 'BAPI_TRANSACTION_COMMIT'
    *     EXPORTING
    *       WAIT          = WAIT
    *     IMPORTING
    *       RETURN        = RETURN
            write:/ lf_doctype,
                    lf_docnumber,
                    lf_docpart,
                    lf_docversion.
          endif.
          clear: lt_drad, lt_files, ls_doc.
          refresh: lt_drad, lt_files.

  • Iphoto crashing after using mini-dvi to video adapter

    Hi, IPhoto on my Macbook is crashing. I can open it, then as soon as I scroll down it locks up and I have to force quit.
    This started happening right after I used a Mini-DVI to Video Adapter cable to hook my macbook up to my TV. The adapter/s-video connection worked and I was able to see the video on the tv. But iphoto immediately locked up the computer when I went to slide show and now it locks every time I open it.
    Any ideas?
    Thank you:)
    Dorothy

    It means that the issue resides in your existing Library.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD

  • Brand new IPOD Touch Apps no longer work after upgrading software

    I got a Ipod touch for my wife Today at Wal-Mart. I brought it home, connected to wifi and downloaded some apps and also payed for some. They all worked fine. Then I connected to computer to transfer songs. It told me to upgrade the Ipod software so i Did. After it restarted none of the downloaded apps work anymore. I have read MANY MANY MANY discussions on this and there is no fix. I am not wiping out all the songs and reload everything all over again. It will take forever. My wifes BD is Friday and this is making me so mad after I just dropped $300 on this thing. APPLE!!! Where is the fix? I deleted the apps and reinstalled they still don't work. Anybody got this figured out? I am getting ready to get my money back and tell everyone to avoid buying ipod until they get this upgrade bug fixed.
    Message was edited by: 2009 IPOD TOUCH

    I have the same problem. Brand new two days ago. I synched the touch with Itunes but wasn't hooked up to the internet at the time so didn't do the software upgrade right away. Then I downloaded about a dozen apps (free and paid) with wifi directly to the touch. They all worked fine. Then I plugged it back in to Itunes and had it upgrade it to 3.1.2. It locked up Itunes several times since then and the downloaded apps no longer work (they start to open then disappear).
    The problem is, no one is listening to this problem (including Anna above)! Everyone says "just do a hard reboot, or restore to factory settings, reload the apps, etc." I've tried all the standard troubleshooting but none of it fixes this. It sure seems to me this is a problem with 3.1.2 but Apple isn't helping out here. Where are you APPLE? Use some of those outrageous profits you're making to fix the problem you have created. Here's $300 of my hard earned dollars pretty much down the drain.
    Message was edited by: IPatronius

  • How do I install all my old programs and data from an old system folder after I have reinstalled the same OSX system after a crash?

    The system is OSX10.5.8 Leopard on a 2009 imac. A new system was installed from the installation disks and the original system saved to a folder.
    I need to use my Adobe programs, rescue my email, i-tunes and iphoto data.  The disk utility indicates that my Time Machine back-up disk is damaged and I don't want to take a risk of having Time Machine erase my hard drive and try to reinstall the exact system existing at the time of the crash.  There was over 650 gb of stored files that I was copying and removing from the drive at the time it crashed. The total size of the original system file is still about 650 Gb.
    I would prefer to go back in Time Machine and only rescue the programs as most of the files have been copied to external hard drives, but I can't access the back-up hard drive from the new version of the Time Machine.  Or by I don't want the Time Mchine to start copying the new operating system which would include all the data in the old system file. Time Machine was working fine at the time of the crash.

    No, the disk was backed up with time machine a few hours prior to the crash.  I was unable to open the computer when I tried to restart it- got a grey screen with the spinning disk- after a few minutes the screen would go black and would reboot continuously, but not load any images or programs. I started the computer from the 10.5.4 installation disks and checked both the time machine external hard drive and the Imac internal drive with the disk utilities. Both showed as damaged --the internal drive and permissions were repaired, but the external drive (time machine back-up)  was damaged and not repairable by disk utilities. I don't believe that the external drive for Time Machine was connected to the computer at the time of the crash as I was copying files to a different hard drive drive. And I was not having any problems with the TM back-up drive prior to the crash.
    I accessed the Imac internal disk by firewire (as a target disk) and copied as many data files as I had room for on my external hard drives available.  And I deleted quite a few files from the imac internal drive (mostly just jpegs, duplicate tifs, etc--nothing that was used by i-photos, i-tunes or the Mail program).
    Then I installed a new OSX10.5.4 system from the installation disk and the old system was moved to a folder on the hard drive.  I previousy had had the option to reinstall the complete system from Time Machine when I connected that drive and booted with the installation disks with the C key depressed.  But it didn't seem like a good option because I was unsure of the condition of that external disk and whether it would be able to reinstall my data correctly, once it had erased my internal hard drive. 
    I'm considering buying some new external hard drives and backing up the present system to time Machine (so I'll still have my old data in the old system folder).  And then I would try using the old Time Machine back-up to try to reinstall the sytem previous to the crash.  That back-up would reinstall about 700gb of data and operating software and programs which sounds like a lengthy back-up.  Since I have never used Time Machine to do a full reinstallation (I've only used it for individual files), I'm reluctant to do anything rash.
    I'm a professional designer (with a deadline) but I can still use my Illustrator and Photoshop by opening them from the old system folder and saving the files to an external drive.  So it's not neccessary to do anything hasty except to delete some of the excess art and document files that were causing the computer to run slowly and the  Adobe programs to crash when I tried to save my work. I have quite a few books on tape in the i-tumes folder which is probably talking up tons of space but I don't where the i-tunes files live.
    Thanks for any help. Peggy
    Message was edited by: peggy toole

  • Adobe Photoshop CS2 shuts itself down after printing..

    Not sure whether I'm in the right place to post this..
    In my workplace, we just bought some new iMacs for design class. They are a 2GHz with Intel Core Duo, and has 1GB 667 Mhz DDR2 SDRAM, and running Mac OSX 10.4.8.
    The Photoshop CS2 is version 9.0
    I've config-ed the five new iMacs so they can print to a printer, using IP printing. Problem is, most of the time after the students sends the document they want to print to the printer, Photoshop CS2 just shuts itself down. Then the dialog box saying 'the software just unexpectedly quit' appears.
    It is confusing me, because our older iMacs (that's not an Intel-based) doesn't have this problem, at all.
    is it something to do with CS2 compatibility with Intel-based Macs? or something else.. what needs to be done to stop this annoying problem?
    Regards,
    Meru
    iMacs Mac OS X (10.4.8)
    eMacs, iBook G4s Mac OS X (10.3.9)

    Windows 7 error “key not valid for use in specified state” | The Oracle Instructor

  • Adobe Photoshop CS2 Error messages after update to mac os 10.4.6

    After updated to mac os 10.4.6 everytime I use Photoshop CS2 I receive an error message "Could not complete your request because of a program error"
    I did all the workarounds that were described in document 331627 from Adobe's website and nothing worked.
    I also subscribe to maxosx.com support and someone suggested removing the legal.localized/Tien...file from the photoshop cs2/legal directory, but everytime I tried to select the directory "legal" from within the finder view, it disappeared and closed the finder window.
    HELP!

    Did you upgrade from a previous version of OS X like 10.3.x or 10.2.x or from a prior version of 10.4.x? If the former, there are probably some files in your previous system folder that need to be restored.
    Otherwise, double click Photoshop when it's closed, and then IMMEDIATELY hold Command + Option + Shift. You'll get a box for resetting the settings. Select Yes and maybe that will help.
    --Ryan

  • How to restore playlists and ratings after hard drive format

    Several people have reported problems restoring paylists and ratings after reformating a hard drive. Here is what worked for me and what did not.
    I had to reformat my hard drive. Before doing that I exported my playlists from itunes to another hard drive as an xml file. I also copied the folder with all my songs to another drive. (Also of course had it backed up on DVDs.)Then I copied the itunes library files (see url http://docs.info.apple.com/article.html?artnum=93732) to anoher drive.
    After reformating my hard drive and installing the lastest verion of ITunes, I copied the actual songs back into a subfolder in my music folder. I then told iTunes to import the subfolder with the actual music. That resulted in a restored library that lacked playlists and ratings.
    Don't do this
    I purchased Anapod ($30.00) because its web page said (http://www.redchairsoftware.com/anapod/):
    "Anapod CopyGear is an easy-to-use, compact utility for copying music tracks, playlists, podcasts, photos, and videos from your iPod back to your PC."
    Well, I did transfer 104 playlists back to my iTunes library through the Anapod backup function. However, the transfer also put more than 20 gigs of duplicate songs into the library. All of the songs listed in the playlists were duplicated in iTunes. I could find no way in Anapod to simply copy the ratings and the playlists. Anapod documentation was outdated. For example the online help pages said that playlists could not be backed up. This was confusing because I had just done that.
    "In a future release we will be adding the ability to backup your iPod playlists. This will allow you to generate backup files of your iPod playlists on the computer. These files will not be usable on your computer though. They can only be used to restore playlists at a later time on your iPod (assuming it still carries all the audio files referred to in that playlist)." This text is from url http://www.redchairsoftware.com/anapod/support/tome/tx2pc.php#5.1.2
    I sent requests to Anapod for help today, but they have not been answered yet. Docs truly did not seem to help. Would have been good if there was a pdf file rather than just an online help html file that seemed outdated.
    This worked for me:
    I ended up having iTunes wipe out the entire library because of all the dups Anapod made. (Made sure that iTunes only wiped out library and did not delete actual songs from hard drive. Then I had iTunes import my subfolder with songs again. That brought me back to where I was before wasting money and much time on Anapod.
    After I had my iTunes library up (without ratings and playlists and after finding Anapod did not meet my needs.
    1. I imported the xml file to which I had exported playlists before reformating hard drive. That gave me the playlists back although an error message said some items not copied because the music tracks listed in playlists were not in my iTunes library. --Possibly I deleted songs after playlists were downloaded some time ago to iPod. Importing the xml file is probably not necessary because of what I did below.
    2. Quit iTunes
    3. Because my song ratings were still missing, I then moved the iTunes library files made by the new version of iTunes into a different folder.
    4. Then I put my old version 4 library files into the place where the library files should be.
    5. Then I crossed my fingers and restarted iTunes. It took awhile to start and said it was updating my library files. Now I have back most or all of my playlists and ratings.
    If problems develop, I will probably wipe out iTunes library and use Anapod to move everything from my iPod into a folder and tell iTunes to import that folder. That approach might avoid the dups that Anapod makes when restoring playlists to iTunes.
    So my message is keep your actual songs backed up somewhere (such as DVD's and anotehr hard drive) and keep a duplicate copy of your library files somewhere not on your hard drive. With these items you should be able to restore iTunes library to its former status.
    Sorry for the length of this message. Hope it helps someone.

    The simple version of above:
    iTunes Files to Backup (anytime you make additions or changes to the Music or Library that you want to retain)
    1) All music files in their current folder structure (usually located in and under the ‘iTunes Music’ folder)
    2) The Library database file: ‘iTunes Library.itl’ located in the ‘iTunes’ folder
    3) The Library XML file: ‘iTunes Music Library.xml’ located in the ‘iTunes’ folder
    4) Any XML playlist files created for Playlist retention
    5) The two iTunes.pref files (optional)
    -- C:\Documents and Settings\<your username>\Application Data\Apple Computer\iTunes\iTunes.pref
    -- C:\Documents and Settings\<your username>\Local Settings\Application Data\Apple Computer Inc\iTunes.pref
    6) The XML file of Ratings, Play Counts and Last Played attributes saved from the main Library and created by Otto’s SaveRatings script (also optional, but recommended):
    “Download this: http://ottodestruct.com/itunes/SaveRatings.zip . It's a program, just run it like any other program. Run it on the machine where you're copying the info from BEFORE you move the files to the new machine. Click the "Save Ratings" button and it'll create a ratings.xml file. Now when you move the files, move the program and this file as well. Then after you make your new iTunes library, run it again and click the "Restore Ratings" button. Voila, all your information is back in the Library. Well, most of it anyway, it's not perfect. It'll tell you what songs it couldn't figure out though, and there's usually not very many.”

  • Can not refresh ValueObject after altering database table

    Hello All,
    In FB4, in order to refresh a service, I used to
    - select a service operation
    - select configure return type
    - select auto-detect
    - hit next and on the follow page select the existing ValueObject
    ...it would update.
    As far as I can see, this does not work in FB4.5.  Instead, after selecting auto-detect and clicking next:
    There was an error while invoking the operation. Check your operation inputs or server code and try invoking the operation again.
    Reason: Warning: mysqli_stmt_bind_result(): Number of bind variables doesn't match number of fields in prepared statement in...
    Is there a way to refresh a ValueObject.  Clicking refresh is a no go.
    Thanks for your help!
    J

    hey jay.  did you ever figure out how to update your valueObject?  I just posted a similar discussion "changing php-service in FD breaks AS3 service class and valueObjects" here: http://forums.adobe.com/thread/882288
    maybe we'll get a reply....

Maybe you are looking for

  • 500 Internal Server Error(While run any page on jDeveloper 10.1.3

    Hi, I am trying to run a simple test page and i am facing http 500 error. Here is the error log: oracle.apps.fnd.cache.CacheException     at oracle.apps.fnd.cache.AppsCache.get(AppsCache.java:228)     at oracle.apps.fnd.profiles.Profiles.getProfileOp

  • Problem with cs4 ftp suddenly doesn't work

    I have been using Dreamweaver cs4 for several months without incident, and suddenly last night the ftp function stopped working. I get 2 error messages every time I try to upload to any of my sites. The first error message says it cannot make a conne

  • Crystal Reports 2008 connecting to R/3

    I have a general question for Crystal Reports 2008 for use with R/3. Crystal Reports 2008 with SAP/R3 Enterprise 4.7 I installed a trial version of Crystal Reports 2008 and connected it to the R/3 instance using a oracle id which has admin rights so

  • OneNote won't open, safeboot

    After the update today, my Onenote 2013 won't open. I'm running Windows 8.1. It just keeps giving me the safeboot screen and none of the options work. I've deleted ALL my office programs, cleaned the computer as thoroughly as I know how, run a virus/

  • Which User-Exit is used to create IDOC when we release procee order?

    My question is the IDOC (Basic type: LIOPRO01 and Message type: LIOPRO) is generate when user save the process order or when he release process order? I want to trigger IDOC when user release process order. Is this the use exit i can use PPCO0007?