We're developing an application in C# which allows the user to park, post, delete etc. invoices in a SAP ERP system.
With FI invoices there is no problem but we encountered some problems with while trying to delete an MM (incoming invoice) with batch input.
When we use following batch input (C# syntax, but you should see what I mean from it) in foreground mode, the invoice can be deleted:
// transaction trans.TCode = "MIR4"; //Begin a new Dynpro trans.AddStepSetNewDynpro("SAPLMR1M", "6150"); trans.AddStepSetCursor("RBKP-GJAHR"); trans.AddStepSetOKCode("/00"); trans.AddStepSetField("RBKP-BELNR", sapno_lrp); trans.AddStepSetField("RBKP-GJAHR", gjahr); //Begin a new Dynpro trans.AddStepSetNewDynpro("SAPLMR1M", "6000"); trans.AddStepSetOKCode("/EDELE");
When we use the same code in background mode, the invoice is not deleted, following error is given by SAP:
Control Framework: Fatal error - GUI cannot be reached (DC 006)
Exception condition "CNTL_ERROR" raised. (SY 002)
The transaction was terminated by the user (00 359)
By another customer we can use the "IncomingInvoice" "DeleteSingle" BAPI for deletion of an MM invoice but this customer has an older SAP release (46C) where "DeleteSingle" isn't available.
Has anybody an idea how background deletion can be performed? Or are there any other ways for the same task?
Thank you for your help.
Edited by: Patric Schielke on Jul 21, 2008 5:52 PM