Problem in G/L posting using BAPI_ACC_DOCUMENT_POST

Hi all,
I have one requirement in interface, using BAPI. Uploading the flat file USING BAPI (BAPI_ACC_DOCUMENT_POST)
my flat file is available given below.
sl.no
Document Date
Document Type
Company Code
Posting date
Period
Currency
Reference
Doc Header Text
Line Item 1
Account
Amount
Cost Centre
Profit Centre
Text
1
08/21/2014
SA
1000
08/21/2014
09
CUR
TEST
TEST
1
100
500.00
0001
Test
1
CUR
2
200
-500.00
0001
Test
2
08/21/2014
SA
1000
08/21/2014
09
CUR
TEST
TEST
1
100
500.00
0002
Test
2
CUR
2
200
-100.00
0002
Test
2
CUR
3
200
-100.00
0002
Test
2
CUR
4
200
-100.00
0002
Test
2
CUR
5
200
-100.00
0002
Test
2
CUR
6
200
-100.00
0002
Test
actually my requirement is , first time uploaded my data in ECC using BAPI (BAPI_ACC_DOCUMENT_POST). DOCUMENT no is created in BKPF table. again i've uploaded to same data using bapi.. again document no is created . but i don't need create document no in bkpf( when i'll upload 2nd time or more) in this case, i want to display error message 'this flat file already used'.
please give the solution fo this requirement. it's very urgent.

Hi
The main parameters of BAPI BAPI_ACC_DOCUMENT_POST are:
- DOCUMENTHEADER (BAPIACHE09) to transfer the header data
- ACCOUNTGL (BAPIACGL09) to transfer the g/l item data
- ACCOUNTRECEIVABLE (BAPIACAR09) to transfer the  customer item data
- ACCOUNTPAYABLE (BAPIACAP09) to transfer the vendor item data
So u need to use one of parameters above to transfer the header and item data, the amount data for every item have to be transfered by parameters CURRENCYAMOUNT
U should also considere the posting key is automatically set by BAPI, and it depends on the item type and the sign of amount:
- 40/50 for G/l
- 01/11 for customer
- 21/31 for vendor
1 40 617300     Mileage              0000310148                            310148               27.20
2 40 617900     Entertainment Exp.   0000310148                         V1 310148              177.26
3 40 144000     Input-VAT            20090925                           V4                      34.74
4 31 1019186    B.E.N. MR SAUVAT                                        V1                     239.20-
Lines 1/2 data move to ACCOUNTGL and  CURRENCYAMOUNT
Line   4   data move  to ACCOUNTPAYABLE and CURRENCYAMOUNT
The line 3 seems to be a TAX line, in this case u need to use ACCOUNTTAX and CURRENCYAMOUNT
The header data to be transfered to DOCUMENTHEADER
Max

Similar Messages

  • How to populate COPA fields for GL posting using BAPI_ACC_DOCUMENT_POST

    Hi All,
    I am posting documents in FB50 using BAPI_ACC_DOCUMENT_POST. I have a requirement to post the documents with profitability segment parameters as well. Should I use EXTENSION1 table to pass COPA updates and implement BTE to achieve it? Can anyone please guide me with the procedure to populate the COPA fields for GL posting using BAPI_ACC_DOCUMENT_POST?
    Also please let me know how/where to check if COPA is enabled for a GL account.
    Thanks,
    Subathra

    Moderator Message: This forum is for questions directly related to Web Dynpro ABAP only.  It should not be used for general questions.  I am moving this thread to the ABAP General forum.

  • Down payment request: posting using BAPI_ACC_DOCUMENT_POST

    Hello, Gurus!
    We have a problem with posting DPR using BAPI.
    We can't carry out DPR for a Vendor.
    The following parametrs were set:
    1) BSTAT = 'S'
    2) ZUMSK = 'A'
    3) BSCHL = '39' 
    4) SHKZG = 'H' 
    5) WRBTR (negative sum is written)
    6) GLVOR (business transaction) - RFBU
    7) we also set assignment to a Funds reservation document.
    When we try to execute BAPI it returns an error RE 041 "Amount in document &1 &2 may not be exceeded".
    Perhaps, FM-PSM thinks that we try post a credit memo...
    We used F-47 before, but we need to use the BAPI.

    Hi,
    I had the same problem with posting a down payment request using BAPI. Actually, it seems SAP does not allow to post this kind of document "natively". Therefore, you have to implement a BADI (ACC_DOCUMENT) in order to make it work.
    1. Be sure you have the latest notes applied for BAPI_ACC_DOCUMENT_POST (especially note 561175)
    2. As for as DP request, call BAPI with DOCUMENTHEADER, ACCOUNTRECEIVABLE and CURRENCYAMOUNT filled with your needed lines.
    In my case, I set SP_GL_IND to 'F'.
    3. In your implementation of BADI, in method CHANGE, set ACCIT-BSTAT to 'S' (noted items) so that balance check will not take it into account. You may customize your line if needed.
    This should be enough to have your document posted. I can give you more details should you need help.

  • Issue while trying to post using BAPI_ACC_DOCUMENT_POST

    Hello All,
    I am trying to create a vendor credit memo using the BAPI BAPI_ACC_DOCUMENT_POST. Here in the header I am passing username,company code, doc date,posting date,doc type (as KG for credit memo) and reference document number.
    In the account payable internal table I am passing itemacc as 1, vendor number,payment currency and payment amount.
    In account GL internal table I am passing Item no (for 2 line items 2 and 3) the GL account
    In Currency Amount internal table I have 3 entries 1 for the accounts payable and 2 for teh GL entered as above. The line items numbers are 1 (for accounts payable item) and 2,3 for the GL account items.
    First amount value is 15680 and the other 2 in GL are   -14000 and -1680 (so the sum is matching with vendor amount). Upon execution I am receiving 2 errors in the return tables
    as Error in document BKPFF and
         Enter a payment currency different to USD.
    Could any one let me know what I am missing ? Why an error stating enter a payment currency different to USD ?
    Waiting for a response.
    Thanks and Regards,
    Sachin

    Hello,
    i was able to solve this issue on my by using the same BAPI (BAPI_ACC_DOCUMENT_POST). Just needed to enter the vendor info in the accounts payable internal table and the GL info in the GL table with the amount in the currency amount table. Needed to reverse the sum in GL against the amount in accounts payable entry.
    Regards
    Sachin

  • How to post asset using BAPI_ACC_DOCUMENT_POST w/o creating custom OBJ_TYPE

    Hi,
    I want to post asset together with expense into one document. The first approach is to use BAPI_ACC_DOCUMENT_POST with custom obj_type, like ZBKPF. But when we post using the custom obj_type, we cannot reverse the document using FB08.
    Is that anyway we can post using BAPI_ACC_DOCUMENT_POST and reverse using FB08?
    Or is that any BAPI that can do this?
    Thanks,
    Tai
    Edited by: Tai Pang Ng on Apr 8, 2011 9:37 PM

    It is because I want to post asset. I tried to post my asset without specified the obj_type and acc_type, then I got an error saying cannot direct post thru my GL account. That's true becuase posting asset, we just use asset number and reconciliation GL.
    Then I tried to put my asset no in GL field, then I got another error saying the GL is not in Chart of Account, and that's true also becuase the asset no is never config in our chart of account.
    Then I found out that I had to specified the acct_type to 'A'. After that, I got another error saying RFBURFBU000000000000 is not define. That's I cannot post this thru obj_type RBFU. After checking that, I had to specified bus_act to RMWE and custom obj_type to some Z value to make it go.
    But after all these, I cannot reverse my posting using FB08 anymore because this is an custom obj_type and not allow to reverse using FB08.
    Please let me know if I made mistake in the above.
    Thanks,
    Tai

  • Upload item text for FI document using BAPI_ACC_DOCUMENT_POST

    Hi,
    I need to upload FI document posting using BAPI_ACC_DOCUMENT_POST.  However item text that I received is too long and need to store at item long text.  So can we use BAPI_ACC_DOCUMENT_POST to upload long text for item text? If this possible, may I know how to do this.
    Thanks.
    Regards,
    ain

    Hi,
    You cannot pass item long text using this BAPI,  Call the function module SAVE_TEXT after successfull call of BAPI
    Call Save_Text with following parameters.
    Text_ID : 0001 (Notes)
    Text_object : DOC_ITEM (Line Item Text)
    Language : EN
    Text Name : Company code +Document NO + Fiscal Year + Line item ID
    Regards
    Vinod

  • Problem while Posting a Document Using BAPI_ACC_DOCUMENT_POST

    Hi All,
    When i try to post my General Ledger Document using BAPI_ACC_DOCUMENT_POST, i face a situation due to the exchange rate. The field EXCH_RATE in CURRENCYAMOUNT table accepts only 5 decimals. But according to my scenario it should accept more than 5 decimals. Is there any BAPI or other way to solve this issue.
    Thanks & Regards,
    Venkatesh. R

    We restricted our entry to five decimals and solved the issue.

  • Issue with using BAPI_ACC_DOCUMENT_POST to write to table FAGLFLEXA.

    Hi,
    I'm using BAPI_ACC_DOCUMENT_POST to do intercompany posting. The posting is successful and I got the document created. The only problem is data is not written into table FAGLFLEXA. I searched in the forum and it said to make us of BTE RWBAPI01 to pass in the ledger to the document header. I have tried that, but that only writting the ledger to the document header in BKPF, still the data is not writting to the FAGLFLEXA table.

    Hi,
    I'm having the same problem. Could you solve this?
    Thank you in advance.
    Andrea

  • Down payment request for assets using bapi_acc_document_post

    Hi guys(girls)!,
    I<< priority reduced >>
    I'm posting a down payment request to an asset with a z program using bapi_acc_document_post. Everything is fine, but, when i go to fb03 to check the generated document i don't see the asset number associated to the purchase doc. When i go to bseg to check, i don't see the asset number and the subnumber. I lack just these to fields even i'm passing the values to correct fields in bapiacgl09.
    This is the values i'm passing:
    wa_acctgl-itemno_acc  =  iterator.
    wa_acctgl-gl_account  =  lv_skont.
    wa_acctgl-vendor_no   =  p_vendor.
    wa_acctgl-doc_type    =  p_tipdoc.
    wa_acctgl-item_text   =  p_txtcab.
    wa_acctgl-po_number   =  p_ponum.
    wa_acctgl-po_item     =  s_ekpo-ebelp.
    wa_acctgl-serial_no   =  imp_no.
    wa_acctgl-asset_no    =  wa_ekkn-anln1.
    wa_acctgl-sub_number  =  wa_ekkn-anln2.
    wa_acctgl-acct_type   =  'A'.
    wa_acctgl-CS_TRANS_T  =  '100'.
    wa_acctgl-asval_date  =  sy-datum.
    APPEND wa_acctgl      TO gt_acctgl.
    CLEAR wa_acctgl.
    Please help!.
    Edited by: Rob Burbank on Oct 24, 2011 9:44 AM
    Edited by: ramvargash on Oct 25, 2011 2:54 PM

    Hi Eduardo, what i'm trying to do is a down payment request for an asset. Indeed, i do the post. My problem is that the asset main number and the asset subnumber are not getting saved in bseg, so when i go to fb03 and double click on a line item, i got prompt to fb03 in visualize mode, and the fixed asset field is blank.
    I have now a week trying to get the asset main number and the asset subnumber getting saved in bseg. I note that i have other field that are not getting saved 'cause i'm not passing the value thru the bapi. This field is LNRAN.
    If you or anybody have a clue how to solve this, i would appreciate the help.
    Ramón Vargas

  • Base Amount in table BSET is doubled when posted using BAPI_ACC_DOCUMENT_PO

    Hi,
    We are using BAPI_ACC_DOCUMENT_POST to post the document. We are using the Tax Code to determine the tax and are able to succesfully post the document.
    But when we click on Taxes button in overview screen of the posted document, BASE AMOUNT is doubled than the actual base amount given. But the tax is calculated only on actual Base Amount.
    Note that, when we post the document using FB01, we dont have any issues.
    Please help us in understanding what the problem is.
    Thanks,
    Phani

    Hi,
    if you called BAPI_ACC_DOCUMENT_POST., you should chak that RETURN table does not contain messages  of type E A or X and then call FM BAPI_TRANSACTION_COMMIT.
    COMMIT WORK is triggered by IDoc inbound process if not user process calls ROLLBACK WORK. Sol I woinder whats is happening.
    Regards,
    Clemens

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • 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

  • Posting using cross company code transaction must be blocked

    Hello Guys,
    I have a  problem related to cross company code transaction.
    In the OBA7 I have the document type KE that not allows posting using cross company code transactions. In the moment that I am creating a new document through the FB01, I have an error as "Consolidated companies US52 and ' ' are different
    Message no. F5080. As a results, the document cannot be created by this way. This is the correct process.
    But I have several documents that was used the doc type KE and the cross company code transaction was used. This is my issue. I don´t know why these documents were posted. The document come from another interface via IDOC and the IDOC not errored out.
    Can anyone help on this?
    Thanks
    Rafael B.

    Hello, I´ve checked the log and no changes since 2008.
    The document was created in 2010.
    This is the message: "No logs found for the selected period"
    More suggestions?
    Regards.
    Rafael

  • Multiple Forms in a Flash Document and Posting Using ASP

    Hello everyone!
    I have some what of a dilemma on my hands. I am creating
    multiple forms in one document using Flash and need them to post
    using ASP script. I have been researching this for the last six
    days, and I have had NO luck. I have noticed that all the
    information that I have found is for one form, not more than one.
    What I have so far is the Flash document, with 4 forms. The
    basic idea is that a user chooses from a drop down menu (the
    combobox) a location, and depending on the location chosen, it
    takes the user to another frame in the flash document. The forms
    (all their own movie clip) contains a name field, a department
    field, and either a manager name a userID field or an employee
    number as well as the basic buttons for submitting the form or
    resetting the form.
    So far what I have working is the drop down menu (combobox)
    taking me to the proper frame and it shows the appropriate form.
    The reset button clearing the form (deleting any information that I
    have imputed into the input fields), but I have absolutely NO idea
    how to get the submit button to work (I did manage to get it to
    send me a message if there was nothing in one of the input fields),
    and NO idea how to get the information to the ASP file.
    Where there are 4 forms do each of them have to have their
    own ASP file attached to them, or can I use one?
    If anyone knows a site that deals with multiple forms in one
    SWF and posts using ASP that would be greatly appreciated, or if
    you know some actionscript that could be helpful.
    Thank you all in advance.

    That would be part of my problem, I really don't know ASP,
    and I am flying by the seat of my pants.
    The current script I have for the ASP file is:
    <% @Language = "VBScript" %>
    <%
    Option explicit
    Dim strfullName
    Dim strdeptName
    Dim strmanagerName
    Dim strobjeemail
    Dim strlocation
    strfullName.Request.Form("fullName_txt")
    strdeptName.Request.Form("deptName_txt")
    strmanagerName.Request.Form("managerName_txt")
    strlocation.Request.Form("locationName")
    Set strobjemail = CreateObject("CDO.Message")
    strobjemail.From = "[email protected]"
    strobjemail.To = "[email protected]"
    strobjemail.Subject = "Program from " + strlocation
    strobjemail.Body = "This user has completed this progrmam
    from " + strlocation & Chr(13) & Chr(10) & "Name: " +
    strfullName & Chr(13) & Chr(10) & "Department: " +
    strdeptName & Chr(13) & Chr(10) & + "Manager: " +
    strmanagerName
    strobjemail.Send
    Set strobjemail=nothing
    %>
    The AS code that I have so far is:
    function formValidationChecks(){
    if (fullName_txt.length==0){
    status_txt.text = "Please enter your Name";
    else if (deptName_txt.length==0){
    status_txt.text = "Please enter your Department";
    else if (managerName_txt.length==0){
    status_txt.text = "Please enter your Manager";
    else {
    status_txt.text = "Thank You!";
    variables.fullName_txt = fullName_txt.text;
    variables.deptName_txt = deptName_txt.text;
    variables.managerName_txt = managerName_txt.text;
    varLoader.load(varSend);
    trace("-----");
    trace("Name: "+fullName_txt.text);
    trace("Department: "+deptName_txt.text);
    trace("Manager: "+managerName_txt.text);
    trace("Form validated");
    submit_btn.onRelease = function(){
    status_txt.text = "";
    if(formValidationChecks()){
    var lv = new LoadVars();
    lv.fullName_txt = form.fullName_txt.text;
    lv.deptName_txt = form.deptName_txt.text;
    lv.managerName_txt = form.managerName_txt.text;
    lv.sendAndLoad("mail.asp", lv, "POST");
    reset_btn.onRelease = function()
    fullName_txt.text = "";
    deptName_txt.text = "";
    managerName_txt.text = "";
    So far my reset button clears everything, and the submit
    button is tracing the content in the form fields, but it's not even
    grabbing the asp page.
    Any suggestions? Even pages that have tutorials that are in
    the form of a video.
    Thanks

  • Error while using BAPI_ACC_DOCUMENT_POST

    Hi all,
    while using BAPI_ACC_DOCUMENT_POST i am getting an error
    "G/L account not found in chart of accounts"
    But i am able to post a document in FB01 using the same G/L account.Moreover, this error is occuring only for posting key 50.
    Please help.

    Hi all,
    while using BAPI_ACC_DOCUMENT_POST i am getting an error
    "G/L account not found in chart of accounts"
    But i am able to post a document in FB01 using the same G/L account.Moreover, this error is occuring only for posting key 50.
    Please help.

Maybe you are looking for

  • Exception caught by adapter framework: No configuration / default adapter specified for EDISeparator

    Hello Experts, I am configuring the scenario ( AS2 to EDISeparator and EDISeparator to IDOC ). Can you please help me with the error below which is from the either the EDISeparator Receiver channel or the EDISeparator Sender channle. 09.06.2014 17:52

  • Impdp error ORA 316931 29913, 31011, 19202

    One of my colleague got this error while importing a database from dump and he passed it to me resolve the issue. The import command used: impdp raviuyre/systemcr DUMPFILE=3_dir:FITHA_0.dmp LOGFILE=import_0.log TABLES=SLATIONS TABLE_EXISTS_ACTION=APP

  • Newbie here

    I got a Zire 22 from a yard sale and it didn't have the software with it ,what and where do I download it from? Post relates to: Palm Z22

  • Youtube video's | bug?

    Hello all, Since a couple of weeks were distributing folio's. In this edition, a page contains 6 different youtube video's. I've created a box for all video's, inserted their URL by youtube's share - embed. In Adobe content viewer everything works No

  • Pacman -S libgpod installed older version

    I've been using arch for about a day now and really like it. I was a Fedora person but I got sick of waiting for them to release FC6 (should have been out on the 11th ) Today I ran across something wierd when I installed libgpod. When I ran 'pacman -