cancel
Showing results for 
Search instead for 
Did you mean: 

Deletion of open sales orders

Former Member
0 Kudos

Dear all,

we want to delete open sales orders .I searched forum unable to do .Please guide me.

Regards,

Suresh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

You can delete the sales order using transaction VA02, but there should not be any subsequent document is created against it. Please let me know the error message you are still getting unable to delete so.

Deletion /cancellation can only happen even if the subsequent documents are NOT created. After cancelling the invoice and deleting the delivery document, we can set the reason for rejection at the Sales Order Header Level.

Steps:

1. Cancel the invoice through T code VF11

2. Reverse the Goods Issue using VL09, turn the pick quantity u2018zerou2019 in the delivery document

3. Delete the delivery document using VL02n.

4. Finally set the reason for rejection at the Sales Order Header Level. (So Bala, just check the SO you want to delete ever had any subsequent document? )

Note: An Invoice cannot be deleted but canceled. It can only be canceled with (VF11) only if the relevant accounting document is not generated. Generation of accounting document means the value is posted into accounts and G/L accounts are hit.

SAP FI department needs to reverse the accounting doc on a real-time scenario. Only after the accounting doc is reversed invoice can be canceled. Tax documents generated through the Invoice (Tax is maintained on a separate account) also need to be reversed but this is a part of FI so an SD consultant just needs to request the FICO guy to do the reversal

transaction MASS or VA05 you should be able to set the reason for rejection

Former Member
0 Kudos

Hi Vishal,

Thank you for replying me here more than 1lac sales order are there which are open so I cannot delete one by one .Clent dont want see these sales orders in va05 transaction.How to delete these sales orders.Please guide me.

Regards,

Suresh

Former Member
0 Kudos

hi

You can do recording for VA02 for LSMW and delete.

But it is not advicable to delete the sale orders.

Better you assign a reason for rejection and close the sale orders. At a later date, if you want to track these sale orders, it will help.

OR

you can create a CATT procedure for that and delete all of them in one go

Former Member
0 Kudos

hi suresh babu,

easiest way is to write a LSMW if you have one lakh sales orders.

that too you can goto recording method.

i tried and tested in SBX

these are the fields i have taken in recording.

Recording VA02 VA02

VA02 Change Sales Order

SAPMV45A 0102

BDC_CURSOR VBAK-VBELN

BDC_OKCODE =UER1

VBAK-VBELN 789902 VBELN Sales Document

SAPMV45A 4001

BDC_OKCODE /ELOES

balajia

Former Member
0 Kudos

Dear,

I think you can take help your ABAPER.

You can use LSMW for MASS deletion of Sales order, or also use MASS

Transaction. ZVA12_001

referred to below is the LSMW structure creat

ed in step 2 of the LSMW

create process.

Basically, my st

arting doc number was held on a spreadsheet and the end

document numbe

r was held in the LSMW code as below:

DATA: W_VBELN LIKE VBAK-VB

ELN.

W_VBELN = ZVA12_001-VBELN.

DO.

IF

W_VBELN = '9002550000'.

EXIT.

ENDIF.

ZVA12-

VBAK-VBELN = w_VBELN.

transfer_record.

transfer_transac

tion.

add 1 to w_vbeln.

ENDDO.

skip_record.

s

kip_transaction.

The code above just built the document number

s internally by adding 1 to

the preceding document number up until W_V

BELN above.

It was a bit of a quick and nasty, but there was n

o way that I was

downloading 2,000,000+ document numbers into an exter

nal system to

upload back into the LSMW process.

Regards,

Sandip

Former Member
0 Kudos

hi suresh,

sorry for sending this BDC link:

you can use BDC also to delete the sales orders

http://www.sap-basis-abap.com/abap/a-code-for-deletion-of-open-sales-orders.htm

balajia

Answers (1)

Answers (1)

Former Member
0 Kudos

hi suresh babu,

go to VA02 or VA05 - give sales order there.

select the line item and goto sales document and delete.

but SAP will not recommend to delete any of the documents because if you delete the number will be permanently deleted from the data base.

so you can maintain reasons for rejection the document if you want.

balajia