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: 

User Popup Message - CALL 'ThUsrInfo' ID 'OPCODE'

michael_fallenbchel
Active Participant
0 Kudos

Hi experts,

I'm playing around with popup messages.

I know function TH_POPUP - everyting's working and fine.

Now I want to do this "part of coding" in my own program - then I can change the text of the popup a little bit.


What I am doing:

REPORT  ztest_user_popup.

INCLUDE tskhincl.

DATA: client LIKE sy-mandt,

          user LIKE sy-uname,

          new_message(512),

          message_len LIKE sy-index,

          loc_cut_blanks  TYPE x VALUE 0.

new_message = 'TEST'.

client = sy-mandt.

user = sy-uname

message_len = STRLEN( new_message ).

loc_cut_blanks = 0.

CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_send_pop_up     "#EC CI_CCALL

       ID 'CLIENT' FIELD client

       ID 'USR' FIELD user

       ID 'MSG' FIELD new_message

       ID 'MSG_LEN' FIELD message_len

       ID 'CUT_BLANKS' FIELD loc_cut_blanks.

BREAK-POINT.

Problem is - nothing is happening! At the break-point at the end, sy-subrc = 1.

What am I doing wrong? Any ideas?

Thanks

Michael

13 REPLIES 13

arindam_m
Active Contributor
0 Kudos

Hi,

May be this thread would help you.

https://scn.sap.com/thread/1393200

Cheers,

Arindam

0 Kudos

Hi Arindam,

no, it's not helpful. I already read this thread, I also tried to copy the program - same result.

I don't know what's the difference between calling the function and doing the program logic directly in my own program. I have absolut the same variables, the same values also...but I don't get any popup, always sy-subrc = 1.

ThomasZloch
Active Contributor
0 Kudos

Officially, these kernel calls are for SAP internal use only. I could well imagine that the underlying procedure checks the call stack or some sort of interface "footprint" and exits right away when not called from a standard function module like TH_POPUP.

The message text is part of the function module interface, so I don't understand why you need to re-create this yourself.

Thomas

0 Kudos

Very easy why I want to do it by myself:

Inthe functino, my message get's concatenatet with some text from T100 ("Message from user &1: &2").

i want to have my own text here - something like "Mesagge from Helpdesk - Pls answer your tickets".

Sure I can change table T100 - But that's not the correct way.

So I tried to create my own function/program to send the message I want to have...

The call stack can be the cause - but then it's very interesting to know how the program in the linked thread from Arindam is working 🙂

Any ideas? Or someone has done this also.

0 Kudos

It is very tempting to play with these TH_-function modules and underlying kernel calls, I have done my own share of this.

However it remains intended only for SAP-internal use, there is almost no public documentation for it, so I'm afraid nobody will be able to tell you why this particular self-made call does not work, as opposed to others, unless there is an obvious mistake like incorrectly declared variables or so.

Thomas

0 Kudos

Hi,

Are you not missing the OPCODE value..

DATA: OPCODE_SEND_POP_UP(1) TYPE X VALUE 31.

Cheers,

Arindam

0 Kudos

No - it's declared in include tskhincl 🙂

Maybe there's no way to make my popup "look like I want"

arindam_m
Active Contributor
0 Kudos

Hi,

I think the best would be to compare the steps with the FM code. Is it failing authorization or some exception that's not happening in the FM. Sometimes users don't have authorization. Try using FM AUTHORITY_CHECK_C_FUNCTION.

http://help.sap.com/abapdocu_70/en/ABAPCALL-.htm

Cheers,

Arindam

0 Kudos

I copied the function TH_POPUP no to ZTH_POPUP.

Same result - isn't working (sy-subrc = 1).

Can't be a problem with authorisations - as the standrad funtion is working with my user...I think Thomas is right with some checks "in the background" again functino group/function name/...

arindam_m
Active Contributor
0 Kudos

Hi,

This might be the missing Authority check in your code that is causing the issue:

AUTHORITY-CHECK OBJECT 'S_ADMI_FCD'
                  ID 'S_ADMI_FCD' FIELD 'POPU'.
         IF SY-SUBRC <> 0.
           RAISE USER_NOT_FOUND.
         ENDIF.

Cheers,

Arindam

0 Kudos

Morning Arindam,

no, sorry, not working...

But thanks for the update!

Former Member
0 Kudos

Just use SET LOCALE LANGUAGE statement, before call 'TH_POPUP' and set the language that doesn't exist in T100

raymond_giuseppi
Active Contributor
0 Kudos

Try to use exact same field definitions than the FM (e.g. message field length = 128 and not 512)

(Also insure you include TSKHINCL in your report for constants)

Regards,

Raymond