Regarding BAPI_ACC_DOCUMENT_POST

Hi ,
I am trying  to execute the BAPI ' BAPI_ACC_DOCUMENT_POST ' for the transaction FB70.
I tried to execute directly using SE37 as well as through a program.
As some body suggested in one existing thread , i am  using the following program :
*-----Making the Header
x_invheader-obj_type = 'BKPFF'. "Reference procedure
x_invheader-obj_key = '$'. "Object key
CONCATENATE sy-sysid 'CLNT' sy-mandt INTO
x_invheader-obj_sys. "Logical system of source document
x_invheader-bus_act = 'RFBU'. "Business Transaction
x_invheader-username = sy-uname. "User name
x_invheader-header_txt = x_header-col7. "Document Header Text
x_invheader-comp_code = x_header-col3. "Company Code
x_invheader-doc_date = v_doc_date. "Document Date in Document
x_invheader-pstng_date = v_pstng_date. "Posting Date in the Document
x_invheader-doc_type = 'DR'. "Reference Document Number
x_invheader-ref_doc_no = x_header-col4. "Reference Document Number
*-----For ACCOUNTRECEIVABLE
LOOP AT it_header INTO x_header.
x_bapiacar09-itemno_acc = '1'. "Accounting Document Line Item Number
*-----Filling zeros before Customer No
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_header-col2
IMPORTING
output = v_customer.
x_bapiacar09-customer = v_customer. "Customer Number 1
x_bapiacar09-comp_code = x_header-col3. "Company Code
APPEND x_bapiacar09 TO it_bapiacar09.
ENDLOOP.
*-----For ACCOUNTGL
LOOP AT it_lineitem INTO x_lineitem.
IF it_bapiacgl09 IS INITIAL.
v_itemno = 2.
ELSE.
v_itemno = v_itemno + 1.
ENDIF.
x_bapiacgl09-itemno_acc = v_itemno. "Accounting Document Line Item Number
*-----Filling zeros before G/L Account no
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_lineitem-col10
IMPORTING
output = v_gl_account.
x_bapiacgl09-gl_account = v_gl_account. "General Ledger Account
x_bapiacgl09-comp_code = x_lineitem-col11. "Company Code
x_bapiacgl09-profit_ctr = x_lineitem-col14. "Profit Center
x_bapiacgl09-item_text = x_lineitem-col15. "Item Text
APPEND x_bapiacgl09 TO it_bapiacgl09.
ENDLOOP.
*-----Clearing variable
CLEAR : v_itemno.
*-----For CURRENCYAMOUNT
LOOP AT it_header INTO x_header.
x_bapiaccr09-itemno_acc = '0000000001'. "Accounting Document Line Item Number
x_bapiaccr09-curr_type = '00'. "Currency type and valuation view
x_bapiaccr09-amt_doccur = x_header-col8. "Amount in document currency
x_bapiaccr09-currency = x_header-col9. "Currency Key
APPEND x_bapiaccr09 TO it_bapiaccr09.
ENDLOOP.
v_itemno_1 = 1.
LOOP AT it_lineitem INTO x_lineitem.
v_itemno_1 = v_itemno_1 + 1.
x_bapiaccr09_temp-itemno_acc = v_itemno_1. "Accounting Document Line Item Number
x_bapiaccr09_temp-curr_type = '00'. "Currency type and valuation view
CONCATENATE '-' x_lineitem-col12 INTO v_amount.
x_bapiaccr09_temp-amt_doccur = v_amount. "x_lineitem-col12. "Amount in document currency
x_bapiaccr09_temp-currency = x_lineitem-col13. "Currency Key
APPEND x_bapiaccr09_temp TO it_bapiaccr09.
ENDLOOP.
CLEAR : v_itemno_1.
*-----Calling BAPI for creating Customer Invoice
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = x_invheader
IMPORTING
obj_key = v_obj_key
TABLES
accountgl = it_bapiacgl09
accountreceivable = it_bapiacar09
currencyamount = it_bapiaccr09
return = return.
But, I am getting the following error.
Error in document: BKPF $ QPTCLNT200
Incorrect entry in field OBJ_TYPE: BKPF
Could some body please help me out ?
And ,i want to know the significance of BKPF and BKPFF i.e. what they means?
Thanks in advance,
Srini

Hello Raja,
Yes, it is resolved.
You can try with OBJ_TYPE = 'IDOC'. For your reference following is program source code that is executing properly .
WA_RETURN LIKE BAPIRET2.
DATA:
WA_CURRENCY TYPE BAPIACCR09,
WA_CUSTOMER TYPE bapiacar09,
WA_RETURN2 TYPE BAPIRET2,
WA_RETURN3 TYPE BAPIRET2,
WA_ACCOUNTGL TYPE BAPIACGL09.
START-OF-SELECTION.
WA_DOCUMENTHEADER-OBJ_TYPE = 'IDOC'.
CONCATENATE SY-SYSID 'CLNT' SY-MANDT INTO WA_DOCUMENTHEADER-OBJ_SYS.
WA_DOCUMENTHEADER-OBJ_KEY = '$'.
WA_DOCUMENTHEADER-USERNAME = SY-UNAME.
WA_DOCUMENTHEADER-COMP_CODE = 'GOVP'.
WA_DOCUMENTHEADER-BUS_ACT = 'RFBU'.
WA_DOCUMENTHEADER-HEADER_TXT = 'BAPI TEST'.
WA_DOCUMENTHEADER-FISC_YEAR = '2007'.
WA_DOCUMENTHEADER-DOC_DATE = SY-DATUM.
WA_DOCUMENTHEADER-PSTNG_DATE = SY-DATUM.
WA_DOCUMENTHEADER-FIS_PERIOD = ' '.
WA_DOCUMENTHEADER-DOC_TYPE = 'DR'.
WA_DOCUMENTHEADER-ref_doc_no = '1234512345'.
*--One time customer data
Data : wa_onetimecust type BAPIACPA09.
wa_onetimecust-NAME = 'Mr'.
wa_onetimecust-NAME_2 = 'OneTimeCustomer'.
wa_onetimecust-CITY = 'Bangalore'.
wa_onetimecust-COUNTRY = 'India'.
*---end:One time customer data
WA_CUSTOMER-itemno_acc = '1'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = '100000'
IMPORTING
output = WA_CUSTOMER-CUSTOMER.
WA_CUSTOMER-comp_code = 'GOVP'.
APPEND WA_CUSTOMER TO it_bapiacar09.
CLEAR: WA_ACCOUNTGL.
WA_ACCOUNTGL-ITEMNO_ACC = 2.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = '6100.2600'
IMPORTING
output = WA_ACCOUNTGL-gl_account.
WA_ACCOUNTGL-COMP_CODE = 'GOVP'.
WA_ACCOUNTGL-ITEM_TEXT = 'TO CUSTOMER' .
WA_ACCOUNTGL-COSTCENTER  = 'DUMMY'.
APPEND WA_ACCOUNTGL TO IT_ACCOUNTGL.
CLEAR: WA_ACCOUNTGL.
CLEAR: WA_CURRENCY.
CLEAR: WA_CURRENCY.
WA_CURRENCY-ITEMNO_ACC = 1.
WA_CURRENCY-CURR_TYPE = '00'.
WA_CURRENCY-CURRENCY = 'USD'.
WA_CURRENCY-AMT_DOCCUR = 10.
APPEND WA_CURRENCY TO IT_CURRENCY.
CLEAR: WA_CURRENCY.
WA_CURRENCY-ITEMNO_ACC = 2.
WA_CURRENCY-CURR_TYPE = '00'.
WA_CURRENCY-CURRENCY = 'USD'.
WA_CURRENCY-AMT_DOCCUR = -10.
APPEND WA_CURRENCY TO IT_CURRENCY.
Post
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = WA_DOCUMENTHEADER
CUSTOMERCPD = wa_onetimecust
IMPORTING
OBJ_TYPE = OBJ_TYPE
OBJ_KEY = OBJ_KEY
OBJ_SYS = OBJ_SYS
TABLES
ACCOUNTGL = IT_ACCOUNTGL
accountreceivable = it_bapiacar09
CURRENCYAMOUNT = IT_CURRENCY
RETURN = IT_RETURN.
LOOP AT IT_RETURN INTO WA_RETURN.
WRITE : /1 WA_RETURN-MESSAGE.
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = WA_RETURN3.

Similar Messages

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

  • Error when using functions BAPI_ACC_DOCUMENT_POST

    Hello,
    When I used BAPI_ACC_DOCUMENT_POST function, the message: Document posted successfully appears, but really not documens are created, and the FI number range are modified.
    See the example code:
    *& Report  ZPBA_PC                                                     *
    REPORT  zpba_pc MESSAGE-ID m3.
    DATA: obj_type LIKE bapiache09-obj_type,
          obj_key LIKE  bapiache09-obj_key,
          obj_sys LIKE  bapiache09-obj_sys.
    DATA: it_hdr    LIKE bapiache09,
          it_gl     LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,
          it_curr   LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,
          t_result  LIKE bapiret2   OCCURS 0 WITH HEADER LINE.
    Header Data
    it_hdr-obj_type   = 'BKPFF'.
    it_hdr-obj_key    = '$'.
    it_hdr-obj_sys    = 'LA122D'.
    it_hdr-bus_act    = 'RFBU'.
    it_hdr-comp_code  = 'VEZS'.
    it_hdr-fisc_year  = '2004'.
    it_hdr-fis_period = '12'.
    it_hdr-doc_date   = '20041218'..
    it_hdr-pstng_date = '20041218'.
    it_hdr-doc_type   = 'ZI'.
    it_hdr-header_txt = 'TEXTO CAB'.
    it_hdr-username   = sy-uname.
    it_hdr-compo_acc  = 'GL'.
    it_hdr-ref_doc_no_long = 'REFERENCIA'.
    First Item
    Account number
    it_gl-itemno_acc = '1'.
    it_gl-gl_account = '0014401001'.
    it_gl-item_text  = 'PRUEBA TEXTO 1'.
    it_gl-profit_ctr = 'VE2020'.
    APPEND it_gl.
    Second Item
    Account number
    it_gl-itemno_acc = '2'.
    it_gl-gl_account = '0014401001'.
    it_gl-item_text  = 'PRUEBA TEXTO 2'.
    it_gl-profit_ctr = 'VE2020'.
    APPEND it_gl.
    Set amount
    it_curr-itemno_acc = '1'.
    it_curr-currency = 'VEB'.
    it_curr-amt_doccur = '10'.
    APPEND it_curr.
    it_curr-itemno_acc = '2'.
    it_curr-currency = 'VEB'.
    it_curr-amt_doccur = '-10'.
    APPEND it_curr.
    check posting
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
      EXPORTING
        documentheader = it_hdr
      TABLES
        accountgl      = it_gl
        currencyamount = it_curr
        return         = t_result.
    LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).
      EXIT.
    ENDLOOP.
    if sy-subrc ne 0.
    REFRESH t_result.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader = it_hdr
      IMPORTING
        obj_type       = obj_type
        obj_key        = obj_key
        obj_sys        = obj_sys
      TABLES
        accountgl      = it_gl
        currencyamount = it_curr
        return         = t_result.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    COMMIT WORK.
    WRITE: obj_key.
    endif.
    I appreciated your help to solve that error.
    Regards,
    Piero Cimule.
    <b></b>

    Hi,
    Please check the changes :
    *& Report ZPBA_PC *
    REPORT zpba_pc MESSAGE-ID m3.
    DATA: obj_type LIKE bapiache09-obj_type,
    obj_key LIKE bapiache09-obj_key,
    obj_sys LIKE bapiache09-obj_sys,
    <b>l_flag type c.</b>
    DATA: it_hdr LIKE bapiache09,
    it_gl LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,
    it_curr LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,
    t_result LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    Header Data
    it_hdr-obj_type = 'BKPFF'.
    it_hdr-obj_key = '$'.
    it_hdr-obj_sys = 'LA122D'.
    it_hdr-bus_act = 'RFBU'.
    it_hdr-comp_code = 'VEZS'.
    it_hdr-fisc_year = '2004'.
    it_hdr-fis_period = '12'.
    it_hdr-doc_date = '20041218'..
    it_hdr-pstng_date = '20041218'.
    it_hdr-doc_type = 'ZI'.
    it_hdr-header_txt = 'TEXTO CAB'.
    it_hdr-username = sy-uname.
    it_hdr-compo_acc = 'GL'.
    it_hdr-ref_doc_no_long = 'REFERENCIA'.
    First Item
    Account number
    it_gl-itemno_acc = '1'.
    it_gl-gl_account = '0014401001'.
    it_gl-item_text = 'PRUEBA TEXTO 1'.
    it_gl-profit_ctr = 'VE2020'.
    APPEND it_gl.
    Second Item
    Account number
    it_gl-itemno_acc = '2'.
    it_gl-gl_account = '0014401001'.
    it_gl-item_text = 'PRUEBA TEXTO 2'.
    it_gl-profit_ctr = 'VE2020'.
    APPEND it_gl.
    Set amount
    it_curr-itemno_acc = '1'.
    it_curr-currency = 'VEB'.
    it_curr-amt_doccur = '10'.
    APPEND it_curr.
    it_curr-itemno_acc = '2'.
    it_curr-currency = 'VEB'.
    it_curr-amt_doccur = '-10'.
    APPEND it_curr.
    check posting
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
    EXPORTING
    documentheader = it_hdr
    TABLES
    accountgl = it_gl
    currencyamount = it_curr
    return = t_result.
    LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).
    <b>l_flag = 'X'.</b>
    EXIT.
    ENDLOOP.
    <b>if l_flag is initial.</b>
    REFRESH t_result.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
    documentheader = it_hdr
    IMPORTING
    obj_type = obj_type
    obj_key = obj_key
    obj_sys = obj_sys
    TABLES
    accountgl = it_gl
    currencyamount = it_curr
    return = t_result.
    <b>Clear l_flag.
    LOOP AT t_result WHERE ( type = 'E' OR type = 'A' ).
    l_flag = 'X'.
    EXIT.
    ENDLOOP.</b><b>if l_flag is initial.</b>
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    <b>COMMIT WORK AND WAIT.</b>
    <b>endif.</b>
    WRITE: obj_key.
    endif.
    Best regards,
    Prashant

  • 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

  • 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

  • BAPI_ACC_DOCUMENT_POST line item text SGTXT not updating

    Hi,
    We have copied following LSMW for opening balance upload from ECC 5  to ECC 6.
    When we upload through LSMW (BAPI_ACC_DOCUMENT_POST ) which is used for uploading opening balances of G/L accounts field Long Text (Tech Name: ITEM_TEXT) not updating.
    Form Vendor and Customer Opening balances LSMWs  Long Text (Tech Name: ITEM_TEXT) field of G/L line item is not updating. According to my observation data field  SGTXT of BSEG table. not getting updated through this LSMW. I have tried same transaction through  T Code F-02 and it is updating field SGTXT of BSEG  table. As per confirmation from business same LSMWs  are working fine in ECC 5.
    Jigar

    hi experts,
    no body faced this situation?
    Any suggestions ?
    kindly give me any inputs
    thanks & regards,
    Raghul
    Edited by: Raghul Gandhi on Aug 11, 2009 11:32 AM
    Edited by: Raghul Gandhi on Aug 11, 2009 12:56 PM

  • Down payment & BAPI_ACC_DOCUMENT_POST

    May be someone knows the decision of the problem:
    At dialogue creation down payment (F-48), the system creates communications between the purchasing order and the accounting document.
    I.e. in history of a position of the purchasing order there is a record with number accounting the document.
    And in the accounting document down payment there is a reference to number of the purchasing order in a browser of relations (look FB03 it is cluck in the menu: Environment-> Document Environment-> relationship Browser).
    I use ' BAPI_ACC_DOCUMENT_POST ' for creation down payment:
    As a result I receive the normal document of down payment, but links on the purchasing order it was not created, i.e. there is no record with number of the accounting document in history of a position of the purchasing order, and there is no reference to the purchasing order in a browser of relations of the accounting document.
    Is it possible to create the high-grade document down payment with all references what is at dialogue work of transaction F-48? What I for this purpose should make?
    Edited by: Soloviev Ivan on Apr 1, 2008 1:46 AM

    Hi,
    Just wait for a moment(10 to 15  mins) since you have given WAIT in BAPI_TRANSACTION_COMMIT.
    Check again, and hope it updates the values.
    or else, Just give BAPI_TRANSACTION_COMMIT after the BAPI with no parameters.
    Regards,
    Anbalagan

  • Error getting while using BAPI "BAPI_ACC_DOCUMENT_POST" in the Web Dynpro

    Hello Everyone,
    I am trying to use BAPI_ACC_DOCUMENT_POST to post a docuemnt, for this I have created a web application and in that I have created one view. In the layout of the view I have developed three groups 1. document header 2.Currency 3. GL account. for user inputs and at the root node i have created a button and on the action f the button I am calling the BAPI but when i tested it I am getting the following error:
    The following error text was processed in the system RS2 : Adapter error in INPUT_FIELD "GROUP_2_ITEMNO_ACC" of view "ZTEST_RAGI_INVOICE_POST.MAIN": Context binding of property VALUE cannot be resolved: Node MAIN.1.CURRENCYAMOUNT does not contain any elements .
    Can you please help me in this.
    Thanks,
    Rajat

    helll rajat ,
    The following error text was processed in the system RS2 : Adapter error in INPUT_FIELD "GROUP_2_ITEMNO_ACC" of view "ZTEST_RAGI_INVOICE_POST.MAIN": Context binding of property VALUE cannot be resolved: Node MAIN.1.CURRENCYAMOUNT does not contain any elements .
    ---> pass amount to that currency table.
    regards
    Prabhu

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

  • Problem in Posting a document using BAPI_ACC_DOCUMENT_POST

    Hi,,
    I am using the function module "BAPI_ACC_DOCUMENT_POST" to post a vendor Invoice (KR). i think the t-code to post this is FV60.when i post the document, the document number is getting generated but amount is missing  in t-code fbv3 but bseg table is getting updated properly. Can any one help the actual input to be given to create a document and tax
    Regards

    I have a suggestion:
    Try to post this kind of document (KR) with transaction code FB01. If you can see the document correctly with FBV3 transaction, then you can use BAPI you mention.
    The following function modules may be useful for calculating taxes:
    CALCULATE_TAX_FROM_NET_AMOUNT
    CALCULATE_TAX_FROM_GROSSAMOUNT
    Regards.
    Rafael Rojas.

  • Getting error while posting doc using BAPI BAPI_ACC_DOCUMENT_POST

    Hi,
    I am passing the value for posting key in BAPI through TAX_CODE field in ACCOUNTGL (parameter name under tables).
    It is giving error "Tax code 01 in procedure TAXR0 is invalid".
    Can anyone help me to solve this .

    Try in these :
    BAPI_ACC_DOCUMENT_POST error
    Error in using BAPI_ACC_DOCUMENT_POST (urgent!!)
    BAPI_ACC_DOCUMENT_POST - Check error
    Regards
    Neha

  • 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

  • Problem in Coding Block during the Acc Doc posting BAPI_ACC_DOCUMENT_POST

    Hi,
    I have a problem in the Coding Block of a FI invoice Document posting. In our project, we have implemented substitutions to derive SBL;SEGMENT field in the line item of a GL Account.
    I have created a program and in that i'm using BAPI_ACC_DOCUMENT_POST for posting the Accounting Document. During this BAPI call, it is not deriving the values of SBL and SEGMENT.
    But, when i'm posting through transaction FB01; the substitutions are getting triggered and finally values are being derived.
    Can anyone help on this as to why these values were not derived when it is being called through BAPI_ACC_DOCUMENT_POST. For COBL; is it really possible to post through this BAPI or something more has to be done.
    Very urjunt !!! Please
    Awaiting your valuable answers.
    Thanks
    Rohith

    Hi Rohith,
    to populate correctly the profit. Segment you should fill in the information used in derivation inside the BAPI CRITERIA table structure.
    In the below example the profit. Segment is derived from Sales Org. (VKORG) and Distribution Channel (VTWEG).
      Fill CRITERIA for CO-PA (Profitability Segment)
        REFRESH lt_criteria.
        wa_criteria-itemno_acc = lv_itemno_acc.
        wa_criteria-fieldname  = 'VKORG'.
        wa_criteria-character  = '1080'.
        APPEND wa_criteria TO lt_criteria.
        wa_criteria-itemno_acc = lv_itemno_acc.
        wa_criteria-fieldname  = 'VTWEG'.
        wa_criteria-character  = '01'.
        APPEND wa_criteria TO lt_criteria.
    If you need further information, please post your doubts here.
    Regards,
    Antonio
    Edited by: indetony on Sep 9, 2011 12:46 AM

  • Mandatory fields for  BAPI_ACC_DOCUMENT_POST

    Hi
    I am getting the follwing data from the file (Which is coming from oracle) invoice number and the amount,
    from that i have to use Fb70 tcode for posting ,Please help me what are the mandatory fields for FB70,
    how will get those fields from SAP. How to use the BAPI ?
    Regards
    Pabs

    hi
    check out this thread
    Re: BAPI_ACC_DOCUMENT_POST
    hope this helps
    regards
    Aakash Banga

  • Can any one pls tell me the mandatory fields for BAPI_ACC_DOCUMENT_POST

    hi all ,
    Can any one pls tell me the mandatory fields for BAPI_ACC_DOCUMENT_POST
    what all data i need to give to post a document.
    Thanks and Regards
    JK

    Hi...
    part of my source code:
    ** Header Data " Sending comp code
    wa_documentheader-comp_code = 'XXXXX'.
    wa_documentheader-doc_date = '20060620'.
    wa_documentheader-pstng_date = '20060620'.
    wa_documentheader-doc_type = 'XX'.
    wa_documentheader-username = sy-uname.
    wa_documentheader-ref_doc_no = 'XXxxxxxx'.
    wa_documentheader-header_txt = 'Text Header.
    wa_documentheader-bus_act = 'XXXX'.
    *it_currencyamount
    wa_currencyamount-itemno_acc = '1'.
    wa_currencyamount-currency = 'COP'.
    wa_currencyamount-amt_doccur  = 1943.
    APPEND wa_currencyamount TO it_currencyamount.
    *it_accountpayable
    wa_accountpayable-itemno_acc = '1'.
    wa_accountpayable-gl_account = '1234567890'.
    wa_accountpayable-bus_area = 'DIV'.
    wa_accountpayable-item_text = 'Text 1 XXxxxxx '.
    wa_accountpayable-pmnt_block = ''.
    APPEND wa_accountpayable TO it_accountpayable.
    *it_accountgl
    wa_accountgl-itemno_acc = '2'.
    wa_accountgl-gl_account = '1234567890'.
    wa_accountgl-item_text = 'Text 2 XXxxxxx'.
    wa_accountgl-bus_area = 'DIV'.
    APPEND wa_accountgl TO it_accountgl.
    wa_currencyamount-itemno_acc = '2'.
    wa_currencyamount-currency = 'COP'.
    wa_currencyamount-amt_doccur  = ( 1943 ) * -1.
    APPEND wa_currencyamount TO it_currencyamount.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
      EXPORTING
        documentheader = wa_documentheader
      TABLES
        accountgl      = it_accountgl
        accountpayable = it_accountpayable
        currencyamount = it_currencyamount
        return         = it_return.
    clear it_return.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
          EXPORTING
            documentheader = wa_documentheader
          TABLES
            return         = it_return
            currencyamount = it_currencyamount "currencyamount
            accountpayable = it_accountpayable "accountpayable
            accountgl      = it_accountgl "accountgl
          EXCEPTIONS
            OTHERS         = 01.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Maybe you are looking for

  • How to integrate an Edge animation in a website by hand

    I created an Edge animation and published it as an .oam file.  But i need to work on the website on someone elses computer who does not have creative cloud or even Dreamweaver.   I am working there in a text editor.  What are the requirements - what

  • Skype to go number in mexico

    I just set up my skype to go number for my cell phone in Mexico.  I try the number that they gave me and it ends up being a wrong number.  What can I do, can somebody help me with this problem?

  • Runtime calculations in PDF forms

    Good day! My task is to make a PDF form of the quantity of the material on the factory with some runtime calculations. Just like these: MATNR | MAKTX | LGORT | LABST | MEINS 100 | Material_1 | 0001 | 100 | KG 100 | Material_1 | 0002 | 300 | KG       

  • MDBT authorisation by plant

    Hi all I am trying to give authorisation for MDBT by plant. I used the object M_MTDI_ORG but it doesn't seem to work. User given authorisation only for a particular plant can run all plants. any suggestions?? Thanks in advance JOE

  • ORA-04031 while creating index

    Hi, I am creating a schema using IMP utility. The import log is showing error (during index creation) ORA-04031: unable to allocate 2064 bytes of shared memory ("shared pool","unknown object","sga heap","multiblock rea") This is a Oracle 8 (8.1.7.4.0