Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete already generated IDoc via user exit ??

Former Member
0 Kudos
236

When I run me84 transaction , IDoc Delfor02 is being generated for output type LPH1 .  I want to delete this IDoc via user-exit ZXM06U59 .

Can anyone give me a sample code to be written in the user-exit ??

1 ACCEPTED SOLUTION

shashank_agarwal
Participant
0 Kudos
119

Hi,

Instead of deleting IDOC , try to disable it's config at the time of creation ,so that it will not create.

Thanks

8 REPLIES 8

shashank_agarwal
Participant
0 Kudos
120

Hi,

Instead of deleting IDOC , try to disable it's config at the time of creation ,so that it will not create.

Thanks

0 Kudos
119

Hi Shashank ..

That sounds good ..

But how do i do that ?

Thanks

0 Kudos
119

You could change set output mode of your IDoc to Collect IDocs in WE20 so it will not be sent automatically.

Then you could schedule executing report RSETESTD in order to delete IDoc messages of required type.

0 Kudos
119

But i want  to control creating of IDocs completely through user-exit and not through any sort of configuration .

is there any way to do that ?

Thanks

0 Kudos
119

If you really want to do it the ABAP way there is BADI called IDOC_CREATION_CHECK. It has one method called IDOC_DATA_CHECK - there you can find changing parameter called CREATE_IDOC - by default it's set to 'X' but if you change its value to '' IDoc will not be generated.

Please remember to check what IDoc is being processed using data from parameter IDOC_CONTROL.

0 Kudos
119

Can we use the above function for transactional data too ? My Idoc is of type delfor02   created during me84(SA release)...

0 Kudos
119

That BADI is executed in FM MASTER_IDOC_DISTRIBUTE so it should influence all outgoing IDoc messages generated in SAP.

Anyway I'm really curious why don't you want to achieve your goal using configuration but you prefer custom code instead?

0 Kudos
119

Hi Bartosz Ziólkowski ,

Writing custom code is my project requirement !!

I implemented using BADI and it worked ..

Thank you for such a clear explanation