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

Similar Messages

  • Hello !  pls give some ti[ps how to use bapi's for data uploading?

    hello !
      pls give some ti[ps how to use bapi's for data uploading?
    regards,
    Arjun

    Hi,
    See the below report extract:
    where it_data is having uploaded data.
    LOOP AT<b> it_data</b> INTO wa_data.
        line_count = sy-tabix.
        "Date Validation
        CONCATENATE wa_data-uplft_date4(4) wa_data-uplft_date2(2) wa_data-uplft_date+0(2)
        INTO wa_data-uplft_date.
        "READ TABLE it_ekko INTO wa_ekko WITH KEY lifnr = wa_data-vendor.
        LOOP AT it_ekko_temp INTO wa_ekko_temp WHERE lifnr = wa_data-vendor.
          IF wa_ekko_temp-kdatb <= wa_data-uplft_date AND wa_ekko_temp-kdate >= wa_data-uplft_date.
            MOVE-CORRESPONDING wa_ekko_temp TO wa_ekko.
            APPEND wa_ekko TO it_ekko.
          ENDIF.
        ENDLOOP.
        "IF sy-subrc = 0 AND wa_ekko-kdatb <= wa_data-uplft_date AND wa_ekko-kdate >= wa_data-uplft_date.
        LOOP AT it_ekko INTO wa_ekko.
          wa_data_header-pstng_date = wa_data-uplft_date.
          wa_data_header-doc_date = sy-datum.
          wa_data_header-bill_of_lading = wa_data-bill_of_lad.
          wa_data_header-ref_doc_no = wa_data-del_no.
          CONCATENATE wa_data-header_text1 '-'
                      wa_data-header_text2 '-'
                      wa_data-header_text3 '-'
                      wa_data-header_text4
                      into wa_data_header-HEADER_TXT.
          IF wa_data-indicator = 'Y'.
            wa_data_item-material = '000000000000200568'.
          ELSE.
            wa_data_item-material = '000000000000200566'.
          ENDIF.
          LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln = wa_ekko-ebeln AND matnr = wa_data_item-material.
            "Collect Item Level Data
            wa_data_item-plant = '1000'.
            wa_data_item-stge_loc = '1001'.
            wa_data_item-move_type = '101'.
            wa_data_item-vendor = wa_data-vendor.
            wa_data-qnty = wa_data-qnty / 1000.
            wa_data_item-entry_qnt = wa_data-qnty.
            wa_data_item-po_pr_qnt = wa_data-qnty.
            wa_data_item-entry_uom = 'KL'.
            wa_data_item-entry_uom_iso = 'KL'.
            wa_data_item-orderpr_un = 'KL'.
            wa_data_item-orderpr_un_iso = 'KL'.
            wa_data_item-no_more_gr = 'X'.
            wa_data_item-po_number = wa_ekpo-ebeln.
            wa_data_item-po_item = wa_ekpo-ebelp.
            wa_data_item-unload_pt = wa_data-unload_pt.
            wa_data_item-mvt_ind = 'B'.
            APPEND wa_data_item TO it_data_item.
            CLEAR wa_data_item.
          ENDLOOP.
          CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              goodsmvt_header = wa_data_header
              goodsmvt_code   = goodsmvt_code
              testrun         = 'X'
            TABLES
              goodsmvt_item   = it_data_item
              return          = return.
          READ TABLE return INTO wa_return WITH KEY type = 'S'.
          IF sy-subrc <> 0.
            DESCRIBE TABLE return LINES sy-tfill.
            IF sy-tfill = 0.
              CALL FUNCTION <b>'BAPI_GOODSMVT_CREATE'</b>   
            EXPORTING
                  goodsmvt_header = wa_data_header
                  goodsmvt_code   = goodsmvt_code
                  testrun         = ' '
                TABLES
                  goodsmvt_item   = it_data_item
                  return          = return.
              CALL FUNCTION <b>'BAPI_TRANSACTION_COMMIT'</b>
               EXPORTING
                 WAIT          = 'X'
              IMPORTING
                RETURN        =
            ENDIF.
          ENDIF.
          LOOP AT return INTO wa_return.
            WRITE: 'Messsage TYPE  ', wa_return-type,
                  /,'ID  ', wa_return-id,
                  /, 'Number  ', wa_return-number,
                  /, 'Message  ', wa_return-message,
                  /, 'Long Text  ', wa_return-message_v1,
                                    wa_return-message_v2,
                                    wa_return-message_v3,
                                    wa_return-message_v4,
                 /, 'Failed at line', line_count.
          ENDLOOP.
          CLEAR: wa_ekko, wa_ekpo, wa_data, it_data_item[], wa_data_header.
        ENDLOOP.
    Reward if useful!

  • How to use Bapi -  'BAPI_ACC_DOCUMENT_POST'

    Hi Gurus,
    I want to use Bapi - 'BAPI_ACC_DOCUMENT_POST'.
    The below code gived message that - Document posted successfully: BKPFF 180000046710012010 DW1CLNT100
    but the document number gererated is not getting stored in any of BKPF or BSEG tables.
    The Bapi should work in the same way as FB01
    Please check and let me know your valuable suggestions on why document number is not getting saved.
    DATA: lwa_header  TYPE bapiache09,
          lt_ar       TYPE TABLE OF bapiacar09,
          lwa_ar      TYPE bapiacar09,
          lt_return   TYPE TABLE OF bapiret2,
          lwa_return  TYPE bapiret2,
          lt_curr     TYPE TABLE OF bapiaccr09,
          lwa_curr    TYPE bapiaccr09.
    *Start
    DATA : it_accountgl  TYPE STANDARD TABLE OF bapiacgl09 ,
           lwa_accountgl TYPE bapiacgl09.
    *End
    CLEAR: lwa_header, lt_ar, lwa_ar, lt_return, lwa_return, lt_curr, lwa_curr.
    lwa_header-bus_act      = 'BKPF'.
    lwa_header-username     = 'GOWDA'.
    lwa_header-comp_code    = '1001'.
    lwa_header-doc_date     = '20091102'.
    lwa_header-pstng_date   = '20091102'.
    lwa_header-trans_date   = '20091102'.
    lwa_header-fisc_year    = '2010'.
    lwa_header-fis_period   = '06'.
    lwa_header-doc_type     = 'DR'.
    lwa_accountgl-itemno_acc = '0000000001'.
    lwa_accountgl-gl_account = '0020000000'.
    lwa_accountgl-tax_code   = 'V1'.
    lwa_accountgl-item_text  = 'BAPI Test G/L line item'.
    APPEND lwa_accountgl TO it_accountgl.
    *lwa_ar-itemno_acc  = '0000000001'.
    *lwa_ar-customer    = '4000000006'.
    *lwa_ar-gl_account  = '0012110000'.
    **lwa_ar-gl_account  = '0020000000'.
    *lwa_ar-profit_ctr  = '0000000217'.
    *APPEND lwa_ar TO lt_ar.
    lwa_curr-itemno_acc = '0000000001'.
    lwa_curr-curr_type  = '00'.
    lwa_curr-currency   = 'USD'.
    lwa_curr-amt_base   = '100.00'.
    APPEND lwa_curr TO lt_curr.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader    = lwa_header
      TABLES
        accountgl         = it_accountgl
        accountreceivable = lt_ar
        currencyamount    = lt_curr
        return            = lt_return.
    COMMIT WORK.
    DATA: bt_return LIKE bapiret2.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait   = 'X'
      IMPORTING
        return = bt_return.
    LOOP AT lt_return INTO lwa_return.
      WRITE: / lwa_return-message.
    ENDLOOP.

    Hi Avi
    check this code  may you get some hint
    DATA gd_documentheader LIKE bapiache09.
    DATA l_type            LIKE gd_documentheader-obj_type.
    DATA l_key             LIKE gd_documentheader-obj_key.
    DATA l_sys             LIKE gd_documentheader-obj_sys.
    DATA it_accountgl      LIKE TABLE OF bapiacgl09 WITH HEADER LINE.
    DATA it_currencyamount LIKE TABLE OF bapiaccr09 WITH HEADER LINE.
    DATA it_return         LIKE TABLE OF bapiret2   WITH HEADER LINE.
    DATA it_return1        LIKE TABLE OF bapiret2   WITH HEADER LINE.
    gd_documentheader-username   = sy-uname.
    gd_documentheader-header_txt = 'BAPI Test'.
    gd_documentheader-comp_code  =  'RS01'.
    gd_documentheader-fisc_year  = '2008'.
    *gd_documentheader-doc_date   = '0'.
    *gd_documentheader-pstng_date = sy-datum.
    gd_documentheader-bus_act    = 'RMRP'.
    gd_documentheader-fis_period = '11'.
    gd_documentheader-doc_type = 'DW'.
    CLEAR it_accountgl.
    it_accountgl-itemno_acc     = 1.
    it_accountgl-gl_account     = '0011500000'.
    it_accountgl-tax_code       = 'V0'.
    it_accountgl-item_text      = 'BAPI Test G/L line item'.
    it_accountgl-customer       = 'AG0460'.
    *it_accountgl-profit_ctr     = '0000002002'.
    it_accountgl-de_cre_ind     = 'H'.
    it_accountgl-comp_code      = 'RS01'.
    it_accountgl-doc_type       = 'DR'.
    *it_accountgl-fis_period     = '06'.
    *it_accountgl-fisc_year      = '2009'.
    it_accountgl-pstng_date     = sy-datum.
    APPEND it_accountgl.
    CLEAR it_currencyamount.
    it_currencyamount-itemno_acc   = 1.
    it_currencyamount-curr_type    = '00'.
    it_currencyamount-currency     = 'INR'.
    it_currencyamount-amt_base     = '100'.
    APPEND it_currencyamount.
    CLEAR it_currencyamount.
    it_currencyamount-itemno_acc   = 2.
    it_currencyamount-curr_type    = '00'.
    it_currencyamount-currency     = 'INR'.
    it_currencyamount-amt_base     = '100'.
    APPEND it_currencyamount.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader = gd_documentheader
      IMPORTING
        obj_type       = l_type
        obj_key        = l_key
        obj_sys        = l_sys
      TABLES
        accountgl      = it_accountgl
        currencyamount = it_currencyamount
        return         = it_return.
    WAIT UP TO 10 SECONDS.
    IF sy-subrc IS INITIAL.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    Regards
    Nilesh

  • How to use BAPI Program for change workcenter in co02?

    Hi  Abapers.
           Anybody please tell me how to change the workcenter in CO02 using BAPI Programe.
          Please give me sample of this.
           I will give urs reward of points.
    Thanks
    Regards,
    S.Muthu.

    Hi,
    Use the Function module CR_WORKCENTER_UPDATE
    for workcenter change.
    It is an update function module so you have to call it in update mode with a COMMIT statement to trigger it.
    CALL FUNCTION CR_WORKCENTER_UPDATE IN UPDATE TASK
    exporting...
    imporing..
    COMMIT WORK.
    Note: only after the commit statement the function module will be called in update mode.
    Regards,
    Raj.

  • How to use BAPI extension for updating field which is not in BAPI stracture

    I am doing a conversion for control cycle create. The data is maintained in DB Table "PKHD". i have to update 12 fields threre through BAPI "BAPI_KANBANCC_CREATE". there are 11 fields in BAPI structure. but 1 field called"BERKZ" is not there . How can i update it through EXTENSION.

    Hi ,
    in the bapi extension check one structure with name BAPIPAREX will available..
    you need to pass custom structure in that..
    ands conactenate 12 field of your structure and pass in to value1 in bapirex structure and append.
    go to se11 and enter >bapiparex> check where it is used -->see the zprogram and check how it is used the add your code according to that..
    Regards,
    Prabhudas

  • How to use Phone enrolment for an Intune account?

    I have created a Microsoft Intune account and setup a signed company hub for phone devices.
    But I cannot work out what information to enter into the Windows Phone 8.0 -> settings -> company apps in order to enrol the phone onto Intune. I have an Intune user called '[email protected]'. So I can log into Intune online by using this
    account with the appropriate password.
    But on the phone when it asks for email address I enter '[email protected]'. But it fails saying I should check the email address and server address. Should I be entering something else instead?

    Please try to follow the instruction mentioned in
    http://www.microsoft.com/en-us/download/details.aspx?id=36174
    and I think windows intune forum is more suitable for your question.
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • How to add new line item using BAPI BAPI_CONTRACT_CHANGE for contract-ME32K

    HI Experts,
    how to add new line item using BAPI: BAPI_CONTRACT_CHANGE for existing contract.
    Requirement:
    Already the contract having two line items using ME31K.
    Custom program has to add new line items in existing contract.
    Thanks,
    Sendil

    I got the solution:
    We can do like this:
    1. Get all details using details, BAPI_CONTRACT_GETDETAIL.
    2. After getting results, append new line item. Then use your BAPI.
    Check this posting program.. where this bapi is used, use the same coding technique.
    IDOC_INPUT_PURCONTRACT_CHANGE

  • How to use BAPI function module for maintaing product type to material

    Hi,
    Can you pls suggest me how to use BAPI Fuction module CCAP_REV_LEVEL_MAINTAIN
    for maintaining the product type for the material using change number.
    Pts will be rewarded.
    Best Regards,
    Padhy

    Hi,
    Can you pls suggest me how to use BAPI Fuction module CCAP_REV_LEVEL_MAINTAIN
    for maintaining the product type for the material using change number.
    Pts will be rewarded.
    Best Regards,
    Padhy

  • How to use BAPI to add a new version for a claim number in WTY transaction.

    How to use BAPI to add a new version for a claim number in WTY transaction.
    I am using  function module " BAPI_WARRANTYCLAIM_ADD_VERSION ".
    It needs to copy all contents of previous version to a new version.
    While doing so i am unable to copy fields like valic valoc etc. Any ways by which  i can copy this values.
    WTY will update PNWTYH , PNWTYV and PVWTY tables.
    Thanking you,
    Lokesh.

    Hi Vishnu,
    You can do that through EEWB. Please go through SAP Note 484597. You would get the details of using Easy Enhancement Work bench.
    Rewards point if you think this info is useful
    Regards,
    Dipender Singh

  • How to use Extensionin, Extensionout FOR BAPI ENHANCEMENT

    Hi,
    I need to do the enhancemen for BAPI. I don't know how to do it.
    if there is any good procedure plz give me.
    Thanks in Advance,
    NV

    Hi ,
    In the EXTENSIONIN param Structure should be BAPI_TE_XXXXX(Which has the custom fields) .
    If you don't know one in se11 search with BAPI_TE_* , I am sure you will one which has ur fields.
    And then in Value part1 should have your data.
    For Ex. you want to send company code , asset no.
    first4 will be your comp code , Next 12 will ur Asset no .
    Please revert back if more help required.
    Also Check for similar work
    [Thread|Re: How to use BAPI]
    Rhea.

  • 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

  • Can we use BAPI BAPI_ACC_DOCUMENT_POST to upload the vendor invoice?

    Hi,
    Can anybody tell me, can we use bapi BAPI_ACC_DOCUMENT_POST to upload the vender invoice?
    If yes, then which parameters we have to pass, and if no, then which is the other BAPI which is used for
    this purpose?
    Regards,
    Mrunal

    Hi Mrunal,
    Yes you can use BAPI_ACC_DOCUMENT_POST to upload vendor invoices.
    Parameters which are required to be passed are :
    Import tab :
    DOCUMENTHEADER: Mandatory fields for this specififed in documentation for this.
    Table tab:
    ACCOUNTGL: Enteries aganist GL account will be populated in this(check documentation for mandatory fields)
    ACCOUNTPAYABLE: Enteries aganist vendors will be populated in this(check documentation for mandatory fields)
    CURRENCYAMOUNT: in this currency amount aganist GL and vendor entries will specified.
    ITEMNO_ACC field will act as identifier as to amount belongs to which GL or vendor enteries.
    This much parameter are required to post vendor invoices.
    Regards,
    Brajvir

  • F-04 (Vendor Clearing using BAPI-BAPI_ACC_DOCUMENT_POST)

    Hello all,
    i am using a BAPI - BAPI_ACC_DOCUMENT_POST for posting and clearing vendor payments but problem is that i m getting error that 'Account 3252995 in company code 5219 cannot be directly posted to', can anyone please help me?
    Regards saurabh.

    Hi Saurabh,
    I´m looking for a BAPI to clear Accounts Payable open itens (as F-30, F-28 or FB05) and I saw in your previous message that it´s possible to do this using BAPI BAPI_ACC_DOCUMENT_POST, please, could you give a clue to sove this issue? Any additional information would be well accept.
    Best Regards,
    Ivan Spellmeier

  • 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 response in XI

    HI ALL,
             Can any one suggest me, how to use bapi response in XI as a sender.
    I m using bapi BAPI_BCA_BANKSTATEMENT_EXECUTE , I am executing  this bapi manually ,but want to use this BAPI RESPONSE in XI as a sender and map it with receiver.
    can i have any idea about how to do it, or can i have the idoc which is used by this bapi BAPI_BCA_BANKSTATEMENT_EXECUTE.
    THANX
    HONEY

    Hi Honey,
    Have a look at these
    -Configuring the Sender RFC Adapter - step by step
    /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    -Troubleshooting - RFC and SOAP scenarios
    /people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009
    -sender RFC (forum thread)
    Is it possible to use the RFC sender adapter for asynchronous calls?
    Regards,
    Sreenivas

Maybe you are looking for

  • Reading data from a text file into a JTextField

    So I am writing a program that will write to and read from a large database. I was hoping to allow a graphical interface for the reading of the data, but I keep getting an error; Incompatible Types Found: java.lang.string Required: javax.swing.JTextF

  • BPM: BPE_ADAPTER UNKNOWN_MESSAGE

    Hi, I have multiple idoc to file scenario. it contains BPM. Errors exist in SXMB_MONI after  sending idocs. The error details: No object type found for the message. Check that the corresponding process is activated An exception has occurred I checked

  • Best way to label PDFs?

    This is a workflow and productivity question for Acrobat - Our organization keeps many PDF maps on our intranet, generated from engineering software. The documents don't have visible titles when viewed in the browser or when printed. What would be th

  • Applying Images from Resource Directory in JBuilder 2006

    Hi! I am having a nightmare on that. I've been trying to create a Choice List with Images, however, JBuilder never finds the images' location. I've tried creating a resource directory everywhere in my project folder, however, I coulnd't resolve the i

  • Strange Error- Invalid pc in line number table

    We have a web application on OAF(Oracle Application Framework) hosted using jdk 1.5.. we are trying to backport it to jdk 1.4.2_04.. The code compiles successfully but while trying to run the application on 1.4.2_04, it ends up in an unexpected excep