BAPI_ACC_DOCUMENT_POST in case of  multiple line items

Hi All,
          I'm working on program for uploading of Journal postings ( G/L postings) from excel . I am using
BAPI_ACC_DOCUMENT_POST for this purpose.
There is a possibility that the excel data may contain one Dr./Cr line item with multiple DR/Cr line items. System
can recognise one line item with multiple line item by means of unique header reference field (XBLNR) . The excel
data contains following fields :
BLDAT     
BLART     
BUKRS     
BUDAT     
WAERS     
KURSF     
XBLNR     
BKTXT     
BSCHL1     
HKONT     
WRBTR     
KOSTL     
AUFNR     
PRCTR     
FKBER     
SGTXT          
BSCHL2     
HKONT1     
WRBTR     
KOSTL     
AUFNR     
PRCTR     
FKBER     
SGTXT
How can i populate the accountgl , accountrecievable ,ammountcurr tables in BAPi mentioned?
<LOCKED BY MODERATOR - DUPLICATED THREAD>
Re: BAPI_ACC_DOCUMENT_POST
Edited by: Alvaro Tejada Galindo on Jan 13, 2010 4:29 PM

This is a duplicate post. Please see my answer in the other one.
Rob

Similar Messages

  • Select query in case of Multiple line items

    Hi Gurus ,
                  I've a doubt in general SQL select query. I want to know , if suppose I've an internal table - itab . I've fetched G/L Account numbers 1st, based on the input selections . Next , I want to loop on those G/L accounts. However, if the G/L account has multiple line items, then I personally use this select query -- >
    loop at itab.
    select <field> from <table> appending corresponding fields of  <itab1> where hkont eq itab-hkont.
    endloop.
    Now, the execution time for this query is longer than expected. The biggest problem here is, i've to sum up the totals as well. So totaling is an added load. I want to reduce the execution time of this. Kindly suggest me some good method in case u have any.
    I've pasted the code which I've written , for u ppl to understand--
    SELECT DISTINCT HKONT BELNR
      FROM BSIS
       INTO CORRESPONDING FIELDS OF TABLE OTAB
        WHERE HKONT IN S_RACCT
    *      AND PRCTR IN P_PRCTR
          AND MONAT IN S_POPER
          AND BUKRS EQ P_BUKRS
          AND GJAHR EQ P_GJAHR
          AND PRCTR IN S_PRCTR.
    ***The code below takes a lot of time to execute.***
    LOOP AT OTAB .
      SELECT DMBTR HKONT
      FROM BSIS APPENDING CORRESPONDING FIELDS OF TABLE CREDITS
        WHERE HKONT EQ OTAB-HKONT
          AND BELNR EQ OTAB-BELNR
          AND MONAT IN S_POPER
          AND BUKRS EQ P_BUKRS
          AND GJAHR EQ P_GJAHR
          AND PRCTR IN S_PRCTR
          AND SHKZG EQ 'H'.
      COLLECT CREDITS.
    ENDLOOP.

    Hi,
    First of all try to avoid doing select into corresponding fields. THis would improve the performance of the program.
    Try to do a single fetch from the BSIS table . fetch the hkont, belnr, dmbtr fields in to a master internal table. Manipulate and play with the data as required.  Don't hit the data base table more than once (unless it is required) . This would improve the performance of your code.
    Try to code this way.
    types: begin of ty_bsis,
                 hkont type hkont,
                 belnr type  belnr_d,
                 dmbtr type dmbtr,
              end of ty_bsis.
    data: it_bsis type standard table of ty_bsis,
             wa_bsis type ty_bsis,
    select hkont belnr dmbtr
              from bsis
              into table it_bsis
              WHERE HKONT IN S_RACCT
            AND PRCTR IN P_PRCTR
              AND MONAT IN S_POPER
             AND BUKRS EQ P_BUKRS
             AND GJAHR EQ P_GJAHR
              AND PRCTR IN S_PRCTR.
    Using the data availabe in the it_bsis, you can manipulate as required.
    Hope this would be helpful
    Regards
    Ramesh Sundaram

  • Copying the item text in case of multiple line items

    Hi All,
                    I have a scenario where the sales order gets created in our SAP through a 850 idoc. The incoming idoc has only one item segment which carries the total order quantity ( for example say 1000). Since my company has contractual agreements with the end customer for doing multiple shipments , our sales department splits the total quantity into multiple line items in the sales order. Say splitting the 1000 quantities into 5 line items of 200 each.
    The problem here is that when the sales order got created , all  the related item text were copied only to the first line item ( of 1000 qty) and which is standard SAP. Since the order quantity was manually split, the related item text are not carried to the subsequent line items. The issue comes when an outbound (810) idoc is sent to customer . As I told earlier since only the first line item has the item text , the 810 idoc which was created for  the first line item only has the item text . The rest of the 810 which were subsequently created for multiple shipments/invoices on different dates didn't have the item text in the 810's. This is becoming a major problem as the 810 files are failing at our trading partners end because of missing text.
    Now my question is, Is there a way that I can make the item text copy automatically when multiple line items are created manually by business. Like is there a way where I can modify MV45AFZZ  to copy the item text in their respective segemnts ( z003,z004 etc) to "N" number of line items.
    Also please suggest if there is a better way of doing it. Suggstions are most welcome !!!.
    Regards
    Amrith

    Hi,
    First of all try to avoid doing select into corresponding fields. THis would improve the performance of the program.
    Try to do a single fetch from the BSIS table . fetch the hkont, belnr, dmbtr fields in to a master internal table. Manipulate and play with the data as required.  Don't hit the data base table more than once (unless it is required) . This would improve the performance of your code.
    Try to code this way.
    types: begin of ty_bsis,
                 hkont type hkont,
                 belnr type  belnr_d,
                 dmbtr type dmbtr,
              end of ty_bsis.
    data: it_bsis type standard table of ty_bsis,
             wa_bsis type ty_bsis,
    select hkont belnr dmbtr
              from bsis
              into table it_bsis
              WHERE HKONT IN S_RACCT
            AND PRCTR IN P_PRCTR
              AND MONAT IN S_POPER
             AND BUKRS EQ P_BUKRS
             AND GJAHR EQ P_GJAHR
              AND PRCTR IN S_PRCTR.
    Using the data availabe in the it_bsis, you can manipulate as required.
    Hope this would be helpful
    Regards
    Ramesh Sundaram

  • Multiple line items uploading through LSMW

    Hi,
      I am using LSMW as uploading tool for master data uploading in quality server.In the case of multiple line item i am feeling difficulty to use LSMW.
    Plaese help me to find solution...........

    Hi
    First read all the BOM into an internal table and then you upload that internal table
    LSMW
    https://help.sap.com/saphelp_nw04s/helpdata/en/87/f3ae74e68111d1b3ff006094b944c8/content.htm
    [ BOM UPloading BY  LSMW|LSMW BOM]
    Regards
    pavan

  • Single/ Consolidated  GR/IR entry for a PO having multiple line items

    Hi,
    In a PO there are couple of line items for materials of similar type and class. While making the Goods Receipt, the Accounting Document is making two no of line items for GR/IR accounts as credit and two no of inventory accounts as debit. Same is happening to GR/IR account while making Invoice Receipt document also.
    Informatively, both the materials above have been assigned to one GR/IR account in the OBYC table.
    My question is, is it possible to consolidate the value of both these materials and post one line item for GR/IR account. This is required as in our case in a PO, normally, we do have multiple line items and hence it is resulting multiple no of GR/IR and inventory accounts in a single accounting document. As we are getting details of the line item from PO history, we do not require it in the accounting document.
    Requested to kindly help.
    Regards
    B.Mohanty

    Hi
    This is not possible (you will compleet los the link between the Invoice and GR)
    The reason is that when you receive an invoice that this is based on a G/R line and the way arround when you receive first the invoice(s).
    The system need this for the automatecly clearing from the  G/R - I/R account, that is based on PO an PO line item number.

  • Partial goods receipt for PO with multiple line items

    Hello All,
    While doing MIGO, for a PO with multiple line items, if one line item is having error, will we be able to go ahead with goods receipt? Or entire material document is blocked for doing MIGO?
    We will be doing a development - in case if there is problem in goods receipt (checking of any parameter, and if it is missing - we will be posting error message)...is it possible to ahead with next line item and still post the material document?
    If partial goods receipt if possible for PO with multiple line items, how do we do it?
    Regards,
    RJS

    Hi
    While doing MIGO, for a PO with multiple line items, if one line item is having error, will we be able to go ahead with goods receipt? Or entire material document is blocked for doing MIGO?
    No. You cannot post the MIGO, if even one of the PO line item is having problem or giving error.
    We will be doing a development - in case if there is problem in goods receipt (checking of any parameter, and if it is missing - we will be posting error message)...is it possible to ahead with next line item and still post the material document?
    If you skip a line irem and do GR with next line item, how will you match quantity & value with the vendor Invoice at LIV ?
    If partial goods receipt if possible for PO with multiple line items, how do we do it?
    Partial goods receipt is possible for PO line items. That means, if PO has 100 qty for line item 1 then you can do GR for 50 now and 50 later depending on the vendors delivery.
    Hope this is what you mean by "Partial Goods Receipt".
    Edited by: Arun R on May 10, 2010 2:03 PM

  • Create ecatt script for one sales order creation with multiple line items

    Hi ,
    I want to create a ecatt script for one sales order creation with multiple line items. Preferably SAP GUI.
    This selection of data will be from an external file/ variants which will have only one row of data in it.
    Firstly: I have to sort the external file having same PO Numbers in an order.Group them together.
    Second: I have to create sales order for those many line items having same PO Number.
    Best Regard
    Taranum

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

  • LM46 - Multiple line items into single HU

    Hello,
    I am using Pick & Pack functionality and confirming transfer orders using RF - LM46 transaction.
    During confirmation of transfer order, new HU is getting created for each line item. Is it possible to confirm multiple line items into single HU.
    Is there any setting needs to be done to achieve the same.
    Steps in current process
    - Create transfer order using LT03 or Background job
    - Go to LM46 - enter delivery and packaging material
    - Confirm line item
    - TO item information (Qty & batch) updating back to Delivery along with new HU number
    - Material and qty getting packed to HU correctly..
    As we have several small picks, we don't want new HU to be created automatically. If we can combine multiple TO items into single HU that will be helpful for the process.
    Please let me know if you need further information.
    Thanks in advance,
    Naga Mohan

    Hi Nag,
    I don't believe there is a straightforward way of doing that. The idea behind the design would be (for the two cases mentioned in this thread):
    No HU exists, so new HU is generated during the TO confirmation (by entering only the packing material and $ as the HU number, triggering the label printing for shipping)
    Hu exists, so the user would have the HU in front of them and would be packing directly into it.
    Is your requirement for all deliveries within the warehouse? i.e Each delivery (regardless of the number of transfer orders) should only have one HU assigned?
    Regards
    Stephen

  • Multiple line items in ESERVICE table

    Hi All,
    In production they moved out one BP from a premise and Moved in another BP in that premise.Now when they reverse both Move In and Move out they are getting multiple line items in ESERVICE table.In our case two shipper was created.How to avoid this issue?
    Regards,
    Avishek

    You recieve in reference to the PO, not in reference to the 351 goods issue movements, hence SAP defaults just one item to MIGO.
    If you get the quantity in one physical delivery, how can then the receiver know that it was issued with 3 different material documents?
    if the receiver gets kowledge about 3 different goods issues from the accompaning paperwork then he amend the suggested quantity and post  partial quantities.
    if the goods issue was done with 3 material documents because of a certain reason like different batches, then the receiver can click the distribute icon to distribute the quantity of one item line in MIGO to several lines based on batch numbers.

  • LSMW- Recording : Multiple Line Items

    I am trying to create an LSMW recording that simulates transaction O3I7.
    The thing is that we have different line items. This is similar to a sales order where we have header details and items details.
    I created a recording. Then I created two structures. One header Structure and one Item structure. I define the specific header fields under the header structure and the item fields under the item structure.
    However LSMW gives me an error. Because in LSMW each recording is considered as one target structure. I can't have more source structures than Target structures. Since I have One recording LSMW gives me an error.
    I tried to create two recordings but this does not work since LSMW will read each one as a different transaction.
    Does anyone know how to create LSMW recording with multiple line items so he/she can help?
    Thx

    Hi,
    Not sure about the transaction that you have mentioned. However, in LSMW recording, you can load the items along with the header in 2 steps using 2 data files.
    Step1: Create the header along with the first line item. Here you use a file which contains the header data along with the first line item data.
    Step2. Add subsequent line items to the header. In this case you need to enter the transaction in change mode. The data file may contain items data only. Please be sure to have an identifier at header level to add the items in that specific document.
    Hope this helps.
    Best Regards, Murugesh

  • PO multiple line items -multiple currency

    Hi,
    I had one issue.
    Can I create PO with multiple line items ,with multiple currency ?
    E.g 2 line items one line item with INR and second with USD.
    I tried I am not able to create PO , But its allowing to create the same for Scheduling agreement and Contracts.
    E.g I create a Contract with two line items.
         one line item with INR and second with USD.
        But the Header Currency is fix  either INR or USD whatever u select before creating the contract remanins same and cannot be changed later.
    Q :Is this correct ?
    Q: what will contract vaule in this case in USD or INR .
    Please see if u can add some in puts.
    Thank you
    Regards
    Amar

    Amar,
    You can create a PO with multiple line item, but you can not create the PO with multiple currency.
    Regards,
    Manish

  • Secatt Recording Multiple line items

    Hi all,
    Iam new to secatt.
    Iam having couple of doubts:
    1) We having the scenerios :Creating  script for Purchase,Order. P.O had multiple line item's.I want to creat the script for P.O ,that should work for all line items,each line items had deliery schedule date's
    (The scripts should work for Multiple line items and schedule dates )
    2) How to link the transactions
    ( Eg: In one scripts : creating P.O > Gr Migo > invoice )
    Is it possible?.If its possible pls guide me.I would appriciate, If any input.
    Regards,
    Hareesha k

    Hi Hareesha,
        I don't have any document particularly to this but you can refer to SAP standard eCATT documentation on http://help.sap.com/saphelp_erp2004/helpdata/en/1b/e81c3b84e65e7be10000000a11402f/frameset.htm.
    In case of any specific doubts you can write to me. I am also working on eCATTs.
    Best regards,
    Deepthi

  • Creating POs with multiple line items

    Hi,
    Is it possible to create a PO with multiple line items from the Sharepoint. The developer guide shows sales order creation with a single line item. If yes, please let me know how it can be done.
    Thanks,
    Pranil

    Hi Pranil,
    You can achieve the user case to create a PO with multiple line items in 1 step by creating a custom solution UI in SharePoint. This is not possible if you simply use the out of box UI (as depicted in the guide).
    It depends on how to define the ESR data type. You can create a data type with header details of PO and collection of items with cardinality as 0..n and create a complex BDC model using SPD --> then create a custom UI.
    Other option would be keep it as 2 lists (2 step action). First create a PO header and then add item by item in 2 steps as foreign key relationship. You can see the example of Account and Activity in pre-shipped contents to get an idea.
    Thanks,
    Girimurugan

  • Want to create 1 reciept with multiple line items under a header in APO

    Hi All,
    I am using BAPI_MOSRVAPS_SAVEMULTI3 to create In-Transit which is the reciept element. But it creates only for a single location/product.
    I have a requirement where I have to create multiple line items under 1 intransit order. Can somebody suggest me how to perform this using a BAPI in APO ??
    Best Regards,
    Chandan Dubey

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

  • BDC for F - 43, Multiple posting keys,multiple line items

    Dear gurus,
                     I need to develop a bdc for  F-43, it it working for multiple posting keys with two line items, but not working for multiple line items, can you tell me where to loop the line items.
    regards,
    vidyasagar yadav.

    F-43 is actually FB01 (with two parameters, check it with SE93).
    So you could use the following FMs in sequence to build the BDC :
    POSTING_INTERFACE_START
    POSTING_INTERFACE_DOCUMENT
    POSTING_INTERFACE_END
    Else
    Re-execute transaction SHDB for a document with 2 items and for a document with a dozen items and analyze the result.
    Use a BAPI like BAPI_ACC_INVOICE_RECEIPT_POST or BAPI_ACC_DOCUMENT_POST
    Regards,
    Raymond

Maybe you are looking for