BAPI_DOCUMENT_CREATE2 - issue

Hello ,
I wrote a report for creating DIR ( cv01 ) and update PR with attachment using BAPI 'BAPI_DOCUMENT_CREATE2'. Report generate DIR with no issues. in CV03n i could see the PR number attached to the DIR( Document info record ) But when i go to the corresponding PR document i couldnt see the DIR attached to it. Please let me knw what could be the issue for not updating the PR.

Hi Prabhu,
                 Obviously this FM checks the storage category and file location in database so if it does not exist it will give you an error so your above approach will be a correct approach.
Check it like this
** Check in original 1 simultaneously in the SAP Database
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile      = 'c:\temp\drawing.txt'.
lt_wsapplication = 'TXT'.
APPEND lt_files.
Thanks

Similar Messages

  • Issue with BAPI_DOCUMENT_CREATE2

    Hi experts,
    I have been facing an issue calling BAPI_DOCUMENT_CREATE2 from a third-party legacy based onto Java.
    I am calling it to create a document based on DIR(Document Info Record) in DMS(Document Management System)
    Before I do this I must have defined a document type like G08 within document class (TC:CL02).
    This is an G08 document type example
    [http://www.esnips.com/doc/27a59a9c-ce41-4873-ac94-079e5d1d1213/Configuracion047]
    I created general characteristis when I defined this document class.
    [http://www.esnips.com/doc/e7e0b379-0d8b-46ac-82d2-3a390ce662ce/Configuracion046]
    I m not quite sure what is the structure I must to fill in the characteristics of my document type
    e.g. For filling document type is the following:
    DOCUMENTDATA.DOCUMENTTYPE
    e.g. For BUSINESSPROCESS [http://www.esnips.com/doc/e7e0b379-0d8b-46ac-82d2-3a390ce662ce/Configuracion046]
    I dont have a clue.
    Thanks in advance of any info you can provide me

    here was my problem:
        it_clas-classtype = '017'.
        it_clas-classname = 'DMS_FAB'.
        append it_clas.
    <b>    it_ausp-classname = 'DMS_FAB'.
        it_ausp-classtype = '017'.</b>
        it_ausp-charname = 'DMS_TIPODOCFAB'.
        it_ausp-charvalue = it_cdp_c-zztipodoc.
        APPEND it_ausp.

  • BAPI_DOCUMENT_CREATE2 - Copy Attached file issue

    Hi,
    I am trying to create a document with attachment in CV01 using the BAPI BAPI_DOCUMENT_CREATE2.
    Here my requirement is to copy the attached files from a document to another document (which I will be creating newly).
    I mean attachments from document 1 to document 2.
    When I try using this bapi BAPI BAPI_DOCUMENT_CREATE2, what should I give in the docpath parameter.
    I have storage category to maintain.
    Even though if I pass storage category, the parameter is not checked in. So, it is throwing with error as “Error while checking and sorting”.
    So, In debugging , I set to checked in again and ran successfully.
    But, when I try to open the attached file in newly created document 2.  Getting error as could not be accessed.
    Adding one more point is that, the fiel might have been uploaded from application server earlier and they might have removed that file from the application server. So, i should not access this file again trough application server.
    Please suggest if I am doing anything wrong.
    Thanks,
    Prabu
    Message was edited by: prabu kailasam

    Hi Prabhu,
                     Obviously this FM checks the storage category and file location in database so if it does not exist it will give you an error so your above approach will be a correct approach.
    Check it like this
    ** Check in original 1 simultaneously in the SAP Database
    REFRESH lt_files.
    CLEAR lt_files.
    lt_files-storagecategory = 'SAP-SYSTEM'.
    lt_files-docfile      = 'c:\temp\drawing.txt'.
    lt_wsapplication = 'TXT'.
    APPEND lt_files.
    Thanks

  • Error in BAPI_DOCUMENT_CREATE2

    My objective is to transfer a file from Application layer to DMS. So i used the function module called 'BAPI_DOCUMENT_CREATE2'. But i get the error
    "Error while checking and storing : /sapia/iface/in/comm/sapmas/WFDOC.PDF"

    Hi,
    I am getting an error "An error occured while creating the original attribute for PDF"
    I tried with out file attachment, it works as you know it is simple....
    I tried with various types of attachments like .TXT and .WRD (changed both wsapplication and docfile parameters), however i get the same error. I tried both from presentation and application server (by providing   pf_ftp_dest                = 'SAPFTPA'    pf_http_dest               = 'SAPHTTPA' )
    Any idea on how to solve this?
    All i need is create a DMS document with a PDF attachment from application server. Are there any other ways to solve this issue?
    ws_docdata-documenttype = 'ARE'.
    ws_docdata-description = 'BAPI DMS'.
    ws_docdata-statusextern = 'CR'.
    ws_file-storagecategory = 'DMS_C1_ST'.
    ws_file-wsapplication   = 'PDF'.
    ws_file-description = 'Job output'.
    ws_file-docfile = 'C:\CAD Integ BAPIS_46.pdf'.
    append ws_file to it_files.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
         documentdata               = ws_docdata
    IMPORTING
         return                     = v_ret
    TABLES
         documentfiles              = it_files   .
    BREAK-POINT.
    IF v_ret-type CA 'EA'.
      ROLLBACK WORK.
      WRITE : v_Ret-message.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = '5'.
    ENDIF.
    Thanks
    Pavan

  • Bapi_document_create2 problem

    Hi,
    i face with a problem while using the bapi bapi_document_create2.
    it adds the file path like '
    Dogan\Main\Standards\0010415--P.pdf'
    but i cannot open the file in cv02n.
    And also it adds the material master elements but the description is not seen and when looked at with cv02n for material master, it asks me to 'Do you want to delete the object links? ', why i get this error?
    The file is not on desktop, it is in another server and its path like that:
    Dogan\Main\Standards\0010415--P.pdf'
    Here is my sample code(i am trying to make it run):
    (itabb is the internal table that i upload the file, tab-delimeted txt file.)
    data:
        lt_drad like standard table of BAPI_DOC_DRAD with header line,
        data like BAPI_DOC_DRAW2,
        dd like standard table of BAPI_DOC_DRAT with header line,
        dfiles like standard table of BAPI_DOC_FILES2 with header line,
        return like BAPIRET2.
    clear:lt_drad,lt_drad[],data,dd,dfiles,dfiles[].
    LOOP AT itabb.
    CLEAR lt_drad.
    lt_drad-objecttype = 'MARA'.
    lt_drad-objectkey = itabb-matnr.
    APPEND lt_drad.
    data-DOCUMENTTYPE = itabb-dokar.
    data-DOCUMENTNUMBER = itabb-doknr.
    data-DOCUMENTVERSION = itabb-dokvr.
    data-DOCUMENTPART = itabb-doktl.
    data-DESCRIPTION = itabb-dktxt.
    data-WSAPPLICATION1 = itabb-dappl.
    data-DOCFILE2 = itabb-filep.
    data-DATACARRIER2 = itabb-dttrg.
    data-username = itabb-dwnam.
    data-LABORATORY = itabb-labor.
    dfiles-storagecategory = 'SAP-SYSTEM'.
    dfiles-docfile      = itabb-filep.
    dfiles-wsapplication = itabb-dappl.
    APPEND dfiles.
    ENDLOOP.
    sort:dfiles.
    delete adjacent duplicates from dfiles.
    data: dtype like BAPI_DOC_AUX-DOCTYPE,
    dnumber like BAPI_DOC_AUX-DOCNUMBER.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        DOCUMENTDATA               = data
      HOSTNAME                   =
      DOCBOMCHANGENUMBER         =
      DOCBOMVALIDFROM            =
      DOCBOMREVISIONLEVEL        =
      CAD_MODE                   = ' '
      PF_FTP_DEST                = ' '
      PF_HTTP_DEST               = ' '
      DEFAULTCLASS               = 'X'
    IMPORTING
       DOCUMENTTYPE               = dtype
       DOCUMENTNUMBER             = dnumber
      DOCUMENTPART               =
      DOCUMENTVERSION            =
       RETURN                     = return
    TABLES
      CHARACTERISTICVALUES       =
      CLASSALLOCATIONS           =
       DOCUMENTDESCRIPTIONS       = dd
       OBJECTLINKS                = lt_drad
      DOCUMENTSTRUCTURE          =
       DOCUMENTFILES              = dfiles
      LONGTEXTS                  =
      COMPONENTS                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    endform.

    Hai....
    As per the source code, i have checked there is no issue with that but check entry for
    Dogan\Main\Standards\0010415--P.pdf' "
    remove this line
    data-DOCFILE2 = itabb-filep.
    if required remove data-DATACARRIER2 = itabb-dttrg
    add this line
    dfiles-docfile =  '
    Dogan\Main\Standards\0010415--P.pdf'
    if this not works, just revert me back.
    Cheers
    KHS

  • 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

  • BAPI_DOCUMENT_CREATE2 in Web Dynpro ABAP

    Hi Friends,
        I want to upload PDF file from my System and get it stored in content server Using WEB DYNPRO APPLICATION. I tried using it by calling the FM but its not uploading the file in the server.
      Can i know the steps involved in uploading the file. I also created a custom Function Module and called this FM in WEB DYNPRO.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(DOCUMENTDATA) LIKE  BAPI_DOC_DRAW2 STRUCTURE
    *"        BAPI_DOC_DRAW2
    *"     VALUE(BIN_CONTENT) TYPE  XSTRING
    *"  EXPORTING
    *"     VALUE(DOCUMENTTYPE) LIKE  BAPI_DOC_AUX-DOCTYPE
    *"     VALUE(DOCUMENTNUMBER) LIKE  BAPI_DOC_AUX-DOCNUMBER
    *"     VALUE(DOCUMENTPART) LIKE  BAPI_DOC_AUX-DOCPART
    *"     VALUE(DOCUMENTVERSION) LIKE  BAPI_DOC_AUX-DOCVERSION
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      CHARACTERISTICVALUES STRUCTURE  BAPI_CHARACTERISTIC_VALUES
    *"       OPTIONAL
    *"      CLASSALLOCATIONS STRUCTURE  BAPI_CLASS_ALLOCATION OPTIONAL
    *"      DOCUMENTDESCRIPTIONS STRUCTURE  BAPI_DOC_DRAT OPTIONAL
    *"      OBJECTLINKS STRUCTURE  BAPI_DOC_DRAD OPTIONAL
    *"      DOCUMENTSTRUCTURE STRUCTURE  BAPI_DOC_STRUCTURE OPTIONAL
    *"      DOCUMENTFILES STRUCTURE  BAPI_DOC_FILES2 OPTIONAL
    *"      LONGTEXTS STRUCTURE  BAPI_DOC_TEXT OPTIONAL
    *"      COMPONENTS STRUCTURE  BAPI_DOC_COMP OPTIONAL
    *..... Document data
    data: ls_doc like bapi_doc_files2.
    **..... Bapi return structure
    data: ls_return like bapiret2.
    **.... Originals that are checked in at the same time
    data: lt_files like bapi_doc_files2 occurs 0 with header line.
    data: tstampl like tzonref-tstampl, tstampl_c(21) type c,
               file_name type localfile, msg(80) type c.
    constants path_name type localfile value '/tmp/'.
    constants log type localfile value '/tmp/logFO.txt'.
    *Create document
    describe table documentfiles lines sy-tfill.
    if sy-tfill > 0.
    clear ls_doc.
    clear lt_files.
    loop at documentfiles into ls_doc from 1 to 1.
    open dataset log for output in text mode encoding default.
    transfer ls_doc-wsapplication to log.
    transfer ls_doc-description to log.
    get time stamp field tstampl.
    unpack tstampl to tstampl_c.
    clear file_name.
    concatenate path_name '/' sy-repid '_' 'ATT' tstampl_c '.' ls_doc-wsapplication into file_name.
    condense file_name no-gaps.
    transfer file_name to log.
    open dataset file_name for output in binary mode message msg.
    if sy-subrc = 0.
    message a899(zz) with file_name msg 'SY-SUBRC:' sy-subrc.
    endif.
    transfer bin_content to file_name.
    close dataset file_name.
    transfer 'move data to lt_files' to log.
    move:documentdata-documenttype to lt_files-documenttype,
               documentdata-documentpart to lt_files-documentpart,
               documentdata-documentversion to lt_files-documentversion,
               ls_doc-description to lt_files-description,
               '1' to lt_files-originaltype,
                'Z_TEST_SAP' to lt_files-storagecategory,
                ls_doc-wsapplication to lt_files-wsapplication,
                file_name to lt_files-docfile,
                'X' to lt_files-checkedin.
    translate lt_files-wsapplication to upper case.
    append lt_files.
    ** CLEAR ls_return.
    transfer 'call BAPI_DOCUMENT_CREATE2' to log.
    call function 'BAPI_DOCUMENT_CREATE2'
          exporting
            documentdata = documentdata
            pf_http_dest = 'SAPHTTPA'
          importing
             documentnumber = documentnumber
             documenttype = documenttype
             documentversion = documentversion
             documentpart = documentpart
             return = return
         tables
             objectlinks = objectlinks
             documentfiles = lt_files
         exceptions
              others = 1.
         close dataset log.
          endloop.
          endif.
         endfunction.
    But i am getting short Dump stating File  /tmp/logFO.txt is not open.
    Can anyone help me with this issue..
    Regards,
    Santosh

    Hello,
    I'm facing the same issue, could you please tell me how did you solve your problem.
    Thanks in advance for your help.

  • BAPI_DOCUMENT_CREATE2 throws communication failure exception

    Hello to all,
    I want to upload a file in WebDynpro ABAP by placing a service call to BAPI_DOCUMENT_CREATE2.
    But i am getting "communication failure" exception. Request your help on this issue.
    <b>(RFC Exception COMMUNICATION_FAILURE with Message RFC destination Create document does not exist. Occurred)</b>
    Code for this service call is as follows :-
    METHOD EXECUTE2_BAPI_DOCUMENT_CREATE2 .
    DATA: ls_doc    typE bapi_doc_draw2,
          ls_return typE bapiret2.
        key fields of the document
    DATA: lf_doctype    typE bapi_doc_draw2-documenttype,
          lf_docnumber  typE bapi_doc_draw2-documentnumber,
          lf_docpart    typE bapi_doc_draw2-documenttype,
          lf_docversion typE bapi_doc_draw2-documenttype.
    **.... Originals that are checked in simultaneously
    DATA: "lt_files typE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
          lt_files type standard table of bapi_doc_files2,
          wa_lt_files like line of lt_files,
    **.... Short texts
          lt_drat  typE standard table of bapi_doc_drat,
          wa_lt_drat like line of lt_drat,
    **.... Object links
         "lt_drad  typE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
         lt_drad  typE standard table of bapi_doc_drad,
         wa_lt_drad like line of lt_drad.
    Allocate document data
    ls_doc-documenttype    = 'DRW'.
    ls_doc-documentnumber  = '4711'.
    ls_doc-documentversion = '00'.
    ls_doc-documentpart    = '000'.
    ls_doc-statusextern   = 'AF'.
    ls_doc-laboratory     = '001'.
    Check in original 1 simultaneously in the SAP Database
    REFRESH lt_files.
    CLEAR lt_files.
    wa_lt_files-storagecategory = 'DMS_C1_ST'.
    wa_lt_files-docfile      = 'c:\original_acy.txt'.
    wa_lt_files-wsapplication = 'TXT'.
    APPEND wa_lt_files to lt_files.
    declarations for context navigation
      DATA lo_element TYPE REF TO if_wd_context_element.
      DATA lt_elements TYPE wdr_context_element_set.
    declarations for parameters
    get all involved child nodes
    get input from context
    the invocation - errors are always fatal !!!
      DATA lv_rfc_error   TYPE c LENGTH 120.
      DATA lv_rfc_message TYPE string.
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        DESTINATION  'Create document'
        EXPORTING
           documentdata =                    ls_doc
    "      hostname =                        wd_this->hostname
    "      docbomchangenumber =              wd_this->docbomchangenumber
    "      docbomvalidfrom =                 wd_this->docbomvalidfrom
    "      docbomrevisionlevel =             wd_this->docbomrevisionlevel
    "      cad_mode =                        wd_this->cad_mode
    "      pf_ftp_dest =                     wd_this->pf_ftp_dest
          pf_http_dest =                    'SAPHTTPA'
       IMPORTING
          documenttype =                    lf_doctype
          documentnumber =                  lf_docnumber
          documentpart =                    lf_docpart
          documentversion =                 lf_docversion
          return =                          ls_return
       TABLES
    "      characteristicvalues =
    "      classallocations =
          documentdescriptions = lt_drat
          objectlinks = lt_drad
    "      documentstructure =
          documentfiles = lt_files
    "      longtexts =
    "      components =
        EXCEPTIONS
          system_failure =                    1   MESSAGE    lv_rfc_error
          communication_failure =             2   MESSAGE    lv_rfc_error.
    error handling
      CASE sy-subrc.
        WHEN  1.
          lv_rfc_message = lv_rfc_error.
          RAISE EXCEPTION TYPE cx_wd_no_handler
            EXPORTING
              textid        = cx_wd_no_handler=>kind_rfc
              old_exception = `SYSTEM_FAILURE`
              rfc_message   = lv_rfc_message.
        WHEN  2.
          lv_rfc_message = lv_rfc_error.
          RAISE EXCEPTION TYPE cx_wd_no_handler
            EXPORTING
              textid        = cx_wd_no_handler=>kind_rfc
              old_exception = `COMMUNICATION_FAILURE`
              rfc_message   = lv_rfc_message.
      ENDCASE.
    store output to context
    ENDMETHOD.

    Hi Abhishek,
    This link may be helpful for you
    Re: How to upload file from Web Dynpro into R/3 (BAPI_DOCUMENT_CREATE2)
    Regards
    Fahad Hamsa

  • BAPI_DOCUMENT_CREATE2 Document not Checking in

    Hi SAP Gurus,
    I am using fm 'bapi_document_create2' for creating douments.
    Document is created without attachments.
    I searched SDN and change the code accordingly with no luck.
    Please see the code where i am doing wrong.
    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-documenttype,
          lf_docversion LIKE bapi_doc_draw2-documenttype.
    DATA: lt_files      LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
          lt_drat       LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE,
          lt_drad       LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
    ls_doc-documenttype    = 'OPL'.
    ls_doc-documentversion = '00'.
    ls_doc-documentpart    = '000'.
    ls_doc-statusextern    = 'WR'.
    ls_doc-laboratory      = '002'.
    REFRESH lt_files.
    CLEAR lt_files.
    *lt_files-sourcedatacarrier = 'SAP-SYSTEM'.
    lt_files-storagecategory = 'SAP-SYSTEM'.
    lt_files-docfile = 'C:\Documents and Settings\LALIT\My Documents\ac.doc'.
    lt_files-wsapplication = 'WRD'.
    APPEND lt_files.
    CLEAR lt_drat.
    REFRESH lt_drat.
    lt_drat-language = 'EN'.
    lt_drat-description = 'Testing document from bapi'.
    APPEND lt_drat.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata         = ls_doc
      IMPORTING
        return               = ls_return
      TABLES
        documentdescriptions = lt_drat
        documentfiles        = lt_files.
    BREAK-POINT.
    IF ls_return-type CA 'EA'.
      ROLLBACK WORK.
      WRITE : ls_return-message.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = '5'.
    ENDIF.
    DATA: doknr TYPE doknr.
    GET PARAMETER ID 'CV1' FIELD doknr.
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
      EXPORTING
        documenttype    = 'OPL'
        documentnumber  = doknr
        documentpart    = '000'
        documentversion = '00'
        hostname        = ''
        statusintern    = ''
        statusextern    = ''
        statuslog       = ''
      IMPORTING
        return          = ls_return
      TABLES
        documentfiles   = lt_files.
    Thanks in advance
    Lalit

    Hi Lalit,
    Please check the example source code given in documentation for function module BAPI_DOCUMENT_CREATE and check if it helps identify the issue.
    Regards,
    Shyam

  • Problem in executing BAPI_DOCUMENT_CREATE2 in background

    Hello SAP Gurus,
    My requirement is to upload documents from application server(AL11) / presentation server (PC) to DMS.
    For the above requirement I'am using BAPI "BAPI_DOCUMENT_CREATE2".
    When i execute the program in foreground i have no issues , but when executing in background getting error :
    "Error in checkin & storing file "...
    Regards,
    Madan Shetty.

    Hi Madan,
    Also Add the the BAPI_DOCUMENT_CREATE2 parameter PF_HTTP_DEST with value SAPHTTPA. Make sure that one is also on sm59. Plus check the server where files are has been created as SAP app server on AL11
    Hope this helps.
    Regards,
    Deepak Kori

  • Problem with BAPI_DOCUMENT_CREATE2

    HI,
    I am creating document using  FM BAPI_DOCUMENT_CREATE2. In IDES, i am able to create with new status. But i am getting an error message as 'The status set requires a previous status'.
    What could be the problem? is it due to the additional pacthes? The patches version for development is  17 and for ides it is 10. If that is the issue, how to create document in Dev. server.
    Thanks in advance
    Regards,
    SP Raj

    Hi Avinash,
    a
    Thanks for the reply.
    I am able to create document number in IDES system. I am getting error development system while creating document number with the FM. Configuration settings and the test data are same for both IDES and Dev. system.
    What could be the problem and how to rectify it.
    Regards
    SP Raj

  • Error: while using fm 'bapi_document_create2'

    Hi.
    I am using fm 'bapi_document_create2' for creating douments of dms.
    it throws me an error 'version assigned automatically internally for document type'
    error no: e006(26)
    i have populated all tables properly and passing to the bapi.
    part of code***
    loop at it_docdata.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        DOCUMENTDATA               = it_docdata
      HOSTNAME                   =
      DOCBOMCHANGENUMBER         =
      DOCBOMVALIDFROM            =
      DOCBOMREVISIONLEVEL        =
      CAD_MODE                   = ' '
      PF_FTP_DEST                = ' '
      PF_HTTP_DEST               = ' '
    IMPORTING
       DOCUMENTTYPE               = documenttype
       DOCUMENTNUMBER             = documentnumber
       DOCUMENTPART               = documentpart
       DOCUMENTVERSION            = documentver
       RETURN                     = ireturn
    TABLES
       CHARACTERISTICVALUES       = it_doccharval
       CLASSALLOCATIONS           = it_docclassalloc
       DOCUMENTDESCRIPTIONS       = it_docdescp
       OBJECTLINKS                = it_objectlinks
       DOCUMENTSTRUCTURE          = it_docstructure
       DOCUMENTFILES              = it_docfiles
       LONGTEXTS                  = it_doclongtext
      COMPONENTS                 =
    endloop.
      what could the problem?????
    please treat it on priority.
    Thanks and regards
    Siddhesh

    Hi,
    I know the original post is from several years back, but could you please explain what he solution was?
    I am experiencing the same issue.
    regrads
    Julian

  • New DVR Issues (First Run, Channel Switching, etc.)

    I've spent the last 30 minutes trying to find answers through the search with no luck, so sorry if I missed something.
    I recently switched to FIOS from RCN cable in New York.  I've gone through trying to setup my DVR and am running into issues and was hoping for some answers.
    1.  I setup two programs to record at 8PM, I was watching another channel at the time and only half paying attention.  Around 8:02 I noticed a message had popped up asking if I would like to switch channels to start recording.  I was expecting it to force it to switch like my old DVR, but in this case it didn't switch and I missed the first two minutes of one of the shows.  I typically leave my DVR on all day and just turn off the TV, this dual show handling will cause issues with that if I forget to turn off the DVR.  Is there a setting I can change that will force the DVR to choose one of the recording channels?
    2.  I setup all my recordings for "First Run" because I only want to see the new episodes.  One show I setup was The Daily Show on comedy central, which is shown weeknights at 11pm and repeated 3-4 times throughout the day.  My scheduled recordings is showing all these as planned recordings even though only the 11pm show is really "new".  Most of the shows I've setup are once a week so they aren't a problem, but this seems like it will quickly fill my DVR.  Any fixes?
    Thanks for the help.
    Solved!
    Go to Solution.

    I came from RCN about a year ago.  Fios is different in several ways, not all of them desirable.  Here are several ways to get--and fix--unwanted recordings from a series recording setup.
    Some general principles. 
    Saving changes.  When you originally create a series with options, or if you go back to edit the options for an existing series, You MUST save the Series Options changes.  Pretty much everywhere else in the user interface, when you change an option, the change takes effect immediately--but not in Series Options.  Look at the Series Options window.  Look at the far right side.  There is a vertical "Save" bar, which you must navigate to and click OK on to actually save your changes.  Exiting the Series Options window without having first saved your changes loses all your attempted changes--immediately.
    Default Series Options.  This is accessed  from [Menu]--DVR--Settings--Default Series Options.  This will bring up the series options that will automatically be applied to the creation of a NEW series. The options for every previously created series will not be affected by a subsequent modification of the Default Series Options.  You should set these options to the way you would like them to be for the majority of series recordings that you are likely to create.  Be sure to SAVE your changes.  This is what you will get when you select "Create Series Recording" from the Guide.  When creating a new series recording where you think that you may want options different from the default, select "Create Series with Options" instead.  Series Options can always be changed for any individual series set up later--but not for all series at once.
    Non-series recordings.  With Fios you have no directly available options for these.  With RCN and most other DVRs, you can change the start and end times for individual episodes, including individual episodes that are also in a series.  With Fios, your workarounds are to create a series with options for a single program, then delete the series later;  change the series options if the program is already in a series, then undo the changes you made to the series options later; or schedule recordings of the preceding and/or following shows as needed.
    And now, to the unwanted repeats. 
    First, make sure your series options for the specific series in question--and not just the series default options--include "First Run Only".  If not, fix that and SAVE.  Then check you results by viewing the current options using the Series Manager app under the DVR menu.
    Second, and most annoying, the Guide can have repeat programs on your channel tagged as "New".  It happens.  Set the series option "Air Time" to "Selected Time".  To make this work correctly, you must have set up the original series recording after selecting the program in the Guide at the exact time of a first run showing (11pm, in your case), and not on a repeat entry in the Guide.  Then, even it The Daily Show is tagged as New for repeat showings, these will be ignored. 
    Third, another channel may air reruns of the program in your series recording, and the first showing of a rerun episode on the other channel may be tagged as "New".  These can be ignored in your series if you set the series option "Channel" to "Selected Channel".  Related to this, if there is both an SD and HD channel broadcasting you series program, you will record them both if the series option "Duplicates" is set to "Yes".  However, when the Channel option is set to "Selected Channel", the Duplicates Option is always effectively "No", regardless of what shows up on the options screen.  
    As for you missing two minutes,  I have sereral instances in which two programs start recording at the same time.  To the best of my recollection, whenever the warning message has appeared, ignoring it has not caused a loss of recording time.  You might have an older software version.  Newest is v.1.8.  Look at Menu--Settings--System Info.  Or, I might not have noticed the loss of minutes.  I regularly see up to a minute of previous programming at the start of a recording, or a few missing seconds at the beginning or end of a recording.  There are a lot of possibilities for that, but the DVR clock being incorrect is not one of them.  With RCN, the DVR clocks occasionally drifted off by as much as a minute and a half.

  • Pension issue Mid Month Leaving

    Dear All,
    As per rule sustem should deduct mid month joining/leaving/absences or transfer scenarios, the Pension/PF Basis will be correspondingly prorated. But our system is not doing this. In RT table i have found 3FC Pension Basis for Er c 01/2010                    0.00           6,500.00.
    Employee leaving date is 14.04.2010. system is picking pension amout as 541. Last year it was coming right.
    Please suggest.
    Ashwani

    Dear Jayanti,
    We required prorata basis pension in case of left employees and system is not doing this. This is the issue. As per our PF experts Pension amount should come on prorata basis for left employees in case they left mid of month.System is doing prorata basis last year but from this year it is deducting 541. I am giving two RT cases of different years.
    RT table for year 2010. DOL 26.04.2010
    /111 EPF Basis              01/2010                    0.00           8,750.00 
    /139 VPF Basis              01/2010                    0.00           8,750.00 
    /3F1 Ee PF contribution     01/2010                    0.00           1,050.00 
    /3F3 Er PF contribution     01/2010                    0.00             509.00 
    /3F5 Ee Mon PF contribution 01/2010                    0.00           1,050.00 
    /3F6 Ee Ann PF contribution 01/2010                    0.00          12,600.00 
    /3F9 PF adm chrgs * 1,00,00 01/2010                    0.00              96.25 
    /3FA PF basis for Ee contri 01/2010                    0.00           8,750.00 
    /3FB PF Basis for Er Contri 01/2010                    0.00           8,750.00 
    /3FJ VPF basis for Ee contr 01/2010                    0.00           8,750.00 
    /3FL PF Basis for Er Contri 01/2010                    0.00           6,500.00 
    /3F4 Er Pension contributio 01/2010                    0.00             541.00
    /3FC Pension Basis for Er c 01/2010                    0.00           6,500.00
    /3FB PF Basis for Er Contri 01/2010                    0.00           8,750.00
    /3FC Pension Basis for Er c 01/2010                    0.00           6,500.00
    /3FJ VPF basis for Ee contr 01/2010                    0.00           8,750.00
    /3FL PF Basis for Er Contri 01/2010                    0.00           6,500.00
    /3R3 Metro HRA Basis Amount 01/2010                    0.00           8,750.00
    1BAS Basic Salary           01/2010                    0.00           8,750.00
    RT table for year 2009. DOL 27.10.2009
                                                                                    /111 EPF Basis              07/2009                    0.00           9,016.13
    /139 VPF Basis              07/2009                    0.00           9,016.13
    /3F1 Ee PF contribution     07/2009                    0.00           1,082.00
    /3F3 Er PF contribution     07/2009                    0.00             628.00
    /3F5 Ee Mon PF contribution 07/2009                    0.00           1,082.00
    /3F6 Ee Ann PF contribution 07/2009                    0.00           8,822.00
    /3F9 PF adm chrgs * 1,00,00 07/2009                    0.00              99.18
    /3FA PF basis for Ee contri 07/2009                    0.00           9,016.00
    /3FB PF Basis for Er Contri 07/2009                    0.00           9,016.00
    /3FJ VPF basis for Ee contr 07/2009                    0.00           9,016.00
    /3FL PF Basis for Er Contri 07/2009                    0.00           5,452.00
    /3FB PF Basis for Er Contri 07/2009                    0.00           9,016.00 
    /3FC Pension Basis for Er c 07/2009                    0.00           5,452.00 
    /3FJ VPF basis for Ee contr 07/2009                    0.00           9,016.00 
    /3FL PF Basis for Er Contri 07/2009                    0.00           5,452.00 
    /3R4 Non-metro HRA Basis Am 07/2009                    0.00           9,016.13 
    1BAS Basic Salary           07/2009                    0.00           9,016.13 
    Now please suggest what to do. where is the problem  ? If have also checked EXIT_HINCALC0_002 but nothing written in it.
    With Regards
    Ashwani

  • Open PO Analysis - BW report issue

    Hello Friends
    I constructed a query in BW in order to show Open Purchase Orders. We have custom DSO populated with standard
    datasource 2lis_02_itm (Purcahse Order Item). In this DSO we mapped the field ELIKZ to the infoobject 0COMP_DEL
    (Delivery completed).
    We loaded the data from ECC system for all POs and found the following issue for Stock Transport Purchase orders (DocType = UB).
    We have a PO with 4 line items. For line items 10 and 20, Goods issued, Goods received and both the flags "Delivery
    complete" and "Final delivery" checked. For line items 30 and 40, only delivery indicator note is issued for zero
    quantity and Delivery complete flag is checked (Final delivery flag is not checked) in ECC system. For this PO, the
    delivery completion indicator is not properly updated in the DSO for line items 30 and 40. The data looks like the
    following:
    DOC_NUM     DOC_ITEM       DOCTYPE     COMP_DEL
    650000001       10     UB        X
    650000001       20     UB        X
    650000001       30     UB
    650000001       40     UB      
    When we run the Open PO analysis report on BW side this PO is appearing in the report but the same is closed in ECC
    system.
    Any help is appreciated in this regard.
    Thanks and Regards
    sampath

    Hi Priya and Reddy
       Thanks for your response.
                         Yes the indicator is checked in EKPO table for items 30 and 40 and delta is running regularly for more than 1 year and no issues with other POs. This is happening only for few POs of type Stock Transport (UB).
                        I already checked the changes in ME23N and the Delivery completed indicator was changed and it reflected in EKPO table. Further, i checked the PSA records for this PO and i am getting the records with the Delivery completed flag but when i update from PSA to DSO the delivery completed indicator is not updating properly.
                       In PSA, for item 30 i have the following entries. Record number 42 is capturing the value X for ELIKZ but after that i am getting two more records 43 and 44 with process key 10 and without X for ELIKZ. I think this is causing the problem.
    Record No.    Doc.No.                    Item              Processkey         Rocancel     Elikz
        41               6500000001            30                    11                            X           ---    
        42               6500000001            30                    11                            ---           X
        43               6500000001            30                    10                            X           ---
        44               6500000001            30                    10                            ---         ---
    (Here --- means blank)        
    Thanks and Regards
    sampath

Maybe you are looking for

  • Help opening a Photoshop file

    Hi Everyone I have a large photoshop file 1GB that I have been working on. It was working fine, until yesterday, then when I tried to open it, it says "could not complete your request because of a program error". I have tried to place it in Indesign,

  • SAP BW Routimes,,,

    <Moderator Message: Please search before posting, there are a lot of threads related to that, additonally you will find blogs> Hi all, I am new to SAP BI,and need help in writing routine,, Can anyone provide me help in understanding it or suggest me

  • SELECTION-SCREEN disable OBLIGATORY

    Hi all, at the moment I'm building a selection-screen which, has a radiobutton group with two options. When one radiobutton is been selected, a couple of fields are disabled for input, or could be hidden. What I want to accomplish is to make some of

  • Convert dollars in a spreadsheet to a foreign exchange rate

    Is it possible to convert the numbers that I have in U S dollars in a spreadsheet that I need to convert to a foreign exchange rate. If possible can someone please let me know or steer me to a web link that has the instructions. Thank you, Greg

  • Mail 2.07 and airport express

    I am having problems sending mail, expecially with attachments. My ISP told me that Mail 2.07 was unstable with SSL using airport express. They told me to change the airport express MTU setting to 1500 but I don't know where to find this setting. Any