cancel
Showing results for 
Search instead for 
Did you mean: 

Create an IDOC DELVRY** when a delivery is deleted

Former Member
0 Kudos

Hi,

We are interfacing our outbound deliveries to a Transport Management System. What is the standard best SAP way to generate an IDOC when a delivery is completely deleted ? I know in my IDOC I have to have the QUAL DEL in E1EDL18 segment but how can I create an IDOC when a delivery is deleted and have this qualifier set in the segment.

Thanks for your help. I have searched for this a long time and did not find an interesting solution that is simple and uses SAP standard way with output type.

rangaswamy_govindaraj
Participant
0 Kudos

Hi, This is thread is posted quite a some time before. But, i have a similar situation and wondering how you resolved it ? Appreciated if you could share the solution.

Lakshmipathi
Active Contributor
0 Kudos

Thanks for coming to SAP Community for answers. If your individual matter differs from the original question raised, please post your question as a new question here:
https://answers.sap.com/questions/ask.htmlSince you're new in asking questions here, check out our tutorial about asking and answering questions (if you haven't already), as it provides tips for preparing questions more effectively, that draw responses from our members.

0 Kudos

I have seen numerous questions about this however no resolution. I too had the need to submit an IDOC to our external warehouse when deliveries were deleted. My means to accomplish this was done in user exit FORM userexit_delete_document. MV50AFZ1.Essentially during deletion I create a NAST entry for my output type with timing 1 (periodic job), processed the output with RSNAST00 than allow SAP to continue with deletion process. I also modified delivery qty's to zero so IDOC value 0 would be indicator for external system to delete as well. hope this helps someone else. Below is the logic

*this process only relevent for shipping point OAK1 and OAK2.

if LIKP-VSTEL = 'OAK1' or LIKP-VSTEL = 'OAK2'.

*build new nast entry ZOAK with vstyp = 1 (send with periodic job)

*build work area

data znast type nast.

*populate work area

znast-mandt = sy-mandt.

znast-kappl = 'V2'.

znast-objky = likp-vbeln.

znast-kschl = 'ZOAK'.

znast-spras = 'E'.

znast-parnr = 'ABCpartner'.

znast-parvw = 'LS'.

znast-erdat = sy-datum.

znast-eruhr = sy-uzeit.

znast-nacha = '6'.

znast-anzal = '0'.

znast-vsztp = '1'.

znast-manue = 'X'.

znast-usnam = sy-uname.

znast-vstat = '0'.

znast-nauto = 'X'.

znast-objtype = 'LIKP'.

*update nast table from work area

insert nast from znast.

*build work area for lips update

data wa type lips.

*change delivery quantity and weight to 0.

move lips to wa.

wa-lfimg = 0.

wa-brgew = 0.

wa-ntgew = 0.

wa-lgmng = 0.

*update lips from work area

update lips from wa.

*set values to pass to RSNAST00 to process output entered from znast work area

ranges kappl for nast-kappl.

*kappl-sign = 'I'.

kappl-option = 'EQ'.

kappl-low = 'V2'.

append kappl.

ranges s_objky for nast-objky.

*s_objky-sign = 'I'.

s_objky-option = 'EQ'.

s_objky-low = likp-vbeln.

append s_objky.

ranges s_kschl for nast-kschl.

*s_kschl-sign = 'I'.

s_kschl-option = 'EQ'.

s_kschl-low = 'ZOAK'.

append s_kschl.

ranges s_nacha for nast-nacha.

*s_nacha-sign = 'I'.

s_nacha-option = 'EQ'.

s_nacha-low = '6'.

append s_nacha.

.

*temporarily unlock delivery

call function 'DEQUEUE_EVVBLKE'

exporting

vbeln = likp-vbeln

exceptions

foreign_lock = 2

system_failure = 3.

*process new ZOAK output

submit rsnast00

with s_KAPPL in kappl

with s_objky in s_objky

with s_kschl in s_kschl

with s_nacha in s_nacha

and return.

*remove nast entry previously created. standard functionality clears nast

*during delivery deletion. our manually created entry does not delete

*so we delete it here.

delete nast from znast.

break-point.

*reset lock on delivery.

call function 'ENQUEUE_EVVBLKE'

exporting

vbeln = likp-vbeln

exceptions

foreign_lock = 2

system_failure = 3.

endif.

endif.

ENDFORM. "USEREXIT_DELETE_DOCUMENT

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Myriam,

There is another way how we can consider a delivery as a cancelled delivery.

-> Do not delete the delivery, just delete the line item in it.

-> On saving, you will see all related entries from VBFA vanishes, so ideally your

    delivery is not relating to any SO/STO, and will also not block any stock.

-> This is considered as a cancelled delivery.

-> When this is done, you can configure a output type which will trigger the change IDOC

-> If that IDOC contains a "Del" in its qualifier, it will let your Transport Management system

    understand that this delivery has been deleted.

This is one of the best practises in industry, we donot want a delivery deletion from LIKP -> such cases

give rise to questions in financial audit 

hope this helps !

Regards

Subhajit

Former Member
0 Kudos

Hi,

That is really an interesting solution. I love it. I will test it for sure.

Thanks for the suggestion.

regards

Myriam

Former Member
0 Kudos

Hi,

In the case only one line is deleted but not the entire delivery.

I tested a line deletion in a delivery but the IDOC is created without the line and the line deleted is not included in the IDOC. What segment and field for line item is used to specify that a line is deleted ?

Thanks

Myriam

0 Kudos

Hi Myriam,

Check the segment E1EDL19 which is a segment for IDOC: Controlling (Delivery Item).

Thanks

Nagaraj

Jelena
Active Contributor
0 Kudos

Good question. Well, it seems that output is not triggered when delivery is deleted, so your options would be either this one or this one. But I would send a message to SAP about this. If the IDoc is meant to track changes then there should be a way to track deletions too. I'm 99% sure you'll get "it's design" response, but doesn't hurt to ask.