Application Development 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: 

A RAISE statmt in prg "SAPLTHFB" raised the excpt condition user_not_found

former_member209912
Participant
0 Kudos

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

1 ACCEPTED SOLUTION

brad_bohn
Active Contributor
0 Kudos

There isn't a note for that. Obviously, you've attempted to raise a popup message in the background - don't do that...

20 REPLIES 20

brad_bohn
Active Contributor
0 Kudos

There isn't a note for that. Obviously, you've attempted to raise a popup message in the background - don't do that...

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

did you run in background in development server? If you did, you'd see the same problem, I think.

0 Kudos

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

Former Member
0 Kudos

I was able to run this in the background and get the message.

Rob

Former Member
0 Kudos

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.

Former Member
0 Kudos

@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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

sorry, guys...spoke out of turn....

Former Member
0 Kudos

Oh I don't know - I think it was your turn

Rob

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Handling exceptions is basic programming. If you search, you'll find lots of examples.

Rob

0 Kudos

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

Former Member
0 Kudos

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

brad_bohn
Active Contributor
0 Kudos

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?

0 Kudos

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

Former Member
0 Kudos

@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