cancel
Showing results for 
Search instead for 
Did you mean: 

Ways to delete an incoming invoice (MM)

Former Member
0 Kudos

Hello,

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.

Patric

Edited by: Patric Schielke on Jul 21, 2008 5:52 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member197616
Active Contributor
0 Kudos

Hi,

In SAP Transaction code MIR4 is display invoice.MR8M is the transaction code for deleate/cancell the entered invoice.Check this information is helpful or not?

Regards

Former Member
0 Kudos

Thanks for your answer.

I didn't express myself clearly enough, I only want to delete parked invoices, not posted ones. MR8M seems to work only with posted invoices. Is there a similar transaction for deletion of parked MM invoices?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Use transaction MIR7 for deleting the Invoices that are parked.

Thanks & Regards

Kishore

Former Member
0 Kudos

Sorry, that isn't working

MIR7 is switching to MIR4 for this action so I'm where my problem has started.

Former Member
0 Kudos

Hi Patric,

i have a similar problem with the same error message! Have you found a solution?

Thanks and regards

Bastian