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

Issue In User Exit.

Former Member
0 Likes
975

Dear All ,

I have implemented one User Exit in the transaction JK02. In that I have written a code to send a mail whenever a perticular field is changed in that transaction.

My requirement is that mail sending process should only be tiggered if user is changing the field manually by going to transaction. But that process is also getting triggered whenever that transaction is recorded in BDC and when that BDC is run. I want to prevent it.

Please suggest.

Regards,

Nikhil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
936

Hi

Check like this:

If SY-TCODE = ' JK02'.

Trigger u r logic.

ENDif.

Dear All ,

I have implemented one User Exit in the transaction JK02. In that I have written a code to send a mail whenever a perticular field is changed in that transaction.

My requirement is that mail sending process should only be tiggered if user is changing the field manually by going to transaction. But that process is also getting triggered whenever that transaction is recorded in BDC and when that BDC is run. I want to prevent it.

Please suggest.

Regards,

Nikhil

6 REPLIES 6
Read only

Former Member
0 Likes
937

Hi

Check like this:

If SY-TCODE = ' JK02'.

Trigger u r logic.

ENDif.

Read only

0 Likes
936

I tried using the same.

When BDC is execusting the value in Sy-Tcode is JK02. So I cannot follow this logic.

Regards,

Nikhil

Read only

0 Likes
936

Hi Nikhil Joshi,

This is System field will hold the 'X' if its running under BDC / LSMW.

SYST-BINPT (Program Running Under Batch Input)

So.. your logic should be like..

IF SY-TCODE = 'JK02' and SYST-BINPT NE 'X'.

"     Your Logic here
   ENDIF.

Regards,

Suneel G.

Read only

0 Likes
936

Thank you So Much.

It is working very fine.

Read only

former_member212005
Active Contributor
0 Likes
936

You can use the system variable sy-batch for value 'X'...because i believe that you will be running the BDC programs in background....while when in foreground sy-batch will have value 'space'.

May be you may get much better answer.

Read only

Former Member
0 Likes
936

Dear Nikhil,

Even when you re using BDC the user exit will be hit. I mean your logic will be fired.

as you use call transaction 'JK02' .

But then you can use a combination of

if sy-tcode = 'JK02' and sy-batch ne 'X '.

your logic.

endif.

Regards,

Sai