BAPI_COPAACTUALS_POSTCOSTDATA   Posting document number

Hi,
I am using BAPI  : BAPI_COPAACTUALS_POSTCOSTDATA  for posting documents of type 10, B0 , 12,B2(01,02,03,04 – Paledger no’s).
My requirement is to post records with same document number  for all the 4 currency types in ce10100 table as in screen shot no :
I tried below way
For Paledger number 01 , Belnr is blank and posting document by calling BAPI ,now I am using this posted document number from ce10100 table for rest of the 3 types of documents since my requirement is that I need the same document number for all the 4 types of documents
When I am using this method to post using test run from se37 I am able to post in required way .In my Z Program when i post one document each time by changing currency type(as 10, B0 , 12,B2  )and exit from Program I am able to achieve this functionality but  if I am using same method for multiple records from Internal table it s not working ,it is generating new document number each time when posted as below screen shot
. I am using Transaction Commit also both when testing in Se37 as test run and also in Z Program.
Please help me in this issue.

There is in fact a workaround to this issue.  I see this question asked in lots of places so I figured I would post here:
4) Although the BAPI does not return the resulting document number and the forums say you cannot do it, this is a workaround that is somewhat hardcoding and requires familiarity with the data. In this example, we expect that the ww106 field is a unique value. Indeed, we went so far as to index the CE table. By specifying the ORDER BY clause, we can make sure we grab the most recent entry first. This is captured immediately after calling the BAPI and doing the BAPI_TRANSACTION_COMMIT and WAIT.
CALL FUNCTION 'BAPI...
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
     WAIT = 'X'
SELECT paobjnr pasubnr FROM ce41010 UP TO 1 ROWS
BYPASSING BUFFER
INTO (wa-paobjnr, wa-pasubnr)
WHERE ww100 = itab-key1
AND ww109 = itab-key2
AND ww106 = itab-key3
ORDER BY PAOBJNR DESCENDING PASUBNR DESCENDING
ENDSELECT.
There are a few tips and tricks for working with this BAPI posted here:
[http://raymannion.com/2011/bapi_copaactuals_postcostdata/|http://raymannion.com/2011/bapi_copaactuals_postcostdata/]

Similar Messages

  • How to get FI Doc number for a MM posted document number

    Hi Friends,
    I need info on how to retrieve FI Document number that gets generated for a MM posted document.
    MM Posted document is available in table RBKP-BELNR and FI document number created for this is in table BKPF-BELNR but for a given RBKP-BELNR how to find BKPF-BELNR. I need the relation.
    Any help on this is highly appreciated.
    Thanks,
    Simha

    hi,
    you can get accounting details from  material document in this way.
    DATA: BEGIN OF it_rbkp OCCURS 0,
          belnr LIKE rbkp-belnr,
          bldat LIKE rbkp-bldat,
          xblnr LIKE rbkp-xblnr,
          gjahr LIKE rbkp-gjahr,
          awkey LIKE bkpf-awkey,
          END OF it_rbkp.
    DATA: BEGIN OF it_bkpf_we OCCURS 0,
          belnr LIKE bkpf-belnr,
          awkey LIKE bkpf-awkey,
          END OF it_bkpf_we.
    DATA: BEGIN OF it_mkpf OCCURS 0,
          mblnr LIKE mkpf-mblnr,
          blart LIKE mkpf-blart,
          bldat LIKE mkpf-bldat,
          mjahr LIKE mkpf-mjahr,
          awkey LIKE bkpf-awkey,
          END OF it_mkpf.
      IF NOT it_ekbe[] IS INITIAL.
        SELECT mblnr
               blart
               bldat
               mjahr
               INTO TABLE it_mkpf
               FROM mkpf
               FOR ALL ENTRIES IN it_ekbe
               WHERE mblnr = it_ekbe-belnr
               AND   blart = c_we.
      ENDIF.
      LOOP AT it_mkpf.
        CONCATENATE it_mkpf-mblnr it_mkpf-mjahr INTO it_mkpf-awkey.
        MODIFY it_mkpf TRANSPORTING awkey.
      ENDLOOP.
    IF NOT it_rseg[] IS INITIAL.
        SELECT  belnr
                bldat
                xblnr
                gjahr
                INTO TABLE it_rbkp
                FROM rbkp
                FOR ALL ENTRIES IN it_rseg
                WHERE belnr = it_rseg-belnr.
                  ENDIF.
      LOOP AT it_rbkp.
        CONCATENATE it_rbkp-belnr it_rbkp-gjahr  INTO it_rbkp-awkey.
        MODIFY it_rbkp TRANSPORTING awkey.
      ENDLOOP.
      IF NOT it_mkpf[] IS INITIAL.
        SELECT belnr
               awkey
               INTO TABLE it_bkpf_we
               FROM bkpf
               FOR ALL ENTRIES IN it_mkpf
               WHERE awkey = it_mkpf-awkey.
      ENDIF.

  • Transfer posting document number and Challan in PO history

    Hi,
         I have a requirement, in case of subcontracting PO  the material document movement with which the material is trasnfer to the vendor with PO should come in the PO history,  also the subcontract challan no. in the PO history,  is it possible to see, in PO history,  J1I7  is there for this but we required this in PO history.
    regards,
    zafar

    Hi,
    In PO Hostory, click on "SC COnsumption" option in Change view to see 543 MvT. Subcontracting Challan will not appear in PO History.
    Better refer Report J1IFR.

  • Search based on document number

    Hi,
    I have create transfer posting document number using t-code mb1b , using this  document number how can i ll see all the details like what r materials i moved, which storage location ??
    thanks

    Hi
    You can see the details using MB03 - Display material document
    Use MB51 also , from there it will come back to MB03 screen.
    Thanks & Regards
    Kishore

  • Re:AC_DOCUMENT_DIRECT_INPUT -- Document number

    Hi Experts,
    Can any body please help me , after executing the 'AC_DOCUMENT_DIRECT_INPUT' function module where we find the posted document number (In which table). I have checked the BKPF table but do not find.
    Thanks in Advance.

    taking a wild guess i´d say MKPF and MSEG.
    But well you are a developer, so why dont you just read the coding of your proposed FM a bit and see where he saves the records?

  • Relation between BKPF-BELNR and Clearing document number

    Hi Friends,
    I need one to one relation between Posted document number BKPF-BELNR and
    the clearing document number generated for that (AUGBL).
    I could find BSEG is having the clearing document number in its one of the line item but i don't want to strain my code querying BSEG.
    is there any other way.
    If querying BSEG is the only option, appreciate if any one help me in giving an optimal query( if you have faced the similar requirement)
    Thanks in advance
    Simha

    Hi All,
    Thanks for your help.
    My problem is resolved. I queried BSAK (for my requirement)as suggested by many of you.
    Thanks.
    Simha
    Edited by: Simha on Nov 15, 2008 5:27 AM

  • Cancelling Document number

    Dear Expert,
    Transfer Posting was posted to the System SAP and also print out the document number within material code and quantity. however, some mistake will be occurred during posting, i had posted two material codes but when i canceled one material code in the same document number, the SAP created a new material code but i still print out the old document number within two material indeed.
    Example:
    Transfer Posting Document Number:
    4900000123 has:
    Material Code A----
    2 Unit
    Material Code B----
    3 Unit
    after i cancelled
    4900000124 has
    Material Code A----
    2 Unit
    I print the document number 4900000123 again, two material codes still show up.
    So, how can i block after cancelling one material code from one document number.
    Any suggestion?
    Please give me your idea may you have?
    Best regard,
    Ratana,Cambodia

    hi
    if its a print out please check the logic for printing the material number from the material document.
    if its reversed it should not be printed. change the coding for the printout program.

  • Document number....posted in T Code F-53 is not popping after saving

    Hi,
    I am posting outgoing payment in new fiscal year 1.4.2014, in F-53. After saving the document, I am not getting the pop up message:
    "Document number .... posted in T Code F-53.
    But when I check the GL line item in FBL3N, the document number is visible there.
    Please advice what can be the reason.

    Hi,
    I didnt check with other users. But I am facing this issue. May I know how the Security guy can help me and how its related to my authorization, since until yesterday everything was working fine.
    Kindly advice, is there any link to the year end closing activity?

  • Error  in document number while posting the material

    Dear experts
    while posting the stock  MB1C  for the material  the error  is  " incorrect doc number $  1 .select doc number between   800000100  and 800000199.
    how to  correct  this  error. where  to check this  number ranges  of  document.
    Thanks  &  Regards.
    Erfan.

    Hi
    The document type, which is integrated for Material related posting is appears to be configured as "External Document Number Ranges".  In the event of external number ranges, MM transaction tries to post same document number individually at MM system and propose same number in FI for Accounting Posting.  If the proposed number is not within document number ranges, then you would expect this kind of errors.
    What you need to do is:
    1.  See the document type, which is being posted and set correct number ranges as per MM transaction document type number ranges  or
    2.  change MM transaction number rages in order to FI document number rages
    Hope this helps

  • EBS - Auto posting not working  if text behind the document number

    Hi,
    When the document number is at the end of the payment reference, there is no problem.
        However, when there is text behind the document number, the posting rule doesn't work anymore.
        The autoposting also fails when there is a seperator (like a comma) directly added to the document number.
    -   In the posting rule for invoice numbers (BE51), it is able to find multiple invoice numbers and clear these together.
        We were expecting this posting rule will behave the same, so when a customer mentions more than 1 document number,
        it is able to find them all and clear if they fulfill the criteria (total amount of the documents matches the amount received).
        But because of 1st mentioned problem, system doesn't clear anything because of additional text present.
    I am look help to solve this issue
    Thanks.
    With regards,
    V.K
    Best regards,

    Hi,
    Any input for above issue?
    With regards,
    V.K

  • Drill down on posting date and Document number

    Hello Gurus,
    In a Bex report, I am looking at account balance on a keydate for a G/L Account. When I drill down based on posting date I do not see any values for the keyfigure 'Account balance as on key-date'....But after I drill down on posting date --> document number I get to see values for thie key figure.
    What is this strange behaviour? Kindly explain.
    Regards,
    KP

    Hi KK,
    This may be due to the values/quantities having different UOM or currency for different documents/posting date.For example,  Usually when there are mixed values like this, the aggregated value is not displayed, instead a '*' is displayed in the report result. However there is a setting in BW where you can mention how to handle such mixed values.
    So I suggest you first check the currencies for the amount at the posting date/document level(when you drill down). If they are different then check the settings in the transaction SPRO --> SAP Business Information Warehouse --> Report-relevant settings --> General Reporting settings in the Business Explorer --> Presenting the numeric value in the Business Explorer.
    Here check the value maintained for 'Mixed Values'. If it is blank, then this is the reason that no value is displayed.
    Regards,
    Shilpa

  • Document number on succesful posting thu bapi_repmanconf_create_mts

    Hi,
    I have managed to succesfully post backflushing by determining correct input parameters
    but now i need that after succesful posting, from where can i get the material document number?
    is it available in the parameters of the BAPI or I have to read the table ?
    kindly suggest
    thanks

    requierment was dropped

  • Idoc FIDCCP02 posting skipping document number

    I am using Idoc FIDCCP02 to post FI document. I have to enter value in field E1FIKPF-AWORG, otherwise it does not allow tax code to be used in certain conditions. Filling up filed E1FIKPF-AWORG is working fine and document is being posted. But the issue is that system is skipping one document number for each posting. If field E1FIKPF-AWORG is left blank, than this does not happen.
    Any help please!

    HI Dehra,
        YOu can check if any customizing is done within the IDOC processing function module.
    Or you can to analyse if populating the E1FIKPF-AWORG value creates any extra documents, which are consuming the number range.
    Suggestion: You may get better responses in either FI Forums or ABAP forum.
    Best Regards,
    Ravikanth Talagana

  • Posting MIRO with reference to MIGO document number

    Hi,
    Is there any way of posting a vendor invoice in MIRO, taking MIGO document number as the reference instead of PO or Delivery Note reference?
    Muru

    Hi,
    In MIGO you mention the delivery note in the header part.
    There is a drop down in MIRO transaction where we enter PO number, please check and you will find the "Delivery Note" option in the drop down list.
    you can do the MIRO with reference to this Delivery Note number from this option.
    (Just make sure, that you have selected the "GR based IR" indicator in the PO line item.)
    Doiong MIRO with reference to material document number of MIGO is not possible in standatd SAP.
    Regards,
    Gaurav

  • GR Document number & posting date in drill down option? (Reporting)

    Dear Experts,
                          As im new to reporting,i had a requirement from my client..the question is
    This is with regards to report Order Values on Posting Date (0PUR_C01_Q00021) 
    Can you add GR Document number & posting date in drill down option?
    i guess if i keep both of the in free characteristic,it will be the result,please suggest me on this
    Thanks & Regards,
    Srikant

    Dear Experts,
                            My Client requirement is he want GR Document number and GR Positing Date in the drill down option,im not able to find them in the query designer level. the query is under the cube 0PUR_C01. any suggestions will be a great help..
    Thanks and Regards,
    Srikanth

Maybe you are looking for