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: 

Distinguish NWBC / SAPGUI

Former Member
0 Kudos

Hi all,

I need to have a different behavior in my program, related to the GUI the user is working with. Is there any way to distinguish at runtime between NWBC and standard SAPGUI? We compared a lot of things (system callstack, syst-structure, some nwbc-classes) but didn't find any reliable indicator, that the user is working with Netweaver Business Client.

Any hints would be appreciated. Thanks in advance!

Aaron

5 REPLIES 5

Former Member
0 Kudos

Try to instantiate the NWBC runtime in your ABAP program, it will fail unless you are actually accessing your program with NWBC.

0 Kudos

Thank you for the great idea. CL_NWBC_RUNTIME or CL_NWBC_RUNTIME35 can be instantiated for both cases, and I get back objects with exactly same attributes. So this solution doesn't work for me, unfortunately.

0 Kudos

You can try the following piece of code, it is from SAP Learning Solution:


METHOD check_client_environment.

  DATA: lo_wd_application   TYPE REF TO if_wd_application,

        lv_cl_environment   TYPE        i.

  ev_portal = abap_false.

  lo_wd_application = io_wd_component->get_application( ).

  lv_cl_environment = lo_wd_application->get_client_environment( ).

  IF lv_cl_environment = if_wd_application=>co_client_environment-portal OR

    lv_cl_environment = if_wd_application=>co_client_environment-nwbc.

    ev_portal = abap_true.

  ENDIF.

ENDMETHOD.

former_member204264
Participant
0 Kudos

Hi Aaron,

Try the next:

DATA: gui_exist TYPE c VALUE space.

CALL FUNCTION 'GUI_IS_AVAILABLE'

         IMPORTING

           return = gui_exist.


IF gui_exist IS INITIAL.

    "NWBC

ELSE.

     "SAPGUI

ENDIF.


Regards.

Luis

0 Kudos

Hi,

unfortunately this doesn't work. I always get back the 'X', independent from the GUI I'm using...