I'm trying to figure out which BAPI/FM I could use to search amounts confirmed based on search criteria of date (+time if possible) and workcenter confirmed where was confirmed...
I would be using BAPI_PRODORDCONF_GETDETAIL which contains these informations, but according to BAPI guide I can only load in the data of confirmation number+confirmation counter.
Therefore the option would be to run BAPI_PRODORDCONF_GETLIST (but I can only input the production order range or confirmation number range), then filter what includes the workcenter and date I need and from those pick up confirmation number+counter and run it through BAPI_PRODORDCONF_GETDETAIL.
- but this procedure of getting list of everything without data being filtered on serverside is extemly timeconsuming and out of SAP Gui I have timeout error... therefore I need any BAPI/FM which I could input the workcenter where was confirmed and date, and have the data filtered already...
Any ideas how to do that?
As far as I know there is no such standard FM, so your only choice is custom development.
I would suggest you
MCPK
transaction were this info is exposed in a handy form, but as I see that your requirement is to receive this info externally this is not appropriate for you.The confirmations reside in
AFRU
table and workcenters are inCRHD
, so to find confirmed quantities by workcenter you should join these tables, or use a viewu_15673
where this info is linked:To pull this externally, you must create RFC-enabled FM or use
RFC_READ_TABLE
and fetch this view with parameters, here is the sample.Another approach is to use
RFC_ABAP_INSTALL_AND_RUN
. You must create an ABAP program that uses WRITE for output the results as a standard list to screen.Send the lines of this program to
RFC_ABAP_INSTALL_AND_RUN
toPROGRAM
parameter and the code will be executed on the remote system and this FM will return screen results as the lines of table WRITES.Possible sample based on MCPK tcode to send to
RFC_ABAP_INSTALL_AND_RUN
:However, this approach is not flexible because
MCPK
standard layout is a bit different than you want, and is not easy to adjust programmatically.Because of that I recommend to stick to the
RFC_READ_TABLE
approach.