01-24-2011 7:00 PM
Hello Team
when i am trying to run a customized job i am getting the below error. i want to know which SAP NOTE i need to apply. i am unable to find the exact note. please help check.
Error analysis
A RAISE statement in the program "SAPLTHFB" raised the exception
condition "USER_NOT_FOUND".
Since the exception was not intercepted by a superior
program, processing was terminated.
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"RAISE_EXCEPTION" " "
"SAPLTHFB" or "LTHFBU43"
"TH_POPUP"
or
"SAPLTHFB" "USER_NOT_FOUND"
or
"ZVSLR_ERRMSG_BACKGRD " "USER_NOT_FOUND"
If you cannot solve the problem yourself and want to send an error.
Pls let me know the correct SAP NOTE.
Reg
Rj
01-24-2011 7:03 PM
There isn't a note for that. Obviously, you've attempted to raise a popup message in the background - don't do that...
01-24-2011 7:03 PM
There isn't a note for that. Obviously, you've attempted to raise a popup message in the background - don't do that...
01-24-2011 7:09 PM
Hello
Thanks for the reply. The same job when i am running in development server it is working fine but in quality only i am getting this message.
Pls check and suggest.
Reg
Rj
01-24-2011 7:13 PM
You are not testing for the exception USER_NOT_FOUND in the calling program. Add that and execute it again.
Additionally, I think the user you are sending the message to has to be logged on in the remote system or else you will get this exception.
Rob
Edited by: Rob Burbank on Jan 24, 2011 2:19 PM
01-24-2011 7:20 PM
did you run in background in development server? If you did, you'd see the same problem, I think.
01-24-2011 7:28 PM
hello
yes, you are correct. just now i have tried in development also and it is giving the same error. so please let me know what the code changes i need to do it now.
I mean what additonal logic i need to avoid this error message.
CALL FUNCTION 'TH_POPUP'
EXPORTING
client = sy-mandt
user = g_user "sy-uname
MESSAGE = g_text.
g_rc = g_shmhandle->free_instance( g_instance ).
Regards
Rj
01-24-2011 7:50 PM
01-24-2011 7:52 PM
SAP 101...no charge...
In background, there is no gui ( aka presentation server or PC). Therefore, avoid at all costs calling screens, calling pop-ups, etc.
wrap your code in if....then....else logic:
if sy-batch eq 'X'. "running in background....
do some alternative...write to spool or something....
else. "not running in background
call your popup.
endif.
01-24-2011 8:01 PM
@BreakPoint - try running this in a simple job (background):
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
CALL FUNCTION 'TH_POPUP'
EXPORTING
client = sy-mandt
user = sy-uname
MESSAGE = 'Test'
EXCEPTIONS
USER_NOT_FOUND = 1
others = 2.
write: /001 sy-subrc.
Rob
01-24-2011 8:28 PM
Hello Rob
Yes, i have tried your program and it is executing fine. It is giving a popup with message and when i go and see the job it got successfull.
So now pls suggest what needs to be done from my side.
I think that IF condition which is mentioned by break-point wil not work for the requirment right.
Please clarify.
Regards
Rj
01-24-2011 8:34 PM
I think that if you get a non-zero return code from the FM, it means the user is not logged in (or doesn't exist), I don't think there's much you can do except note in your report that the user wasn't reached.
Rob
01-24-2011 8:53 PM
01-24-2011 8:58 PM
01-24-2011 9:37 PM
hello both
I am still not clear like what is the code change i need to do. can you please tell me the procedure how to do the required code change.
Rob i didnt understand what is the meaning for the below statement
I think that if you get a non-zero return code from the FM, it means the user is not logged in (or doesn't exist), I don't think there's much you can do except note in your report that the user wasn't reached..
So please suggest me what condition i need to put in my program before or after calling the FM.
call function 'TH_POPUP'.
For me this is the new concept, so please tell me the steps for required code changes in my report.
Regard
Rj
01-24-2011 9:47 PM
Yes, TH_POPUP can be invoked in the background, it uses the task handler to issue the message immediately, without the need for the recipient to press a key. The recipient must be logged on in the right client to see the message, obviously.
As for how to handle exceptions of function modules (or methods), how about searching a little bit yourself for available information, rather than asking to be fed every single detail?
Thomas
01-24-2011 10:01 PM
Handling exceptions is basic programming. If you search, you'll find lots of examples.
Rob
01-24-2011 10:07 PM
Hello all
Great thanks for all your support. I came to know that destination parameter needs to be included to the FM calling as below.
CALL FUNCTION 'TH_POPUP' DESTINATION USR41-SERVER
I dont know whether it will work or not but i will check it and get back with updates.
Reg
Rj
01-24-2011 10:17 PM
I think you're on the right track, but I'm not sure USR41-SERVER will have the correct destination. You want one maintained in SM59.
Rob
01-25-2011 12:01 AM
That makes sense, Thomas - good explanation. I had forgotten about how that little function worked. It sounds like a really BAD (and annoying) approach to job notification though - why would you depend on a user being logged in to the current system to notify them? Why not use SAPOffice and/or email?
01-25-2011 11:54 AM
You're right, these are more robust options. I cannot think of too many serious use cases for TH_POPUP. All those function modules in groups THFB and THFB2 are not released by SAP for customer use anyway, but they're there and of course we play around with them (ever driven your colleagues crazy by using TH_CREATE_FOREIGN_MODE to "magically" start a new session on their screen?)
So if you use these, you'll have to deal with the problems, like our OP here.
Thomas
01-25-2011 2:11 PM
@Rj - I think the verdict is in - find another way to do whgat you want. Have you considered sending an e-mail notification? There are plenty of examples of how to do that in the forum.
Rob