2013 Jul 29 1:30 PM
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
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
2013 Jul 29 1:44 PM
2013 Jul 29 1:53 PM
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.
2013 Jul 29 2:20 PM
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
2013 Jul 29 2:26 PM
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.
2013 Jul 29 2:33 PM
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
2013 Jul 29 2:33 PM
Hi,
Are you not missing the OPCODE value..
DATA: OPCODE_SEND_POP_UP(1) TYPE X VALUE 31.
Cheers,
Arindam
2013 Jul 29 2:35 PM
No - it's declared in include tskhincl 🙂
Maybe there's no way to make my popup "look like I want"
2013 Jul 29 2:26 PM
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
2013 Jul 29 2:30 PM
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/...
2013 Jul 30 6:33 AM
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
2013 Jul 30 6:48 AM
Morning Arindam,
no, sorry, not working...
But thanks for the update!
2016 Feb 04 9:01 AM
Just use SET LOCALE LANGUAGE statement, before call 'TH_POPUP' and set the language that doesn't exist in T100
2016 Feb 04 9:10 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |