cancel
Showing results for 
Search instead for 
Did you mean: 

wi don't disappear if user cancel the transaction

glauco
Active Contributor
0 Kudos

Frinends,

I'm testing one scene, that the wi calls one transaction, and this transaction calls (by button click) other transaction (MIGO).

If the user cancel the MIGO and go back and exit... I want the wi continue in inbox.

I remember that once a time Ramki answered me to user EXIT_CANCELLED statement in the method, controlled by a variable. But I don't know how to use this statement.

how can I do this ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

In the method the transaction MIGO is called, what you have to program is that after the call something (RC) is evaluated. When it reached your condition that the wi has to remain in the inbox then execute the macro EXIT_CANCELLED

/Peter

glauco
Active Contributor
0 Kudos

Hi Peter,

That's it, but I didn't understand how to do this...

1- I have to create a variable ...

2- if I identify that the user had canceled the transaction, I have to interceptate with the EXIT_CANCELLED macro. But how I call this macro... because I've tested and put it on the end of the method directly, but the wi disapears always.

eg.: (Is this the way to do that ??????)

begin ... method

call ... MIGO

if (some condition, I don't know)

EXIT_CANCELLED.

end if.

end ...method

Please, helpe what to do step-by-step.... I think it isn't so hard to do...

Thanks,

Glauco

ramki_maley
Active Contributor
0 Kudos

Hi Glauco,

I am not sure if you can use EXIT_CANCELLED in this particular situation.

SY-SUBRC is not set for a simple CALL TRANSACTION statement and cannot be checked.

The only way you can verify the user has actually performed a GR is by reading the database but the DB update may not be complete when control returns to your method. I do not recommend it for several reasons. How would you ensure that the agent is actually creating the GR for the required PO/Item?

You can implement the MB_DOCUMENT_BADI and publish a custom event, make your method asynchronous and let the task terminate on the custom event.

Cheers,

Ramki Maley.

Answers (0)