BAPI_ACC_DOCUMENT_POST to modify an accounting document

hi,
somebody knows how to use the FM BAPI_ACC_DOCUMENT_POST to modify an accounting document?
I use:
lw_cab-username   = sy-uname.
lw_cab-doc_type   = 'KR'.
lw_cab-comp_code  = '0001'.
lw_cab-bus_act = 'RFBU'.
lw_cab-obj_type = 'BKPFF'.
lw_cab-obj_key = '190000032000012007'.
lw_cab-obj_sys = 'HRDCLNT100'.
* I only want to modify this field.
lw_cab-ref_doc_no = 'NEW'.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
      documentheader = lw_cab
    IMPORTING
      obj_key        = l_obj
    TABLES
      currencyamount = li_currencyamount
      return         = li_return.
but it doesn't work.
I also need to reverse an accounting document with BAPI_ACC_DOCUMENT_REV_POST.
Somebody knows an example that works?
Thanks,
Ángel.

Hi,
             see note 487722.
The posting key is automatically assigned by the BAPI, u can't transfer it.
The BAPI decides which posting key ahs to be used in order on the kind of item and operation key.
So you can try to drive the posting key assigning a certain operation key in the item.
Try to check the fm FI_GET_POSTING_KEY.
I believe you can decide which operation key to be used only in the G/L items (BAPIACGL09-ACCT_KEY), for the customer the BAPI uses the keys 01 and 11.
U can see how the BAPI decides which posting keys has to be used in the form fill_acct_key in the include LACC9F20.
Check the therads.
BAPI_ACC_DOCUMENT_POST issue with posting key
BAPI for transaction FB01 with account posting key
<b>Reward points</b>
Regarsd

Similar Messages

  • BAPI_ACC_DOCUMENT_POST - Unable to create accounting document

    Hi All,
    I am trying to post a document using BAPI "BAPI_ACC_DOCUMENT_POST" and "BAPI_TRANSACTION_COMMIT " . On execution the following message is being displayed "                                                                   
    S RW  605 Document posted successfully: FKKSU $ I00CLT030 " .  But, I could not able to see the accounting document number generated in BKPF / BSEG table.
    Can any one of you help me in creating the accounting document number in BSEG / BKPF table using the above said BAPI. Is there any thing which needs to be maintained in customization?
    Thanks in advance.
    Sunil.K

    May be this is little late to answer .. but still it will be better for clarity.
    First of all accouting document will be generated only after commit of the BAPI i.e. call BAPI_TRANSACTION_COMMIT after  BAPI_ACC_DOCUMENT_POST.
    Second to check the accounting document number  generated from BAPI
    When filling the BAPI interface, leave the following fields empty if  the FI document number is to be the reference document number for  the posting:                                                                               
    o  DOCUMENTHEADER:                                OBJ_TYPE, OBJ_KEY and OBJ_SYS       
    o  DOCUMENTHEADER and ACCOUNTGL:   AC_DOC_NO                           
    o  ACCOUNT_GL:                                         STAT_CON, AC_DOC_NO 
    In the importing paramters
         IMPORTING
           obj_type          = l_type
           obj_key           = l_key
           obj_sys           = l_sys
    The first 10 character of l_key will contain the FI document number

  • 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

  • Urgent !!! How to change Accounting document using Billing document numb

    Hi experts,
    I have one requirement where I have to modify the accounting document using report. User will enter billing document no and I have to find out respective accounting document and change header data of it.
    I am very new to these modules so please give me solution.
    Thanks
    Sameer

    Hi
    Go to VF03- Display Billing document. From here you should be able to find the corresponding accounting document. Do note that there are only limited field such as text that is allowed to be changed once posted.
    Rgds
    Nadini

  • Urgent !!! How to change Accounting document using Billing document number

    Hi experts,
    I have one requirement where I have to modify the accounting document using report. User will enter billing document no and I have to find out respective accounting document and I have to change header data..
    I am very new to these modules so please give me solution.
    Thanks
    Sameer

    Hi,
    Get a record from BKPF where
    AWTYP = 'VBRK' & AWKEY = VBRK-VBELN .Once you get the accounting header document you can always fetch item level records from BSEG where bukrs =bkpf-bukrs
    BELNR = BKPF-BELNR & GJAHR = BKPF-GJAHR.
    I hope this helps,
    Regards
    Raju chiatle

  • Accounting Document not Cleared using BAPI_ACC_DOCUMENT_POST

    Dear Experts,
    I am Using BAPI_ACC_DOCUMENT_POST to post the GL'S , Accounting document is getting created successfully . My Doubt is whether this bapi will clear the Accounting document automatically or we have to use any other function module to clear the Document?
    Please let me know how to clear the document.
    Thanks & Regards,
    Hemant Gulati(A1)

    Documents are not cleared; their line items are.
    Rob

  • How to catch accounting Document Number in SE37 for  BAPI_ACC_DOCUMENT_POST

    HI Frds,
    My ReQ is i have to post Customer Invoice from Legacy to ECC through PI interface. So i am using one BAPI , ' BAPI_ACC_DOCUMENT_POST''. I had customized this BAPI by adding 2 fields (1.zstatus, 2.zsaprefno) as i have to send the status(1. Success/Fail, 2.Account Document Number) back to Legacy.
    For PI i have to give the BAPI structure. So when i am executing in SE37 zstatus field is catching the value as 'Success'. But the ZSAPREFNO is not catching the account document number. Bez we have to execute BAPI_TRANSACTION_COMMIT after this BAPI(in test sequence from Menu bar). So directly updating in Database tables.
    when i was excuting in SE38 the Accounting Document Number is returned in RETURN parameter of MESSAGE_V2 as we are checking the return parameter after BAPI_TRANSACTION_COMMIT.
    when i am trying in SE37 its not catching the value in MESSAGE_V2(catching as $).  After COMMITing we have no option to check the RETURN parameter.
    So, any idea how to get the Account Document Number  in SE37.......Or any other way to do..........
    Edited by: priya tavanam on Sep 3, 2010 7:02 AM

    Hi,
    if standard BAPI did not return the Acc. document number before BAPI_COMMIT then create wrapper FM
    1) call actual BAPI and BAPI_COMMIT with in that.
    2) retrun the account document back.
    otherwise you can try sync proxy as well.
    Regds,
    Suresh

  • Problem in creating an account document using BAPI_ACC_DOCUMENT_POST

    Hi Experts,
    I have a porblem while creating an account document from BAPI_ACC_DOCUMENT_POST.
    The problem is acc document is geeting posted and I am getting an document number for that bapi, but its not getting saved to data base and I am getting the following error message
    "Document 1900004327 3000 does not exist in fiscal year 2005
    Message no. F5A397
    System Response
    The required document either does not exist in the fiscal year or is still being posted.
    When the document is read, archived documents are also considered."
    Please sugggest...
    We are using ECC 6.0
    Thanks,
    Suma.

    Hi,
    this means that the posting is not open...
    try with 2008...
    or else ask ur financial consultatto check, whether the 2005 is open or not.
    u also try posting manually using FB01 with same entries u r using for this BAPI...so that u can track the error.
    Also use BAPI_TRAACTION_COMMIT after bapi post.
    check ur subsystem which u r passing for the BAPI..
    wa_general-assetsubno = '0000'. Is it 3000 or 0000
    Try using 0...
    Edited by: Sumi Vasu on May 14, 2008 8:13 AM

  • BAPI_ACC_DOCUMENT_POST not generating accounting document

    HI All
    I'm calling function module 'BAPI_ACC_DOCUMENT_POST'
    to upload accounting dcoument data and passing below parameters for header section. I'm getting 605 success message in RETURN table, but accounting document is not being generated.
    obj_type = FKKSU
    obj_KEY = '$'
    obj_sys = t000-logsys.
    Message is here:
    S   |RW                  |605   |Document posted successfully: FKKSU $ PRO
    Kindly suggest me what could be the problem.
    Thanks in advance,
    Vijaya

    Hi ,
    You need to execute BAPI_TRANSACTION_COMMIT after this Function module.
    otherwise go to before executing BAPI BAPI_ACC_DOCUMENT_POST
    go to 'Function Modules ->other Function module -> ( enter BAPI_TRANSACTION_COMMIT) and then choose SAVE.
    now execute your test variant BAPI_ACC_DOCUMENT_POST.
    Hope this helps you.
    Thanking You.
    Kind Regards,
    Ravi Sankar.Z

  • BAPI_ACC_DOCUMENT_POST: No Accounting Documents are Created

    Hello,
    When I used the BAPi BAPI_ACC_DOCUMENT_POST the documents are posted, but when I try to see:
    Enviroment -> Documents Enviroment -> Accounting Documents,
    The transaccion FB03 does not show anything. Aditionally, GL are not Updated.
    Some person knows something on the matter?
    Regards,
    Piero Cimule.

    Hi Piero,
    I guess this is due to the value you put in :
    documentheader-compo_acc
    If you want the doc to be created in both CO & FI, do not put 'FI' or something else.
    Leave the field blank.
    Hope this helps,
    Erwan

  • Problems in Posting an Accounting Document using BAPI_ACC_DOCUMENT_POST

    Hi All,
    I am facing a problem when I try to post an accounting document using the BAPI "BAPI_ACC_DOCUMENT_POST".
    While passing data to the structure "ACCOUNTTAX", I get the errors "Required field AMT_BASE was not transferred in parameter CURRENCYAMOUNT" and "Required field TAX_CODE was not transferred in parameter ACCOUNTTAX".
    Till now I was not passing the ACCOUNTTAX structure to the BAPI and posting was happening fine.
    Any pointers / solutions in this direction will be most helpful.
    Thanks in advance.
    Regards,
    Keerthi

    Hi
      As u told earlier it was fine , so it may there is some config. change done by func. so this error is coming.
      For minimum required fields fo BAPI , u can go to SE37 and click on Function Module Documentation on Application tool bar.
    here u will find good help.
    Regards
    Sachin

  • User-Exit to Modify Accounting Document of Incoming Invoice

    Hello,
    My requirement is to add two new Line Items (One Debit One Credit - with net value 0) in the Accounting Document of the Incoming Invoice.
    Is there any User-Exit available for modification of the Accounting Document?
    P.S. - The Incoming Invoice is being Posted using BAPI - BAPI_INCOMINGINVOICE_CREATE
    Thanks & Regards,
    Abhishek

    Hi Abhishek,
    Try this exits. You go through the flow and put a break point on the selected exits, and check it whether it triggering or not?
    I too not aware of this invoice flow, so I am listing all the relevant exits. I think this may help you.
    Enhancement
    LMR1M001                                User exits in Logistics Invoice Verification
    LMR1M002                                Account grouping for GR/IR account maintenance
    LMR1M003                                Number assignment in Logistics Invoice Verification
    LMR1M004                                Logistics Invoice Verification: item text for follow-on docs
    LMR1M005                                Logistics Inv. Verification: Release Parked Doc. for Posting
    LMR1M006                                Logistics Invoice Verification: Process XML Invoice
    MRMH0001                                Logistics Invoice Verification: ERS procedure
    MRMH0002                                Logistics Invoice Verification: EDI inbound
    MRMH0003                                Logistics Invoice Verification: Revaluation/RAP
    MRMN0001                                Message output and creation: Logistics Invoice Verification
    Business Add-in
    INVOICE_UPDATE                          Business Add-In: Logistics Invoice Verification
    Reward points if it helps you.
    Cheers,
    Swamy Kunche

  • Modifying accounting document linked to material document in MB1B

    Hi Everyone,
    While doing transfer posting in MB1B with movement type 453 there is an accounting document generated.
    The requirement is to split this accouting document to have accounting entry as :
    Inventory G/L Dr (100%)
    COGS G/L Cr (70 %)
    Specific Reserve G/L Cr (30%)
    Also need to check on the profit center determined in this accounting document to have a user defined logic for this determination.
    If you have worked on or seen any such enhancement, requrest you to share how it was achieved- Customer Exits, BADIs, BTEs,or something else.
    Thanks,
    Hemant

    Hi Sai,
    This movement (453)is done to take back the customer returned parts into the inventory and hence involves accounting entry.
    The scenario involves customer service. Instead of crediting the COGS G/L completely, part of it needs to be credited as service reserves. Hence lets say inventory is going up by $ 100 upon reciept of the material the balancing credit needs to be posted to two G/L accounts with a proportation let say 70 :30. With that $ 70 should go to COGS G/L and $ 30 should hit service reserves.
    Secondly the profit center determination in standard SAP is based on Plant/Material combination. It is required to populate this profiit center with a custom logic.
    Hope this explains  the functional requirement.
    Thanks,
    Hemant

  • Manual creation of idoc for a Accounting document FIDCC1

    Hi,
    Some of the config for the change pointer was not moved to production and some accounting documents have been created which have not triggered the IDOC.
    Is there a way to create the idoc for the accounting documents already created.
    Regards,
    Puneet.

    Once you have all your change pointers setup correctly (view bd52) then you should be good to go BUT to answer your question about the existing documents .. you would need to somehow "touch" those documents to trigger the creation of the IDOCs. You can modify something on then that also is attached to the change pointer say a date? 1/11/11 change to 1/12/11 but don't save that value .. change back to 1/11/11 then save.
    Just my thoughts .. let me know how it goes.
    Jay Esparza

  • No Accounting Document generated for goods issue in case of MTO scenario

    Hi all,
    I have MTO scenario & the industry is trading. So I have all trading goods. In SPRO - Sales & Distribution - Availability Check and Transfer of Requirements - Transfer of Requirements - Determination Of Requirement Types Using Transaction I have determined requirement type as KE.
    In material master I have used strategy group as 20 for Make to order scenario. In the settings "Determination Of Requirement Types Using Transaction" I have determined the requirement type as "KE".
    The requirement type "KE" determines a requirement class "040 - MkToOrdNoValW/o cons". Here the account assignment category is "E-Ind. cust. w. KD-CO".
    Now I created a sales order, the system determined the requirement type as "KE". I saved the sales order, assigned the stock to the sales order  & created a delivery.
    I did the PGI also. But when I check in the document flow, for the material document the system has not generated any FI document where we see the accounting document for the "cost of goods sold" & "inventory" G/L accounts. The system gives a message "Material document 4900000023 does not include an accounting document".
    Note:
    1. When I create the sales order with normal MTS scenario, the system creates an accounting document for the material document at the time of goods issue.
    2. The valuation class in the material is 3100 for trading goods.
    3. The following settings have been made in OBYC.
    for GBB, the G/L accounts have been assigned for general modifier "BSA", "VAX", "VAY" & "VKA".
    Please suggest me as to where i am missing any settings.
    With best regards,
    Niyaz Sayyed.

    Dear Niyaz Sayyed
    You need to check in the following areas:-
    -  check whether the material is defined as non-valuated stock
    -  go to OME9, select your Account Assignment and see whether you have checked the box "GR non-valuated".   It should not  have been checked
    thanks
    G. Lakshmipathi

Maybe you are looking for

  • TNS-12535 TNS:operation timed out - Win 7 - WAN

    Hi! Database Version: Oracle 11.2.0.2 Server OS: Linux 64bit Database server "A" at different location (connecting through a 10 MBPS link - latency 15 ms). I can ping to server. When i connect to server "A" from client on Windows 7 I got TNS-12535 er

  • Oracle 11g Installation DBCA ORA-01034: Oracle Not Available

    I have two oracle databases installed (using the default settings in dbca) and running on a Windows 2003 R2 server, already. However, when I try and create a third using the defaults, after 2%, dbca receives an ORA-01034: Oracle Not Available and sto

  • Genareting a xml file from Forms6i..

    I want to generete a xml file from database with using forms6i. The procedures of XSU generate a xml file output on the server which database has been loaded.And it works on SQL Plus..How can I gAnerate xml file from database on clint side with using

  • Happy Birthday Oran_gina

    Strong hints that today is the day, so happy probably birthday Hope you have a fabulosa day

  • OY04 setting currency maintaining (Decimal Places for currency codes) Importance

    Hello Frds, I have one doubt regarding OY04 setting in this we are maintaining currencies with decimals.I checked my OY04 setting some special currencies only we are maintaining in this tcode and in that  also some currencies only maintaining decimal