Application Development and Automation 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: 
Read only

Triggerring BADI when using call transaction

Former Member
0 Likes
1,490

Hi All,

I am working on the Notifications. tcode IW52. my requirement is somewhat like this.

when I save the notification a badi NOTIF_EVENT_POST is getting triggerred..

In the badi I am writing some of the validations for the notification. but after the logic execution, it is coming out of transaction.

I want to stop the in tcode IW52 itself. I CAN NOT use Error messages to stop in the same transaction.

So I have written a BDC to again call the transaction IW52. But second time when I call that transaction, BADI is not getting triggered.

This is kind of urgent.. Any suggestions are highly appreciated.

Thanks-

Shrikant

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,182

Hi Shrikant,

I understand that you want to stop the processing in the iw52 itself. and you can not give error messages to stop the processing. and to overcome this you are calling the same transaction through recording.

if you are calling the same transaction,, it will internally create another session and still it will trigger the badi,

As you are saying that the badi is not triggering, I suggest you to put a break point in the begining of the processing block without checking any validations.. may be next time the condition is satisfying..

let me know if my understanding is correct and break point is working fine,

Rahul.

8 REPLIES 8
Read only

Former Member
0 Likes
1,182

hi

it is better to use these bapis Instead of Executing BDC (Call Transaction) you can make use BAPI FM,

" BAPI_ALM_NOTIF_CREATE" for create,

"BAPI_ALM_NOTIF_DATA_MODIFY" for Modify the data.

Regards,

venkat.

Read only

Former Member
0 Likes
1,182

I want to stop the in tcode IW52 itself. I CAN NOT use Error messages to stop in the same transaction.

You can not stop the transaction without triggering error messages. Can you make it clear, what will happen if your validation in that BADI fails?

You should avoid using BDC or BAPI for calling IW52 within IW52.

G@urav.

Read only

0 Likes
1,182

Hi Gaurav Gupta,

If the validation in the BADI fails I need to display the error message,, if I use the message type 'E'. control will be there in the Transaction itself. but this is leading to other consequences like giving some strange system messages related to "Status Management".

So thats the reason I am using messages of type 'I' and 'W', but it is displaying the messages and coming out of the transaction.

So I am using Recording in the BADI itself to again call the same transaction. and this time if I do some changes, it is not triggerring the BADI and not going through the validations.

Thanks-

Shrikant

Read only

0 Likes
1,182

What are those status messages?

Can't we handle those?

Warning and information message won't stop your transaction..it has to be error message there.

BDC/BAPI for the same transaction before completing your first transaction will lead to performance issues.

G@urav.

Read only

Former Member
0 Likes
1,183

Hi Shrikant,

I understand that you want to stop the processing in the iw52 itself. and you can not give error messages to stop the processing. and to overcome this you are calling the same transaction through recording.

if you are calling the same transaction,, it will internally create another session and still it will trigger the badi,

As you are saying that the badi is not triggering, I suggest you to put a break point in the begining of the processing block without checking any validations.. may be next time the condition is satisfying..

let me know if my understanding is correct and break point is working fine,

Rahul.

Read only

0 Likes
1,182

Hi Rahul,,

You were correct,, in the begining of the badi itself there is a condition and it was not executing the logic,, but it was triggerring the badi.

Now how do i overcome the internal session problem..

Please suggest.

Thanks-

Shrikant

Read only

0 Likes
1,182

That depends how you are calling the bdc in your badi..

Create a bdc program and call that program in your badi,, using the keyword 'Submit', When you come out of the program it will automatically close the session and passes the control to the badi..be very careful.

let me know if you have any issues.

Rahul.

Read only

0 Likes
1,182

Thank you all for the helpful response. from here on I can take care