How to Use 'BAPI_ACC_DOCUMENT_POST' in an Inbound IDOC?

Hi,
One of the standard IDOC for posting accounts is Message type(ACC_DOCUMENT), and an FM IDOC_INPUT_ACC_DOCUMENT "NOT released'  uses same
functionality to achieve.
I created a custom one as standard one is not released yet, My question is how to handle records if number of records in flat file coming from legacy contains more data.
Example. If number of records exceeds 999.
Thanks and Regards
Mohinder

Hi,
BAPI_ACC_DOCUMENT_POST can post 999 line items only.
More than 999 records:
If the count is 999 don't take the flat file values, take a dummy GL account and assign it as 999 record.
the amount should be balance amount of 998 records, it may credit or debit.
Regards,
Sri

Similar Messages

  • How to change field values AFTER Inbound IDOC Posted successfully

    Hi SAP Experts,
    In my project I receive the inbound IDOC PORDCR05 from PI and posted as an Purchase Order in ECC.
    I create the Z process code and Z function module (which is a copy version of IDOC_INPUT_PORDCR) and complete all the necessary configuration steps. It works perfectly.
    My problem is: I have to  collect some inbound idocs (that satisfied some criteria) and change the value of field EKPO-TXJCD and EKKN-KOSTL of the PO AFTER  it posted successfully (means the purchase order is created and save in database).
    How can I do this? I've try to put the logic code in Z function module, but it does not work, since at that time, the Inbound IDOC is not updated to the database yet.
    Aprreciate your advise.
    Regards,
    Elaine.

    Hi Elaine ,
    as per your cretiria pick the idocs and take created PO# from status 53 & use the BAPI (BAPI_PO_CHANGE) to change the neccessary values in the PO. We can't reprocess those idocs again.
    Reddy

  • Help on how to use BAPI_ACC_DOCUMENT_POST...

    Hello experts,
    Please help me on how to use the BAPI BAPI_ACC_DOCUMENT_POST. I dont have the time to
    record via SHDB and do BDC and I would like to try out the said BAPI. I think this will be faster
    I need to fill in the header, line items, etc. Any detailed examples will be highly appreciated.
    Thanks a lot guys and take care!

    Take a look at the following code :
    * IF GL ACCOUNT
    *       Accountgl / Compte générale
            ws_accountgl-itemno_acc   = w_compt.
            ws_accountgl-comp_code    = p_bukrs.
            ws_accountgl-pstng_date   = ws_reformat-datecpt.
            ws_accountgl-fisc_year    = ws_reformat-datecpt(4).
            ws_accountgl-fis_period   = ws_reformat-datecpt+4(2).
            ws_accountgl-doc_type     = p_blart.
            ws_accountgl-item_text    = ws_reformat-libel.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                input  = ws_reformat-cptclf
              IMPORTING
                output = ws_accountgl-gl_account.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                input  = ws_reformat-kostl
              IMPORTING
                output = ws_accountgl-costcenter.
          ELSE. " ACC. PAYABLE
    *       Account Payable /  Compte fournisseur
            ws_accountpayable-itemno_acc   = w_compt.
            ws_accountpayable-comp_code    = p_bukrs.
            ws_accountpayable-item_text    = ws_reformat-libel.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                input  = ws_reformat-cptclf
              IMPORTING
                output = ws_accountpayable-vendor_no.
            APPEND ws_accountpayable TO accountpayable.
          ENDIF.
    *     Currencyamount Struct.
          ws_currencyamount-itemno_acc = w_compt.
          ws_currencyamount-currency = 'EUR'.
    *     ws_currencyamount-curr_type = '00'.
          IF ws_reformat-sign EQ 'C'.
            ws_reformat-wrbtr_c = ws_reformat-wrbtr_c * ( - 1 ).
          ENDIF.
          ws_currencyamount-amt_doccur = ws_reformat-wrbtr_c.
          APPEND ws_currencyamount TO currencyamount.
    * BAPI
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
          EXPORTING
            documentheader = documentheader
          TABLES
            accountgl      = accountgl
            accountpayable = accountpayable
            currencyamount = currencyamount
            return         = t_return.
        IF sy-subrc <> 0.
          MESSAGE e999(re) WITH 'Problem occured'.
        ELSE.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        ENDIF.

  • How To use External Message To Send IDOC From XI To R/3

    we need to split one source message to several IDOC To
    R/3,But Standard Imported r/3 idoc contains only one idoc per message,so we export the standart idoc to a
    xsd file and change it to a  multi "IDOC" segment structure and import back to xi again,after that,we create a message interface use the imported
    message type and use it to send IDOC to r/3 via idoc adapter,but at the "call atapter" step it gernarate a
    error:"Unable to interpret IDoc interface MI_IDOC_IN".
    what we should pay attention to when use external message
    to send idoc to r/3?
    (when use the imported idoc message to send  single idoc per message,it is no probelm)
    thx

    The way this works is:
    1. In your Message Mapping use the External WSDL defintion that you loaded after tweaking the "IDOC" Occurance.
    2. Then in your INTERFACE MAPPING use the orginal IDOC Name that you imported from R/3.
    3. Use the original IDOC Name in Integration Builder too.
    This should work.
    Thanks
    Ashish

  • How to use Database adapter as inbound adapter without having polling strategies?

    Hi All,
    I have a requirement wherein I have to use Database adapter to retrieve the data for every half an hour from one(X app) database and update that data into another application(Y app) .That database adapter will be along with BPEL process.My Flow would be like this:
    Database Adapter( In 'exposed services' section) ----->   BPEL (in 'Components') -----> Y app service( in 'External References' section)
    My questions for each step are below
         1) I have to retrieve the data from database(x app database) for every half an hour.So I have to schedule my whole process such that it should execute for every half an hour.
    Means I have to get  whatever the data is updated in the last half an hour in that database.
          The database adapter should be inbound in SOA composite editor(in 'Exposed services' section).
    But in order to have inbound adapter,we have select the 'Poll for New or Changed Records in a Table' option in turn we have to select one of polling operations below:
             Delete the Row(s) that were Read
    Update a Field in the [Table_Name] Table (Logical Delete)
    Update a Sequencing Table
    Update an External Sequencing Table on a Different Database
    Control Table Strategy
    But the problem is I don't have any control on the database(X app database) ,So (I can't update any data on that table,because that table may not have a field or table to update the processed rows)I can't choose any of the above operations.
    How can I achieve what I want that is to retrieve the data and schedule the process?
    Thanks in advance.

    Hi Heckler,
      Thank you very much for your answer that I can proceed further somehow.
    I still need to have some clarifications.
    In order to have a process which retrieves the data (Inbound operation) and updates the data into other application, the data(from X app)  should be the request(through DB adapter) of the BPEL process.
    X app does not do anything to send.We have(the BPEL process) to receive the data (or) no event is triggered.
    The flow :
    Database Adapter( In 'exposed services' section to retrieve data) ----->   BPEL (in 'Components') -----> Y app service( in 'External References' section)
    How can we ensure the data will be  request to BPEL process(means it will be in 'exposed services' section in SOA composite editor) for every half an hour if we use pick activity and database adapter as first activity?
    When we use ''Poll for New or Changed Records in a Table' ,then only adapter becomes inbound and comes into the 'exposed services' section.I can't use it as I don't have any control on the source table.
    I have this confusion before starting the process.Please help me to clear out the doubts.
    And this whole process should be executed automaticallly for every half an hour(means it creates instance for every half an hour)  Once we build the BPEL process.
    How to schedule it?
    And where do I need to create control table ?You mean I have to use some different database where in I have to create the table?

  • How to use output type in Outbound IDOC

    Hi All,
    I have a requirement where I have to trigger the outbound idoc by using output type 'ZCON'.How to program this or any idea how do i acheive this......................
    Please help.
    Thanks in Advance
    Shanaya

    Shanaya,
    You will have to take help of functional guys so that they can configure mentioned output type in NACE.
    Apart from that you might have to do some coding as well with condition like
    IF nast-kschl EQ 'ZCON' AND nast-nacha EQ '6'.
    Please check NAST table for more details and let us know if you still need some help.
    Cheers
    VJ

  • How to use BAPI_ACC_DOCUMENT_POST

    Hello ALL.
    I need to update the field AUFNR in database table BSEG, I'm using the BAPI BAPI_ACC_DOCUMENT_POST, the function module execute with out errors, but do not change the field AUFNR.
    Could any one help me?
    Thanks in advance

    Hello Lalit, thanks for your answer.
    We take care about the order number while creating new accounting documents, But the users are creating these documents automatically through transaction code FAGL_FC_VAL (Foreign Currency Valuation).
    This transaction code creates a new accounting document based on another accounting document already created, what I need is, replicate the order number from original accounting document into the new one.
    Best regards.

  • How to use BAPI_ACC_DOCUMENT_POST for CO-PA Account Assignment

    hi all,
    when i used bapi to posting docment,but for document_type ='DR'(customer invoice), it is related with Profit. Segment.
    it returned following message in return table:
    E RW                   609 Error in document: ZBKPF ZY2005 DEVCLNT230
    E F5                   808 Field Prof.Segmt is a required field for G/L account CN10 50600824
    W KI                   166 Enter a true account assignment object with revenues
    maybe due to i haven't fill parameter:CRITERIA and VALUEFIELD
    but i have no idea about this.
    would you please give some idea, sample code is great .
    thanks.
    helen

    Hi, Qunli
    If you haven't the documentation of the BAPI, you can search in here http://ifr.sap.com/catalog/query.asp
    You can find the BAPI in SAP FI(470 or above). Under the 'Accounting Interface' hierarchy, you can find a 'AcctngBilling' BO, and the Post method of it is the BAPI you're calling. (you can search to demonstrate in Tcode BAPI). There is some explain for the interface, if it is not enough, I have some sample application which call this BAPI.
    Hope it will be helpful.
    Thanks a lot

  • How to use this two bapi:BAPI_ACC_DOCUMENT_POST and   BAPI_ACC_GL_POSTING_POST

    As far as I know this two bapi used to create accounting document. But how do we use them ? and what's the different between them?
    The most important thing is in what condition we use which bapi to post accounting doc?
    Such as there is one requirement to post accounting doc though t-code F-02 in BDC, but how do I know whether I can use this two bapi to replace the BDC?
    BAPI_ACC_DOCUMENT_POST
    BAPI_ACC_GL_POSTING_POST

    Hello,
    how we use BAPI_ACC_DOCUMENT_POST:
       gs_documentheader-ref_doc_no = .... your document number (from number range)
       gs_documentheader-bus_act = 'RFBU'.
       gs_documentheader-username = sy-uname.
       gs_documentheader-header_txt = .... your header text
       gs_documentheader-comp_code = '0001'.
       gs_documentheader-doc_date = ..... date
       gs_documentheader-pstng_date = .... date
       gs_documentheader-fisc_year =.... year
       gs_documentheader-fis_period = .... period
       gs_documentheader-doc_type = 'BS'.
       loop at ... items ... assigning <belpos_line>.
         gs_accountgl-itemno_acc = <belpos_line>-posnr. "10 digits !
         gs_accountgl-bus_area = ... your business area
         gs_accountgl-tax_code = <belpos_line>-tax_code.
         gs_accountgl-gl_account = <belpos_line>-gl_account.
         gs_accountgl-comp_code = ... your company code.
         gs_accountgl-alloc_nmbr = ... some identity number
         gs_accountgl-item_text = .... item text
         gs_accountgl-costcenter = <belpos_line>-kostl.
         gs_accountgl-plant = .... werks
         append gs_accountgl to gt_accountgl.
         gs_currencyamount-itemno_acc = <belpos_line>-posnr.
         gs_currencyamount-currency = ... waers
         gs_currencyamount-amt_doccur = .... waers
         append gs_currencyamount to gt_currencyamount.
       endloop.
       call function 'BAPI_ACC_DOCUMENT_POST'
         exporting
           documentheader = gs_documentheader
         importing
           obj_type       = gd_obj_type
           obj_key        = gd_obj_key
           obj_sys        = gd_obj_sys
         tables
           accountgl      = gt_accountgl
           currencyamount = gt_currencyamount
           return         = gt_return.
    Regards

  • Create shipment from inbound IDOC SHPMNT05 ?

    Hello All,
    I would like to create an individual shipment when i receive from a partner an inbound IDOC.
    I'm using Message type SHPMNT, Basic Type SHPMNT05, Process Code: SHPM and testing in WE19 via FM IDOC_INPUT_SHPMNT.
    How can I start the creation of the shipment with this inbound IDOC ?
    Is it possible ? or is it necessary  to develop in user-exit the code to create shipment with function module (which one ? BAPI_CREATE_SHIPMENT ?)? 
    Thanks a lot,
    My

    Hello Reddy
    thanks for your answer.
    is there particular customizing to be done ?
    i exactly use function BORES_IDOC_INPUT_SHPMNT
    The inbound idoc is generated but i have the following status message 51 "Application document not posted"
    What does it mean ? a problem of data in the inbound IDOC to create the shipment ?
    Thanks a lot
    MY

  • Inbound idoc processing by workflow

    Hello,
    How can I find if an inbound IDoc has been processed via workflow ?
    following are details -
    1)status records 50 and 64 for the idoc show RFC user ID whereas 62 and 53 show WORKFLOW_020 user ID.
    2)manual re process in test system using WE19 has all four status records by login user ID.
    3)BD67 values for this process code was checked for the start events.
    4)I checked standard task 30200090 following oss note 325361
    5)The invoice document posted via this idoc has created by user ID as WORKFLOW_020 
    I do not have full knowledge of inbound idoc processing via workflow and I am in the process of learning the same. Kindly help.
    thank you very much in advance,
    Bhakti

    Hello,
    How can I find if an inbound IDoc has been processed via workflow ?
    following are details -
    1)status records 50 and 64 for the idoc show RFC user ID whereas 62 and 53 show WORKFLOW_020 user ID.
    2)manual re process in test system using WE19 has all four status records by login user ID.
    3)BD67 values for this process code was checked for the start events.
    4)I checked standard task 30200090 following oss note 325361
    5)The invoice document posted via this idoc has created by user ID as WORKFLOW_020 
    I do not have full knowledge of inbound idoc processing via workflow and I am in the process of learning the same. Kindly help.
    thank you very much in advance,
    Bhakti

  • How to Identify EDI errors in inbound IDocu0092s?

    hi,
    I just want to know how to identify EDI errors in inbound IDoc’s?

    Hi
    Ref this links
    http://www.hibcc.org/EBUS/editemplates.htm
    /people/bla.suranyi/blog/2006/06/08/sap-xi-supports-edifact
    /people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield
    /people/paul.medaille/blog/2005/11/17/more-on-the-sap-conversion-agent-by-itemfield
    /people/sravya.talanki2/blog/2005/12/02/manipulating-idoc-control-records-from-payload
    /people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified
    /people/ravikumar.allampallam/blog/2005/02/28/creating-sales-order-through-idoc
    With Seeburger we can conver to edi format to XML
    seeburger doc
    http://www.stylusstudio.com/edi/XML_to_X12.html
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b0b355ae-0501-0010-3b83-8f2bb566fa47
    Details on XI EDI adapter from seeburger
    Doc for Conversions-
    http://www.seeburger.it/fileadmin/it/pdf/2005_04_sapphire_Ferrero_transcript.pdf
    http://www.seeburger.com/fileadmin/com/pdf/Butler_Group_SEEBURGER_Technology_Audit.pdf
    http://www.seeburger.com/fileadmin/com/pdf/AS2_General_Overview.pdf
    SAP Adapters
    EDI with XI
    http://www.seeburger.com
    http://www.seeburger.com/fileadmin/com/pdf/AS2_General_Overview.pdf
    http://www.seeburger.it/fileadmin/it/pdf/2005_04_sapphire_Ferrero_transcript.pdf
    http://www.seeburger.com/fileadmin/com/pdf/SEEBURGER_SAP_Adapter_engl.pdf
    http://www.seeburger.com/fileadmin/com/pdf/Butler_Group_SEEBURGER_Technology_Audit.pdf
    http://www.sap.com/france/company/events/2006/02-01-Automotive-Seeburger.pdf
    http://h41123.www4.hp.com/presentations/ISUG/XISeeBurger.ppt
    http://www.sap.com/asia/company/events/nwtechdays/presentation/australia-slides/Pre-Built_Integration.pdf
    Thanx
    Bommireddy.Sridhar

  • Prevent the Output Message when creating PO from inbound IDOC

    Hi SAP Gurus,
    In my project, I have to create PO from inbound IDOC (PORDCR) with a specific Document Type ('099').
    Requirement: These PO should not generate the output message while the others (Doc Type # '099') do.
    I have the Z fuction module which call BAPI_PO_CREATE for posting IDOC and it works fine.
    In the existing system, there are some set up that trigger the output message type for PO (output NEU) when using ME21 or ME22, as a result my PO created with output message.
    Can you please advise if there are some way (User Exit?) that prevent the output message in this scenario (specific PO Type) without touching the current Condition setup?
    I'm new in MM and really need help!
    Thanks,
    Elaine.

    Hi Vinod,
    I really appreciate your anwer. I'm going to explore this with my functional consultant.
    Just like to have more questions:
    1. Is it easier if we change the existing condition table instead of creating a new routine?
    2. There are two forms for routine 101 (FORM KOBEV_101 and FORM KOBED_101). Can you explain to me why we need 2 here for what purpose of each form.
    3. In the debug mode by using WE19 to post inbound IDOC, I change the SY-SUBRC = 4 and PO created without output message. Is it the right direction? Anything else I need to pay attention to?
    Thanks again.
    Regards,
    Elaine.

  • Creating Inbound IDoc - IDOC_INBOUND_SINGLE Help needed

    Hi all,
    I am using IDOC_INBOUND_SINGLE to create inbound IDoc. Its creating the IDoc and processing successfully.
    But this FM only returns IDoc number and not the processing errors if there are any. Any way to get processing errors also?
    Your help would be highly appreciated.
    Thanks,
    Sagar

    Hi
    I am not sure
    Pls check this function module 'IDOC_READ_COMPLETELY'
    Regards
    Madhan

  • Howto Scenario: Inbound IDOC - 2 rows into JDBC adapter ?

    Hi,
    How can I achieve the following:
    Inbound IDOC into XI, has to be transformed, and 2 rows have to be inserted into a database table.
    I am able to insert 1 row through the XMB2DB_XML mode in JDBC adapter. 
    A solution could be to create an identical XML structure ("access" elements) through mapping, but I am unable to get 2 XML structures from 1 inbound IDOC document.
    Any ideas are most welcome.
    thanks,
    Manish

    Hi Manish,
    On the target side, right-click on the "access" element and select "Duplicate Subtree".  Now, you should have 2 "access" structures to map from the IDoc.
    Regards,
    Bill

Maybe you are looking for