Regarding Bapi (BAPI_ACC_document_post)

Hi,
While executing  the Bapi
The return message is showing that invoice document is successfully posted ,but I have checked in the database tables  like bseg,bkpf  is not updated.
could please tell me what is the problem .
Regards,
Venu.

Hai,
Use Function Module BAPI_TRANSACTION_COMMIT by exporting parameter WAIT = 'X' after
calling the BAPI.
After that, you can call function module DEQUEUE_ALL to release the locks.

Similar Messages

  • Need to upload mass excel sheet using the bapi bapi_acc_document_post.

    I am assigned with an object, where I need to post the records from a mass excel sheet in to ECC or/and BW basing the dimensions using the bapi bapi_acc_document_post.the excel sheet has header and Item data. I am pretty much new to this bapi's
    please do the need ful

    Check report "ACC_BAPI_TEST_INVOICE_RECEIPT",
    this report calls BAPI "BAPI_ACC_INVOICE_RECEIPT_POST",
    but the parameters are nearly the same.
    Best Regards, Dirk

  • 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

  • Error FI/CO interface: Balance in transaction currency from BAPI BAPI_ACC_DOCUMENT_POST

    Hi All,
    We are facing error FI/CO interface: Balance in transaction currency from BAPI BAPI_ACC_DOCUMENT_POST.
    This error we are getting only in case of passing tax data.
    Can anyone help me on this.
    Below is the code :
       *fill header
    gd_documentheader-username   =  sy-uname.
    gd_documentheader-header_txt = 'Test'.
    gd_documentheader-comp_code  = p_ccode.   "SQ
    gd_documentheader-doc_date   =  sy-datum.
    gd_documentheader-pstng_date =  sy-datum.
    gd_documentheader-doc_type   = 'KR'.
    gd_documentheader-ref_doc_no = p_xblnr. "SQ
    *gd_documentheader-bus_act = 'RMWE'.
    city = p_city.
    state = p_state.
    zipcode = p_zip.
    *get tax juridisction code
    IF NOT ( city     IS INITIAL ) AND
       NOT ( state    IS INITIAL ) AND
       NOT ( zipcode IS INITIAL ).
      SELECT SINGLE rfcdest INTO ttxd-rfcdest FROM ttxd
       WHERE kalsm = 'TAXUSX'.
      CLEAR x_com_jur.
      REFRESH t_com_jur.
      x_com_jur-city     =  city.
      x_com_jur-state    =  state.
      IF zipcode+5(4) EQ space.
        zipcode+5(4) = '0000'.
      ENDIF.
      CONCATENATE zipcode+0(5) '-' zipcode+5(4)
             INTO x_com_jur-zipcode.
      x_com_jur-country  = 'US'.
      CALL FUNCTION 'RFC_DETERMINE_JURISDICTION'
        DESTINATION ttxd-rfcdest
        EXPORTING
          location_data    = x_com_jur
        IMPORTING
          location_err     = x_com_err
        TABLES
          location_results = t_com_jur.
      IF sy-subrc = 0.
        READ TABLE t_com_jur INTO x_com_jur INDEX 1.
        it_accountgl-taxjurcode =  x_com_jur-txjcd.
      ENDIF.
    ENDIF.
    *fill AP (line 1) - vendor related data
    SELECT SINGLE zterm FROM lfb1 INTO p_zterm WHERE lifnr = p_lifnr.
    it_accountpayable-itemno_acc = 1.
    it_accountpayable-tax_code = p_txcd.
    it_accountpayable-pmnttrms   = p_zterm. "SQ
    it_accountpayable-vendor_no  = p_lifnr. "SQ
    *it_accountpayable-item_text = 'S2P Testing in UDR1'. - SQ
    it_accountpayable-pymt_meth = p_pmet. "- SQ
    APPEND it_accountpayable.
    *fill GL (line 2)
    it_accountgl-itemno_acc      =  2.
    *item_text - sq
    IF p_asset IS NOT INITIAL.
      TABLES : anlz,
               anla.
      SELECT SINGLE * FROM anlz  WHERE anln1 = p_asset.
      SELECT SINGLE * FROM anla WHERE anln1 = p_asset.
    *concatenate '00' anla-KTOGR into it_accountgl-gl_account .
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = anla-ktogr
        IMPORTING
          output = it_accountgl-gl_account.
      it_accountgl-asset_no = p_asset.
      it_accountgl-sub_number = '0000'.
      it_accountgl-cs_trans_t = '105'.
      it_accountgl-acct_type = 'A'.
    ELSE.
      it_accountgl-gl_account      = p_gl.
      it_accountgl-costcenter      = p_cc.
      it_accountgl-wbs_element     = p_posid.
    ENDIF.
    it_accountgl-comp_code       = p_ccode.
    it_accountgl-tax_code = p_txcd.  "SQ
    it_accountgl-pstng_date      =  sy-datum.
    it_accountgl-fisc_year       =  sy-datum(4).
    APPEND it_accountgl.
    CLEAR it_currencyamount.
    *fill currency ammounts for lines 1 & 2
    it_currencyamount-currency    = p_waers.  "SQ
    it_currencyamount-itemno_acc  = 1.
    *it_currencyamount-amt_base =  -1.
    it_currencyamount-amt_doccur  = - 116. "p_totamt.
    it_currencyamount-CURRENCY_ISO = 'USD'.
    it_currencyamount-tax_amt  = - 16.
    APPEND it_currencyamount.
    CLEAR it_currencyamount.
    it_currencyamount-itemno_acc  = 2.
    it_currencyamount-currency    = p_waers.  "SQ
    it_currencyamount-amt_doccur  = 100.
    it_currencyamount-CURRENCY_ISO = 'USD'.
    *it_currencyamount-amt_base =  100.
    *it_currencyamount-TAX_AMT =  -10.
    APPEND it_currencyamount.
    *tax data
    it_accounttax-itemno_acc = 3.
    it_accounttax-tax_code = p_txcd.
    it_accounttax-gl_account = '0023110000'.
    *it_accounttax-gl_account = p_gl.
    it_accounttax-TAXJURCODE = x_com_jur-txjcd.
    it_accounttax-acct_key = 'NVV'.
    it_accounttax-cond_key = 'XP2I'.
    **it_accounttax-direct_tax = 'X'.
    APPEND it_accounttax.
    CLEAR it_currencyamount.
    it_currencyamount-itemno_acc  = 3.
    it_currencyamount-currency    = p_waers.  "SQ
    it_currencyamount-amt_doccur  = 16.
    it_currencyamount-CURRENCY_ISO = 'USD'.
    it_currencyamount-amt_base =  100.
    it_currencyamount-TAX_AMT =  - 16  .
    APPEND it_currencyamount.
       CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader          = gd_documentheader
    IMPORTING
       obj_key                 = wa_obj_key
      TABLES
       accountgl               = it_accountgl
    *   ACCOUNTRECEIVABLE       =
       accountpayable          = it_accountpayable
       accounttax              = it_accounttax
        currencyamount          = it_currencyamount
    *   CRITERIA                =
    *   VALUEFIELD              =
    *   EXTENSION1              =
        return                  =  it_return
    COMMIT WORK.
    Regards,
    Priyaranjan

    Hi,
    Reason 1:
    An revenue-recognition-relevant item has several active conditions whose values cancel themselves so that a net item value of 0 results. The conditions have both the same revenue account (SAKN1) and the same clearing account (SAKN2).
    For these conditions, the system writes a line with value 0 into the temporary FI/CO interface (internal tables: CACCIT, CACCCR). If table VBREVK does not contain control lines for this line, no further processing occurs and the line remains in the temporary FI/CO interface. Then the system reads this line for the creation of the next billing item which conatins a net value and generates a posting line with value 0. As a result, there is a balance in the FI/CO interface, and the billing document cannot be transferred.
    Reason 2:
    The billing document contains at least one item with an item category for which there is a setting stipulating that the values of this item should not be transferred to the header total of the document.
    That is, in the maintenance of the item categories, this item category has the characteristic 'X' or 'Y' in 'Statistical value' field.
    Reason 3:
    Case: Billing document contains items without pricing conditions.
    Then, on release to accounting, error RW022 occurs.
    regards,
    Saju.S

  • 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'

    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

  • Bapi 'bapi_acc_document_post'.

    hi all,
    i'm creating credit memo request thru bapi 'bapi_acc_document_post'.
    i'm getting success message for creation of cmr(it is also updating the table bkpf) but
    i'm not able to get the document number for created document.
    can ne 1 suggest me how to get document number thru bapi in this case.
    thanx in advance
    Manish

    Hi,
    Please try with this:
    Declare a variable like this:
    V_OBJ_KEY type AWKEY.
    Pass this to OBJ_KEY.
    AWKEY (OBJ_KEY) Reference key
    Source document number
    The reference key is made up of:
    u2022     AWREF Reference document number (10 digits)
    Source document number
    u2022     AWORG Reference organizational unit (10 digits)
    Number range ID (if required)
    When the document is being processed, the system checks whether a reference document number (first part of the reference key) has been transferred.
    If an accounting document is posted via the interface in Accounting, the sending application transfers a unique reference. It consists of object key and object type. The object key consists of a reference document number and a reference organizational unit.
    Example: 1000007899 00011996
    Reference Reference organizational unit
    document no. client and fiscal year
    The object type contains a note on storing the original document.
    u2022     AWTYP (OBJ_TYPE) Reference transaction
    Sender ID
    Regards,
    Neenu Jose.

  • Issue with posting G/L using the BAPI " BAPI_ACC_DOCUMENT_POST"

    Hi all,
    I am trying to create a G/L document using the BAPI "BAPI_ACC_DOCUMENT_POST". The Bapi is returning me a success message, but i am not able to see the document in BKPF/BSEG.
    Can somebody please let me know if there is any customization that needs to be done to get the document number reflected in the corresponding tables after i execute this BAPI.
    Here is the part of the code that i am using to fill the header structure:
      docheader-obj_type = 'REACI'.
        docheader-obj_key = 'TEST'.
        docheader-obj_sys = 'ECSCLNT010'.
        docheader-bus_act = 'RFBU'.
        docheader-username = sy-uname.
        docheader-header_txt = 'HDR TEXT'.
        docheader-comp_code = 'SC01'.
        docheader-doc_date = sy-datum.
        docheader-pstng_date = sy-datum.
        CASE wa_input_tmp-batch_type .
          WHEN '0'.
            docheader-doc_type = 'SA'.
          WHEN '1'.
            docheader-doc_type = 'RA'.
        ENDCASE.
    Any help is much appreciated.
    Thanks in Advance,
    Suresh

    See the below code :
    I have tested program in my system :
    *&---HEADER DECLARATION
    DATA: HEADER TYPE BAPIACHE09.                " HEADER DATA
                 INTERNAL TABLE DECLARATION
    *&----G/L ACCOUNT ITEM
    DATA: ACCOUNTGL TYPE STANDARD TABLE OF BAPIACGL09.
    *&---CURRENCY ITEMS
    DATA: CURRENCY_AMOUNT TYPE STANDARD TABLE OF BAPIACCR09.
    *&----RETURN PARAMETER
    DATA: RETURN  TYPE STANDARD TABLE OF BAPIRET2 with header line.
                         WORK-AREA DECLARATION
    *&----WORKAREA FOR G/L ACCOUNT ITEM
    DATA: WA_ACCOUNTGL TYPE BAPIACGL09.
    *&---WORKAREA FOR CURRENCY ITEMS
    DATA: WA_CURRENCY_AMOUNT TYPE BAPIACCR09.
                        INITIALIZATION
    HEADER-HEADER_TXT  = 'TEST HEADER'.
    HEADER-USERNAME    = 'DEVELOPER'.
    HEADER-COMP_CODE   = '0002'.
    HEADER-FISC_YEAR   = '2007'.
    HEADER-DOC_DATE    = '20070502'.
    HEADER-PSTNG_DATE  = '20070502'.
    HEADER-TRANS_DATE  = '20070502'.
    HEADER-DOC_TYPE    = 'SA'.
    HEADER-BUS_ACT     = 'RFBU'.
    WA_ACCOUNTGL-ITEMNO_ACC  = '0000000010'.
    WA_ACCOUNTGL-GL_ACCOUNT = '0000113020'.
    WA_ACCOUNTGL-ITEM_TEXT  = 'SO_DOC'.
    WA_ACCOUNTGL-DE_CRE_IND = 'S'.
    APPEND WA_ACCOUNTGL TO ACCOUNTGL.
    CLEAR WA_ACCOUNTGL.
    WA_ACCOUNTGL-ITEMNO_ACC  = '0000000020'.
    WA_ACCOUNTGL-GL_ACCOUNT = '0000113020'.
    WA_ACCOUNTGL-ITEM_TEXT  = 'SO_DOC'.
    WA_ACCOUNTGL-DE_CRE_IND = 'H'.
    APPEND WA_ACCOUNTGL TO ACCOUNTGL.
    CLEAR WA_ACCOUNTGL.
    WA_CURRENCY_AMOUNT-ITEMNO_ACC = '0000000010'.
    WA_CURRENCY_AMOUNT-AMT_DOCCUR = '500'.
    WA_CURRENCY_AMOUNT-CURRENCY   = 'INR'.
    APPEND WA_CURRENCY_AMOUNT TO CURRENCY_AMOUNT.
    CLEAR WA_CURRENCY_AMOUNT.
    WA_CURRENCY_AMOUNT-ITEMNO_ACC = '0000000020'.
    WA_CURRENCY_AMOUNT-AMT_DOCCUR = '-500'.
    WA_CURRENCY_AMOUNT-CURRENCY   = 'INR'.
    APPEND WA_CURRENCY_AMOUNT TO CURRENCY_AMOUNT.
    CLEAR WA_CURRENCY_AMOUNT.
                    START-OF-SELECTION
    START-OF-SELECTION.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader          = HEADER
      CUSTOMERCPD             =
      CONTRACTHEADER          =
    IMPORTING
      OBJ_TYPE                =
      OBJ_KEY                 =
      OBJ_SYS                 =
      tables
       ACCOUNTGL               =   ACCOUNTGL
      ACCOUNTRECEIVABLE       =
      ACCOUNTPAYABLE          =
      ACCOUNTTAX              =
        currencyamount          = CURRENCY_AMOUNT
      CRITERIA                =
      VALUEFIELD              =
      EXTENSION1              =
        return                  = RETURN
      PAYMENTCARD             =
      CONTRACTITEM            =
      EXTENSION2              =
      REALESTATE              =
    IF return-type NA 'EA'.
    call function 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'.
    IMPORTING
      RETURN        = RETURN.
      write:/ return-message.
    else.
      write:/ return-message.
    ENDIF.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Problem using BAPI BAPI_ACC_DOCUMENT_POST with vendor field XZEMP

    Hi, I'm using the bapi BAPI_ACC_DOCUMENT_POST, when i fill the table ACCOUNTPAYABLE and execute it, if i use a vendor that doesn't have an 'X' in the field XZEMP (Indicator: Alternative payee in document allowed ?) of the table LFA1 the bapi returns an error.
    I haven't found any place in the bapi tables to override this.
    Is there something that should be parameterized so that this error doesn't happen?
    Thanks!

    Hi,
    Refer
    https://wiki.sdn.sap.com/wiki/display/Snippets/VendorInvoicePostingusingBAPI
    Re: BAPI_ACC_DOCUMENT_POST

  • Creating Vendor Credit Memo Using BAPI  BAPI_ACC_DOCUMENT_POST

    Hi,
    I want to create a vendor credit memo using the bapi BAPI_ACC_DOCUMENT_POST but with posting keys as 21 and 50.Is it possible to do so.I tested the bapi passing the data to the accountgl table.Do i have to pass data to another table ?

    hi Eric,
    I even tried passing the data to the accounts receivable and accounts payable tables passing the GL account no in these tables.Still teh document get posted with keys 40 and 50.Also the credit entries should be assigned to COPA segment of sales order/item.
    The vendor credit memo should look as follows look as follows:
    Dr Vendor (PK = 21) $ 35,000
    Cr Freight expense account (PK = 50) $ 10,000……….assigned to COPA segment of sales order/ item 20000397/10
    Cr Freight expense account (PK = 50) $ 5,000……….assigned to COPA segment of sales order/ item 20000397/20
    Cr Freight expense account (PK = 50) $ 20,000……….assigned to COPA segment of sales order/ item 20000398/10

  • Wht is similar field of BDC's BBKPF-BVORG in BAPI-BAPI_ACC_DOCUMENT_POST?

    Hi Experts,
    We can post GL acct docs via BDC and BAPI (BAPI_ACC_DOCUMENT_POST).
    In BDC, there is a filed w/ name BBKPF-BVORG-->Number of Cross-Company Code Posting Transaction, so, I am lookig for the same field/any other similar to BVPRG, in BAPI structure - BAPIACHE09, but I did not find any one?
    So, pls. let me know that, How can I fix it? any other alternative field? How can I populate my_value via BAPI for this field?
    thanq

    You should not be setting this field in your BAPI (or BDC as far as I know).  SAP will set this field at the time of posting.  It is used to determine cross-company postings or not.

  • Create reversal document with BAPI: BAPI_ACC_DOCUMENT_POST.

    Hi Guys,
    I am Create reversal document with BAPI: BAPI_ACC_DOCUMENT_POST.First I am post financial document with BAPI BAPI_ACC_DOCUMENT_POST and Same Document. i am Reversal  with same BAPI 'BAPI_ACC_DOCUMENT_POST'.
    New reversal docment is created. but posting key are not changingin reversal docment.whatever posting key created in posting same posting key are created while reversal also.Please help me

    check
    Mapping of POSTING KEY in BAPI_ACC_DOCUMENT_POST

  • Regarding BAPI Docu

    Hi,
    I want to learn BAPI,can anyone send me the documentation regarding BAPI.
    Like what is BAPI?
    use of BAPI?
    When the BAPI will be used..........
    Thanx in advance.

    Hi,
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    u can check the below the material also
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    I have answered this question before..
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Example Code
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    Bdc to Bapi
    The steps to be followed are :
    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
    2. Create a Z program and call the BAPi (same as a Funtion module call).
    2. Now, if you see this BAPi, it has
    -> Importing structures.
    eg: SALESDOCUMENT: this will take the Sales order header data as input.
    -> Tables parameters:
    eg: ORDER_ITEM_IN: this will take the line item data as input.
    Note :
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add
    Example
    1. Delete the whole order
    2. Delete order items
    3. Change the order
    4. Change the configuration
    Notes
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
    For further details... refer to the Function Module documentation for the BAPi.
    Bapi to VB(Visual Basic)
    Long back I had used the following flow structure to acheive the same.
    Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
    my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
    You need to have com4abap.exe
    If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
    else refer OSS note 419822 for installation of com4abap
    after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
    for setting up com4abap and rfc destination please refer to the documentation for com4abap.
    Invoke NEW DCOM session
    call function 'BEGIN_COM_SESSION'
    exporting
    service_dest = service_dest "(this will be a RFC destination created in SM59)
    importing
    worker_dest = worker_dest
    exceptions
    connect_to_dcom_service_failed = 1
    connect_to_dcom_worker_failed = 2
    others = 3.
    call function 'create_com_instance' destination worker_dest
    exporting
    clsid = g_c_clsid
    typelib = g_c_typelib
    importing
    instid = g_f_oid
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    call function 'com_invoke' destination worker_dest
    exporting
    %instid = g_f_oid
    %method = 'UpdatePDF'
    sntemp = g_v_const_filent
    snsysid = sy-sysid
    snflag = 'N'
    tables
    rssaptable = g_t_pdfdetail1
    %return = g_t_pdfdetail1 "t_test
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    then close the com session , using
    FM delete_com_instance
    FM END_COM_SESSION
    Regards,
    Priyanka.

  • Regarding BAPI HRXSS_CAT_WD_RECORD

    Hi Experts,
    This is regarding BAPI HRXSS_CAT_WD_RECORD.for  this BAPI ,  I am providing inputs like this
    IV_PERNR = 90030.
    IV_ACTION  = COPY_FROM_PREVIOUS_PERIOD.
    IV_BEGDA = 09/20/2008 .
    IV_ENDDA = 09/26/2008 .
    So this BAPI has to copy the previous period(week) data to current week what I provided in the input area.But it is not returing (it is not copying previous week data).means COPY_FROM_PREVIOUS_PERIOD action is not working in BAPI.
    Is there any BAPI for meeting this requirement. I want copy the previous weeks time sheet data to week dates provided in input. This functionality is available in Tcode in cat22.
    Regards,
    Vinod

    You may use the following BAPI (actual BAPI these one) to fulfil your requirement:
    - [BAPI_CATIMESHEETRECORD_GETLIST|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_catimesheetrecord_getlist&adv=false&sortby=cm_rnd_rankvalue]
    - [BAPI_CATIMESHEETMGR_INSERT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_catimesheetmgr_insert&adv=false&sortby=cm_rnd_rankvalue]
    Regards

Maybe you are looking for

  • Using an external hard drive?help

    my hard drive on my laptop is full so i purchased a 30gb external hard drive to serve the purpose of containg all my itunes library.i have dragged my entire library over to the external drive and has successfully duplicated in the external drive.my m

  • Tax calculation in BAPI_ACC_DOCUMENT_POST

    Hi all, We have a program in which BDC (Call Transaction) is used to do postings to GL accounts with transaction FB01. Now, the requirement is to use BAPI ‘BAPI_ACC_DOCUMENT_POST’ to do the postings. I did with bapi but one problem is coming in this.

  • Extracting numeric value of a char

    Hi All, I need to get the numeric value of the chars. Here is the code I am using: TextField userNumber = new TextField("User Number:", "", 10, TextField.NUMERIC); String forNumber = userNumber.getString(); char number2 = forNumber.charAt(1); char nu

  • The best way to connect with Nutanix, follow these social channels

    Nutanix Named a Leader in the 2015 Gartner Magic Quadrant for Integrated SystemsReady to compare top hyperconverged infrastructure vendors? See why Gartner named Nutanix a leader in this newly released report for 2015.Download the report and learn:Ex

  • DBA Cockpit Sybase ASE - Access Plan not displayed

    Hello, We are running SAP ECC 740 on Sybase ASE 15.7, I'd previously used DBA Cockpit to view access plans for queries prior to our ECC upgrade. Since upgrading to 740 DBA Cockpit has had a facelift, and now I can't see an Access Plan when I try clic