Skip to Content
avatar image
Former Member

Distinguish NWBC / SAPGUI

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • May 27, 2015 at 01:03 PM

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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • May 27, 2015 at 01:15 PM

    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

    Add comment
    10|10000 characters needed characters exceeded