Accts Payable posting using BAPI

Hi I am trying to use the Bapi: BAPI_ACC_INVOICE_RECEIPT_POST and am getting an error for "Balance in Transaction Currency. Here is how I am loading the fields, if anyone can see where my error is I would appreciate it.
* fill header
  gd_documentheader-obj_type   = 'BKPFF'.
  gd_documentheader-obj_key    = ref_key.
* GD_DOCUMENTHEADER-OBJ_SYS    = FUNKTION OWN_LOGICAL_SYSTEM_GET
  gd_documentheader-username   = sy-uname.
  gd_documentheader-header_txt = '2008 RPT Header'.
  gd_documentheader-comp_code  = '0604'.
  gd_documentheader-fisc_year  = '2008'.
  gd_documentheader-doc_date   = '20081101'.
  gd_documentheader-pstng_date = '20081114'.
  gd_documentheader-doc_type   = 'KR'.
  GD_DOCUMENTHEADER-REF_DOC_NO = '0000003761'.
* fill AP (line 1)
  it_accountpayable-itemno_acc     = 1.
  it_accountpayable-vendor_no      = '0000111111'.
  it_accountpayable-gl_account     = '0000111111'.
  it_accountpayable-pmnttrms       = 'CINA'.
  it_accountpayable-bline_date     = '20071120'.
  it_accountpayable-pmtmthsupl     = '6'.
  it_accountpayable-pymt_meth      = 'C'.
  it_accountpayable-pmnt_block     = ' '.
  it_accountpayable-item_text      = '2008 RPT Detail'.
  APPEND it_accountpayable.
  it_currencyamount-itemno_acc   = 1.
  it_currencyamount-curr_type    = '00'.
  it_currencyamount-currency     = 'USD'.
  IT_CURRENCYAMOUNT-CURRENCY_ISO = 'USD'.
  it_currencyamount-amt_doccur   = -200000.
*  it_currencyamount-amt_base     = .
  APPEND it_currencyamount.
* fill GL (line 2)
  it_accountgl-itemno_acc     = 2.
  it_accountgl-gl_account     = '0000222222'.
  it_accountgl-comp_code      = '0604'.
  it_accountgl-pstng_date     = '20081114'.
  IT_ACCOUNTGL-DOC_TYPE       = 'KR'.
  it_accountgl-ac_doc_no      = '0000012345'.
  it_accountgl-fisc_year      = '2008'.
  IT_ACCOUNTGL-FIS_PERIOD     = '11'.
  IT_ACCOUNTGL-TAX_CODE       = 'N1'.
  it_accountgl-item_text      = 'GL BAPI Test'.
  APPEND it_accountgl.
  it_currencyamount-itemno_acc   = 2.
  it_currencyamount-curr_type    = '00'.
  it_currencyamount-currency     = 'USD'.
  IT_CURRENCYAMOUNT-CURRENCY_ISO = 'USD'.
  it_currencyamount-amt_doccur   = 200000.
*  it_currencyamount-amt_base     = .
  APPEND it_currencyamount.
Thanks
Mike

Try with both amounts positive.
Rob

Similar Messages

  • GL Posting using BAPI BAPI_ACC_DOCUMENT_POST but not updating in table BSEG

    Hi Experts,
    Hope all are doing greatu2026
    I need you help to resolve the below issue.
    We have on Z-Tcode to GL Posting the document using BAPI u2018BAPI_ACC_DOCUMENT_POST' and this program is successfully posted from the source file and documnet # also created successully.
    We have entries in BKPF, but the table BSEG not updating and we do not have entries.
    Please help me on this regards,
    Thanks in Advance.
    Amjad

    Hi Srikant,
    Thanks for your reply...
    As you suggest, i have checked the structure ACCOUNTGL and below values are passing.
    ACCOUNTGL -ITEMNO_ACC
    ACCOUNTGL -GL_ACCOUNT
    ACCOUNTGL- ITEM_TEXT
    ACCOUNTGL- COMP_CODE
    ACCOUNTGL- COSTCENTER
    ACCOUNTGL- CS_TRANS_T
    Could you please suggest me if there are any  changes needs to do.
    Thanks & Regards,
    Amjad Hussain

  • Account document post using BAPI BAPI_ACC_DOCUMENT_POST

    Hi,
    I am using the BAPI BAPI_ACC_DOCUMENT_POST to post account doument. It is working fine.
    Here I need to pass contrac number to item.
    We have one parameter REALESTATE to pass cotract number.
    Because it is a realestate, it taking contract type as 9 by default.
    But I need to pass other contract number of diffrent type.
    How we can pass the other than realestate contract number using BAPI BAPI_ACC_DOCUMENT_POST ?
    Thanks in advance.
    Sadasiva.

    I am already did the same thing, it is creating document but it is not adding the contract number to item.
    I am also filling the parameter REALESTATE with contract number, it is adding properly and contract type is taking as 9(means realestate).
    But I need to add other contract types also, for that I tried with other parameter what you mentioned.
    Thank you for your reply.
    Sadasiva.
    Edited by: Sadasiva Rao Athota on Dec 9, 2008 2:38 PM

  • Posting using BAPI

    How can i post to FI using BAPI 'BAPI_ACC_DOCUMENT_POST' where cross company code is involved.
    Its working fine when only one company code is present.

    I am able to post a cross-company code by putting the separate company codes in each lline - however I am having a problem that it is using the number range of the second line item for both company codes - any ideas on how to resolve this?

  • G/L Posting using BAPI

    Hi All,
    I need to make a FI-GL posting through my code. These are the following fields which I need to pass for the posting.
    1. Company Code
    2. Currency
    3. Document Date
    4. Posting Date
    5. Posting Key
    6. G/L Accounts
    7. Amount
    I have navigated through the list of BAPIs available and have found a BAPI BAPI_ACC_GL_POSTING_POST. I could map all the fields except the posting key. Thus I am not being able to work it out.
    Another BAPI which I have found out is BAPI_ACC_DOCUMENT_POST, but I do not know how to use it.
    Kindly tell me which BAPI shall I use for the G/L posting and how shall I use the same for posting with the fields as given above. It would be better if some used code sample be given.
    Thanks in advance,
    Paul.

    Hi,
    We have a Program to Upload the G/L accounts, use the Program <b>RFBISA00</b> , read the documentation of this program
    Look at this link
    http://www.sapfans.com/forums/viewtopic.php?t=137643&start=0&sid=a6635665faf0f6e91055271db867cb52
    Regards
    Sudheer

  • Postings For FB50 using BAPI's

    Hi All,
    I have one doubt, i am doing batch upload for transaction fb50.
    1)My requirement is that from the flat file i have to check if corresponding
    to one refrence number if the line items in the flat file are more then 999
    then the internal table should break and those 999 line items should get posted.
    And the line items which are after those 999th line item should also get
    posted for that same reference number.
    2)And how will i assure that those 999 line items which are getting posted
    after breakage have the debit and credit amount equal so as them to get
    posted using bapi's and same for the line items after that 999th line item.
    The bapi's i am using are:
    BAPI_ACC_GL_POSTING_CHECK
    BAPI_ACC_GL_POSTING_POST
    BAPI_TRANSACTION_COMMIT
    Kindly help.
    Regards
    Mansi

    Hi Mansi,
    For ur requirement u need to build a logic where for each 999 lines u need to check the debit and credit total and then insert a new line at the 999th position. The amount for the 999th line will be the difference of the total of the debit and total of the credit till 998th line and line type will debit if credit total till 998th line is greater than the debit total till the same number and vice versa..
    Hope this gives u some idea on how to approach this requirement.
    Regards,
    Nikhil Kayal

  • Error while using bapi BAPI_INCOMINGINVOICE_CREATE to post MIRO

    Hi Friends,
             Im using bapi BAPI_INCOMINGINVOICE_CREATE to post MIRO.
             im passing data to table GLACCOUNTDATA.
             Below are the table fields im paasing
         INVOICE_DOC_ITEM " '000001' deafault always
         GL_ACCOUNT  "Which is constant for all in my case               
         ITEM_AMOUNT      " Total PO net amt + Frieght charges header level      
         DB_CR_IND      " 'S' always default     
         COMP_CODE      " 'RPPL' always default          
         TAX_CODE      " 'V0'     deafault always     
         PROFIT_CTR       " for ex 1100180. based on plant
              While posting this bapi is trhrowing error as below
         'profit centre  RPPL/1100180 does not exist for 01.12.2008'
         where 01.12.2008 is the MIRO posting date which im passing in header.
            We checked dates for profit centres they are correct.
            Awaiting the reply ASAP.
    Regards,
    Venky

    Hi,
    It would be better if you do a recheck on data input for BAPI. If you sure the data are ok but the BAPI still gives error message, then I suggest to post to OSS.
    Regards,
    Teddy Kurniawan

  • Using bapi in lsmw posting g/l account

    hi experts,
    i am trying to post a document in lsmw using bapi method.
    i am using business object:  BUS6030 (Accounting GL posting).
                               method :   POST.
    when trying to mapping the line items i coudnt find the line item NEWBS(posting key for next line item)..
    hope u understand what i said..
    thanks in advance...
    Edited by: dominic joe on Mar 11, 2009 5:56 AM

    why your using the BAPI methiod , you can use Direct Input, its works fine....
    Object               0100   Financial documents
    Method               0000
    Program Name         RFBIBL00
    Program Type         D   Direct Input

  • Posting an accounting document with material using BAPI (ver 4.6c)

    Hello!
    Can anyone help me out with this one please?
    I need to post an accounting document using BAPI.  Since the customer's SAP is 4.6c, the BAPI I found closest is BAPI_ACC_GL_POSTING_POST.
    The posting has 2 specific requirements:
    1.  For the Vendor item, the tax needs to be calculated; and
    2.  For the G/L items, the corresponding material/quantity needs to be entered
    So, my questions are:
    1.  How do you enable the "Calculate Tax" option, which is the Calculate Tax checkbox in F-02?
    2.  How do you enter the material and quantity for the G/L items?
    Thanks a lot!

    Hi,
    Before posting your document please check first whether this is reversal or not.
    please use BAPI_ACC_DOCUMENT_REV_CHECK to check reversal document
    Have a Nice Day,
    Regards,
    Sujeet

  • Issue in posting a accounting document using BAPI BAPI_ACC_DOCUMENT_POST

    Hi All,
    I 'm able to post a document using BAPI ' BAPI_ACC_DOCUMENT_POST ' but the problem i face is the header text is not getting updated for the document that is getting posted. Even though i'm populating the header text in the parameters i'm passing to the BAPI.
    Any pointers to this would be highly appreciated.
    Regards,
    Chaitanya

    Hi,
    put a  break in subroutine FORM fill_acchd
    and execute the bapi.
    Here you have:
      CLEAR gs_acchd.
      MOVE-CORRESPONDING gs_aw TO gs_acchd.
      gs_acchd-usnam = gs_bapi_acchd-username.
      gs_acchd-awsys = gs_bapi_acchd-obj_sys.
      gs_acchd-bktxt = gs_bapi_acchd-header_txt."---->¡¡¡CHECK THIS!!!
      gs_acchd-glvor = gs_bapi_acchd-bus_act.
      gs_acchd-tcode = sy-tcode.
      gs_acchd-acc_principle = gs_bapi_acchd-acc_principle.
    Check if there is something wrong there.
    Best regards

  • How to use Bapi BAPI_ACC_DOCUMENT_POST for g/l account document posting

    Hi all,
    I am using BAPI_ACC_DOCUMENT_POST bapi for g/l account documents posting.as I am first time using BAPI in my program.can anyone give details about how to use this BAPI for document postings.what importing parameters need to be passed , which exporting parameters need to be passed and which tables need to be used.  
    Thanks in advance.
    Regards,
    Harshada

    Moderator message - Please search before asking - post locked
    Rob

  • BAPI to reverse a Document posted using transaction FB50 in ECC5.0

    Hi All,
    We have a requirement to reverse the document that is posted using the transaction FB50.We found the below BAPIu2019s for this requirement:
    BAPI_ACC_DOCUMENT_REV_CHECK
    BAPI_ACC_DOCUMENT_REV_POST
    While trying to execute them, we are getting the error message u201C It cannot be postedu201D.
    Please let me know if anyone has worked on these BAPIu2019s or information on any other BAPIu2019s would be of great help.
    Regards
    Prathima

    check this link[Reversing a document using the bapi 'BAPI_ACC_DOCUMENT_REV_POST';

  • Unable to transfer post the document using BAPI "BAPI_GOODSMVT_CREATE"

    Hi Experts,
    I am unable to post the document using BAPI "BAPI_GOODSMVT_CREATE", getting error "_Sales order stock --- does not exist_"
    details are stated below:
    GM_CODE : 04, it is working fine for the scenario with same saleorder number and line item, but when i give same sale order number and different line item, then i am getting the above error.
    Example : Posting from Saleorder A with line item 100 to saleorder A with lineitem 100 its working fine, but when we are posting
                    from Saleorder A with lineitem 100 to saleorder A with line item 200 it is not working.
    Also When I trying to do with the transaction MB1B manually, it is working fine. kindly suggest me.
    Needed Urgently....
    Appreciate for you early response.
    Regards,
    Sathya.
    Edited by: Sathyanarayana Raghavendra on May 6, 2010 1:00 PM

    Hi,
    Hi Did you call Function BAPI_TRANSACTION_COMMIT' after calling the BAPI.    ?
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_x.
    Regards,
    Jovito.

  • How to post Intercompany GL using BAPI

    Hello Experts,
    We have a requirement for Intercompany GL posting , we are using BAPI_ACC_DOCUMENT_POST for standard posting but looks like it does not work with intercompany posting.
    Can anyone let me know how to post Intercompany GL either using BAPI_ACC_DOCUMENT_POST or any other method.
    Thanks
    Shraman

    Hi Shraman,
    For a requirement for Intercompany GL posting, use BAPI_ACC_DOCUMENT_POST for standard posting with some advanced parameters
    In Header of the BAPI, pass the hardcoded values like
    DOCUMENTHEADER
           OBJ_TYPE            =            FKKSU
           OBJ_KEY             =          $
           OBJ_SYS              =          System name 
           BUS_ACT             =           RFBU
    Other parameters you can pass in Header is:
    USERNAME
    HEADER_TXT
    COMP_CODE
    DOC_DATE
    PSTNG_DATE
    TRANS_DATE
    FISC_YEAR
    FIS_PERIOD
    DOC_TYPE
    REF_DOC_NO
    If you are posting a document in cross-companies 1000 & 1001, you need to pass cost-center with the line item. That is the mandatory field.
    Thanks,
    Guru

  • How to post invoice parked using  BAPI-  BAPI_INCOMINGINVOICE_CREATE

    Hi all,
    Can anybody help me with the following scenario:
    I am parking Invoice document using BAPI:  <b>BAPI_INCOMINGINVOICE_PARK</b>. It gives me a document no. which I can see in frontend system also by committing the BAPI.
    But when I try to post the same using BAPI: <b>BAPI_INCOMINGINVOICE_CREATE</b> , It gives me a different document no.
    Means it is not posting the document which has been parked earlier but it is creating totally a new document. Can anybody  tell me using BAPIs how to post the same document that I had parked using  BAPI:  <b>BAPI_INCOMINGINVOICE_PARK</b>??
    Thanks
    Saurabh

    Hi Shraman,
    For a requirement for Intercompany GL posting, use BAPI_ACC_DOCUMENT_POST for standard posting with some advanced parameters
    In Header of the BAPI, pass the hardcoded values like
    DOCUMENTHEADER
           OBJ_TYPE            =            FKKSU
           OBJ_KEY             =          $
           OBJ_SYS              =          System name 
           BUS_ACT             =           RFBU
    Other parameters you can pass in Header is:
    USERNAME
    HEADER_TXT
    COMP_CODE
    DOC_DATE
    PSTNG_DATE
    TRANS_DATE
    FISC_YEAR
    FIS_PERIOD
    DOC_TYPE
    REF_DOC_NO
    If you are posting a document in cross-companies 1000 & 1001, you need to pass cost-center with the line item. That is the mandatory field.
    Thanks,
    Guru

Maybe you are looking for