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

Similar Messages

  • The word document dose not check my spelling and grammar anymore even I have reset many times..What shall I do?

    The word document dose not check my spelling .... What shal I do? through I have reset many times..
    Thank you.

    Hello 7513,
    I'd recommend enabling disk mode on the iPod, then restoring via iTunes as detailed in the following article.
    iPod Displays a Red "X" Icon
    http://support.apple.com/kb/TS1463
    Cheers,
    Allen

  • Vendor open items appearing in FBl1 but same documents not appearing F-44.

    Hi,
    Vendor open items appearing in FBl1 but same documents not appearing F-44.
    Please help me in this.
    Thanks
    GP

    Hi,
    F-44 is used for clearing vendor - header data. Check if there are both debit and credit entries for the vendor and if it exists then clear using F-44. Check the entries correctly in FBL1.
    regards,
    radhika

  • Acctg document not created for cancellation invoice

    Hi all,
    We have a vehicle sales order created with payment card. The SO contains one item for vehicle and one item for parts. The items were delivered and invoiced separately. Hence, SO has one vehicle sales invoice (VSI) and one parts sales invoice (PSI).
    The standard procedure was to post VSI first before the PSI. Accounting documents have been created when both invoices were posted. However, there was a need to cancel the PSI. When this was done, cancellation invoice was created but there was no accounting document posted for the cancellation.
    I tried simulating the scenario in our test server and cancelled VSI 90000081 first before cancelling PSI 90000082 to test if this can be an alternative solution. Cancellation for VSI was posted successfully but error persists for PSI cancellation.
    Order 67 06/19/06 Completed
    . Delivery 80000081 06/19/06 Being processed
    .. Picking request 20060619 06/19/06 Completed
    .. GD goods issue:delvy 4900000293 06/19/06 complete
    .. Invoice 90000081 06/19/06 Completed
    ... Accounting document 2000077 06/19/06 partly cleared
    .. Invoice cancellation 90000084 06/19/06 Completed
    ... Accounting document 2000079 06/19/06 partly cleared
    . Delivery 80000082 06/19/06 Completed
    .. Picking request 20060619 06/19/06 Completed
    .. GD goods issue:delvy 4900000294 06/19/06 complete
    .. Invoice 90000082 06/19/06 Completed
    ... Accounting document 2000078 06/19/06 Not cleared
    .. Invoice cancellation 90000083 06/19/06
    .. Invoice 90000085 06/20/06 Blocked
    Accounting status of 90000083 (where error occurs) in VF03->Header->Details is set to K or <b>Accounting document not created (authorization lacking)</b>.
    Any inputs? Thanks in advance.

    Hello Sheila,
    sorry - my first answer was in mistake - Status K means:
    "The transaction is processed using payment cards. The order, however, does not contain valid authorization.
    This problem occurs in billing documents for follow-up deliveries."
    Could you check this ? Last way would be to set a breakpoint into the FM 'RV_ACCOUNTING_DOCUMENT_CREATE'
    and trigger this via VF02 -> Release to accounting.
    Regards Wolfgang

  • In the program pages there is a function that automatically will save may document not only one i click save

    in the program pages there is a function that automatically will save may document not only one i click save

    In Lion and Mountain Lion you must save the first time then it will autosave for you with versions.
    ForEverSave, a 3rd party application, might actually prompt you after a set period. Check it out and any alternatives.
    Peter

  • In EBS document not get auto clear Algorithms 11

    In Electronic bank statment  document not get  clear automatically while batch run.
    I update check no to payment document.  even though it is not get auto clear.
    in OT51 assign Interpretation Algorithms 11 011:(Outgoing check: Check number not identical to document number)
    why it is not get  auto clear with check number.

    011 = Outgoing check: Check number not identical to document number
    012 = Outgoing check: Check number identical to document number
    The "document number" in the descriptions is the payment document number - the FI doc that cleared the invoice.  If you use the payment document number as the check number - and thus that is the number the bank includes in the bank statement - then you would use algorithm 012.  If you create a check in the check register that is a different number than the payment document - and the check number is the number in the bank statement - then you would use algorithm 011.
    Search SAP Help for a document titled "Interpretation Algorithms".  This document includes descriptions of all the standard interpretation algorithms.
    Regards,
    Shannon

  • Accounting document not generating for excise invoice.

    Dear all ,
    my issue is
    accounting document not generating for excise invoice
    we are creating accounting document in J1iin
    with refferance to billing document but the accounting docuemnt is not generating
    the accounting document for billing document is generated
    so why the accounting document for excise invoice is not genrating its showing the correct amount in BED ,cee and HE Secc.
    please help
    regards
    Subrat

    IMG -> In Logistics u2013 General -> Tax on Goods Movement -> India ->  Account Determination -> Specify Excise Accounts per Excise Transaction
    Check if the following is maintained or not
    DLFC       CR Credit      PLAAED PLA AED account
    DLFC       CR Credit      PLAAT1 PLA AT1 Account
    DLFC       CR Credit      PLABED PLA BED account
    DLFC       CR Credit      PLACESS PLA cess account
    DLFC       CR Credit      PLAECS PLA ECS Account
    DLFC       CR Credit      PLASED PLA SED account
    DLFC       CR Credit      RG23AED RG 23 AED account
    DLFC       CR Credit      RG23AT1 RG 23 AT1 Account
    DLFC       CR Credit      RG23BED RG 23 BED account
    DLFC       CR Credit      RG23ECS RG 23 ECS Account
    DLFC       CR Credit      RG23SED RG 23 SED account
    DLFC       DR Debit       MSUSP CENVAT suspense account
    Also IMG -> In Logistics u2013 General -> Tax on Goods Movement -> India ->  Account Determination -> Specify G/L Accounts per Excise Transaction
    Check if for all Excise group u2013 DLFC u2013 Company Code combination GLs are maintained or not (especially in production client)

  • Accounting document not generating for excise invoice-please help

    Dear all ,
    my issue is
    accounting document not generating for excise invoice
    we are creating accounting document in J1iin
    with refferance to billing document but the accounting docuemnt is not generating
    the accounting document for billing document is generated
    so why the accounting document for excise invoice is not genrating its showing the correct amount in BED ,cee and HE Secc.
    please help

    Dear G. Lakshmipathi,
    As uknow i am getting problem when i am creating the debit memo
    so is there any specific ETT for debit memo is there .because we are not maintaining delivery type to billing type here in CIN setting
    so its not goods removal through sales . so what will be transaction type for this.
    how to check the error that why the accounting document is not generated as no error log is also comming.
    so please help me in this regards.
    Thanks with Regards
    Subrat

  • Billing document not relevant at delivery header level

    Hi,
    In one of regular scenario i got the Billing document not relevant at delivery header level in processing tab.
    can plz advice me that what's the cause for this ?
    I am using item category tan at both sales order and delivery level.
    Thanks
    Bhushan

    Hi Bhusan,
    Go to: VOV7
    Select Item Cat. as "TAN" and Double Click.
    In Tab: Business Data, Check the entry for Field: Billing Relevance.
    Entry must be "A - Delivery-related billing document"
    Another check:
    Go to: VTFL
    Select Delivery-Billing Combination.
    Go to Item (left-hand tree structure).
    Select Item cat. as "TAN".
    Here, in Field: Copying requirement, Check entry as "004 - Deliv-related item"
    Hope this may resolve the issue.
    Best Regards,
    Amit

  • FI - Accounting Document not Created

    Hi Forum,
    At the time of Billing Invoice creation (VF01), system giving an error in the Header "Posting document not created (export data missing)" & Foreign Trade data is INCOMPLETE.
    for this reason, i am unable to post the accounting Document.
    Can anyone help me on this issue.
    Thanks In Advance.
    Kishore

    Dear Kishore,
    Check the customer master and what country you are sending the goods for.
    If the customer is a Export customer, you need to fill in the Export data in the material master and configure the foreign data in customizing.
    Thanks
    Augustine Ponraj.

  • Internal Links in HTML Document Not Working Correctly in PDF

    I have an HTML document that contains internal links (basically a Table of Contents). When the document is displayed in a browser, the internal links work correctly. However, when I use Acrobat 8 Professional to create a PDF version from the HTML source, the links don't go to the correct place when clicked. It almost appears that they are off by one, e.g., link 7 goes to anchor 8. I can send the source document for you to look at if you email me at eharris -at- synnovation.com. I am not expert in HTML and perhaps the links/anchors are not done correctly when I create the HTML document. Does anyone have any ideas on this?

    This one has the same problem. For instance, "Anchor1" as <a name="Anchor1"> appears 13 times. I am sure that your problem is that Acrobat is going to the last occurance that is just before the first one. As I scan through the file I find similar results for all of the anchors. When I used Tidy, it reduces about 1350 errors to about 474, but that is still not too good. The validator is flagging a lot of identical IDs as well as unrecognized attributes (like ONSELECTSTART). The attributes correctly accepted by body are
    Attribute Specifications
    * BACKGROUND=URI (background image for document)
    * BGCOLOR=Color (background color for document)
    * TEXT=Color (text color for document)
    * LINK=Color (link color for document)
    * VLINK=Color (visited link color for document)
    * ALINK=Color (active link color for document)
    * ONLOAD=Script (document has been loaded)
    * ONUNLOAD=Script (document has been exited)
    as listed on htmlhelp.com for HTML 4. There may be some new ones in HTML 5, but I did not check.
    I am not looking at all of your HTML in detail, but there appears to be a lot of unneeded things based on the error messages from the validator. Many browsers will let you display the stuff (even Acrobat), but there may be errors that crop in when you do not expect it or on some other browsers that the one you check. Thus again, you should use a validator. If you are only off a few tags that might be fine, but when it is in the 1000s, there is an issue. It would also be good to break your page up into parts. It is good practice on web pages for each page to be not much more than one screen. That is often exceeded, but 59 screens of info (on my screen) is a bit much. The TOC is definitely needed in that case, but just was well go to a sub page just as well and make the info easier to track. A PDF (as you are trying to get) could be made of the entire system for those that want it all in one bit. Bill

  • Open item mgnt not checked earlier

    Hi!
    Can we change the setting of a gl after the document are posted. Earlier the open item mgnt was not checked. I have passed the JV's and the balance is Zero. But the system shows an error as "Open items exit" even the acount balances is zero.
    Ans please......
    thanx

    Hi,
    In order to change the Open Item Management for a G/L account using
    ZFSEPA02 the line item total(Total of open items)for this account
    should match/tally with the account balance for this account (FS10),
    otherwise the open item activation will not be possible.
    Unfortunately as per note 175960 you find reports RFSEPA02/ RFSEPA03
    are no longer supported as of release 4.5A.
    ALTHOUGH you can find a possible solution on how to tally the line items
    to the balance in the NOTE 403744.
    1.  Active New General Ledger
             This note applies ONLY WITH RESTRICTIONS to Release ERP 2004 or ERP
             2005 with activated New General Ledger and activated document
             splitting.
             In these releases, it is not currently possible to subsequently
             activate the open item management under the specified conditions.
             The only option currently available is to set up a new account with
             open item management and to use this instead of the original
             account.
             However, it is also possible to deactivate the open item management
             using report ZFSEPA03 under the prerequisites described below.
         2.  Migration to the New GL:
             If you are planning to migrate to the new General Ledger using a
             migration type that enables the use of document splitting, ensure
             that in Phase 1 and Phase 2 NO changes are make to the open item
             management. Phases 1 and 2 indicate the period between the migration
             date and the end of the actual migration (the "Migration Completed"
             indicator is set)

  • F-44: The Re-document not appear available to do the clearing.

    Hi
    Experts
    Hi,
    We need help to understand what hapen with the consult of vendor XXXXX
    When we consult this vendor on transaction FK10N we see the information detailed on the attached file.
    But when I try to do the clearing and try the transaction F-44, the re-document not appear available to do the clearing.
    But when I try to do the clear vendor on F-44 the documents ( 4000000419   1700000135 and 1500000456 ) not appear and I not understand why?
    But this Document No's are seen in FBL1N as a Open Items and also as a Cleared Items, But not able to see in F-44
    4000000419    06/27/2011
    1700000135    07/14/2011
    1500000456    03/30/2011
    Could you please help me with this issue?
    Anil

    hI
    Friend,
    I Checked SE11 REGUP table, if the documents You don't see by F-44 are already contained into a payment proposal.
    If Yes, You should delete the F110 payment proposal to see them by F-44.
    I deleted the payment proposal, even though Iam not able to see the docuements in F-44. what to do?
    I Checked the table BSIK and Also BSAK it is showing this docu nos.
    Anil

  • Documents appearing in FBL1 but same documents not appearing in F-44

    Hi,
    Vendor open items appearing (Documents) in FBL1 but same documents not appearing in F-44.
    I executed FBL1 with input values:
    Vendor
    Company code
    Open items
    Normal items
    I executed F-44 with input values:
    Vendor, company code
    OI check box
    None under additional selection
    Kindly help me in above case.
    Thanks
    GP

    Hi gangappa,
    For that first u check in F110 there u delete unwanted proposals through keep the cursor on run date field and select F4 there not yet complete proposals are available first delete that .
    Second option 
    check it is it any advance payment. if any acvance payment plz select special gl indicator in F-44
    May be this information is useful to you
    Regards
    Surya

  • Controlling Document Not Getting Posted

    Dear All,
    We have a peculiar scenario of Controlling Document not getting posted. Any pointers on wat could be the issue will be highly helpful.
    Scenario:
    We have an interface which posts an accounting document.
    Dr. Expense
    Cr. Balance Sheet.
    The Cost Center is supplied thru the interface and FI document and Profit Center Document is posted without any issues. However, CO document is not generated, not sure wat could be the issue. We have performed the basic checks. Also, for the same expense account, we observe some postings have gone into CO where are some didnt'. The difference between documents posted with corresponding CO and documents without corrsponding CO posting is only the "Transaction Key". When we maintain blank Transaction key.. the system posts CO document, when transaction key is "WRX" for that specific GL the system doesn't post.
    Not sure why Standard SAP behaves like that. Please advice wat items i need to check to resolve
    this.
    regards
    Diwakar

    Hello,
    Make sure in OBYC, for key WRX, you have maintained the GL accounts.
    Regards,
    Ravi

Maybe you are looking for

  • Outbound IDOC WPDTAX  not getting generated

    Hi I am not  able to generate outbound IDOC WPDTAX through WPMA transaction. We are using TAXUSJ as the tax procedure. Tax Condition type UTXJ and JR1 has been maintained in the system. On looking at the code against WPMA , POS_TAX_GET is called to c

  • Update one column in Query only block

    Hi, I have a question regarding multi-record, multi-columns form block. A block has 100 columns (column1 to column100). We have two separate version of same form. In query only mode, update_allowed property of all the blocks in the form is False. But

  • How do save SHSH blobs and how do you retrieve them?

    I have installed IOS 6 and find that it is draining my battery twice as fast as IOS 5.1.1. I do not like the way it changed the search for APPS in store when you get over 100 replies it takes too long to go through them. The settings area has changed

  • OAS 4.0.8 and Java

    What version of Java is supported by OAS 4.0.8.2? Particularily, is the J2EE specification supported?

  • MAXL "query database get ..." hangs on copied apps?

    I have just migrated Essbase DEV and TEST environments to new machines without problems but now I come to do the PROD environment, I find that for all the apps I copied, all is fine except that when I click on a DB, EAS hangs. I traced this to EAS ex