‎2005 Jul 01 11:31 AM
Hello everyone!
I'm using BAPI_COPAACTUALS_POSTCOSTDATA to Post Costing-Based Actual Data.
The BAPI is working great, but it does not return the number of the generated document in the RETURN TABLE neiher in the sy-msg* fields.
I want this to display the generated document in the report.
Anyone has any tips on the subject?
Many thanks,
Ivo Martins
‎2005 Oct 27 3:18 PM
I am experiencing the same problem as Ivo Martins; this BAPI appears to be posting correctly, but there is no confirmation in the RETURN table of the BAPI. Does any one have a suggestion ? I have checked OSS, but there does not seem to be any Notes to address this. Seems like all the BAPI's I have used previously provide some confirmation of the posting ( or an error message ) in the RETURN table
Thanks
Larry Parsons
‎2005 Oct 28 10:13 AM
Hello Larry,
I can tell you in advance that there is no workaround for this situation.
The reason for this is not the BAPI itself, but another function that is at a more deep level that does the actual posting.
If you really need the Doc Numbers forget this BAPI.
Use KE21 or something like that.
‎2011 Oct 01 9:43 PM
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/]
‎2012 Apr 17 12:30 PM
Hi Ray,
Thanks alot for the solution, I was facing the same issue, and this comes as a life saver!
Currently my problem is that this select that you have suggested takes alot of time to run. In fact, it takes aroung 99% of the total conversion program runtime. Can you please suggest something to fix this?
Thanks in advance!
Neetha
‎2013 Jan 18 2:20 PM
If you ad an additional characteristic to the where clause for TIMESTMP, and calculate it to be a minute or two prior to your posting, you will significantly speed up the performance....
‎2013 Nov 22 10:46 AM
Hi ,
I found another way to get generated copa document number .
so just sharing here .
kindly check