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

How to find sy-tcode while running a program in background

Former Member
0 Likes
7,610

How to find sy-tcode while running a program in background

7 REPLIES 7
Read only

Former Member
0 Likes
3,196

Hi,

Would you please let us know what exactly is the requirement ....

because just by writing sy-tcode will also work at the background...

Please be more specific.

Regards,

Siddarth

Read only

Former Member
0 Likes
3,196

Hi Anoop,

Try using sessions method.It give you a detailed log after you finish your Processing.

Or else put a break-point.

Or try capturing the message using table bdcmsgcoll .

Hope it helps!

Much Regards,

Amuktha.

Read only

Former Member
0 Likes
3,196

hi

you can dedug the code....

goto SE37......

In command window type JDBG and start debugging...

there you can find sy-ucomm or sscerfields-ucomm.

regards

Read only

Former Member
0 Likes
3,196

I am running CFM3 from R3 and which will pass the material details in APO side...

for that in APO i have coded in a BADI and its working in Foreground.The check i had added is by using T Code..

But if we run CFM3 in background , sy-tcode will be blank in this case.so the check fails...

Any other way to do the check??

Read only

0 Likes
3,196

hi,,

As soon as you get into the transaction assign sy-tcode to a different variable and then call the badi.... in that badi use the variable which you have declared instead of using sy-tcode.....

Problem might be because when the badi call is made, might be the sy-tcode would have been reinitialized by SAP automatically at the background due to which it can create problems... so its always suggested to capture the system fields in the variable and then use those variable...

So as soon as you enter in the tcode assign the value using

tcode = sy-tcode... and later on give the check when you call the BADI

Regards,

Siddarth

Read only

dev_parbutteea
Active Contributor
0 Likes
3,196

Hi,

Use sy-cyprog which stores the calling program id.

IF SY-CYPROG = 'RIMODAC2'.

....

ENDIF.

NOTE: sy-tcode will not contain the correct transaction code value when run in background.

Regards.

Edited by: Dev Parbutteea on Feb 16, 2009 6:07 AM

Read only

tapomay_sanyal
Participant
0 Likes
3,196

This message was moderated.