cancel
Showing results for 
Search instead for 
Did you mean: 

How do we know that the current session is WebDynpro or not in ABAP code?

Former Member
0 Kudos

I have got a requirement from user to convert our old ITS program to the WebDynpro. Development has been completed now but there is a problem that with production user roles, they cannot run this transaction since one function module returns authorization error while reading data. This problem never happens in the ITS program.

Finally, we found out that there is a code to skip auth check if it is called from ITS. Inorder to check, it uses function module ITS_PING. This function will return true if the current session is ITS. Anyway, this function does not work with WebDynpro. The sy-tcode is blank for WebDynpro too so I cannot find a way to skip it. This FM is also called by GUI application which requires auth check. We cannot grant that kind of role to all production users as well.

Please let me know if you have solution for this issue (other than use IMPORT/EXPORT).

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can use the static attirbute IS_ACTIVE of the class CL_WEB_DYNPRO to check from within any standard logic if it was called from Web Dynpro:

CL_WEB_DYNPRO=>is_active

Answers (1)

Answers (1)

Former Member
0 Kudos

One more question, if I would like to skip auth check for only specific WebDynpro application, do we have a way to get the current SICF service name? Thank you.

Edited by: T532magic on Nov 20, 2009 6:02 AM

anand_nidamanuru
Active Participant
0 Kudos

The application name is same as the SICF service name.

You can fetch the application name in Webdynpro.

Thanks,

Anand

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There isn't anything in the call stack that will tell you the Web Dynpro Application you are within. As already suggestion you will have to capture that information from within the Web Dynpro ABAP application (via Web Dynpro specific APIs) and then export the value to Memory or store it in a static class attribute to make it available within inner logic.