05-27-2015 10:37 AM
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
05-27-2015 2:03 PM
Try to instantiate the NWBC runtime in your ABAP program, it will fail unless you are actually accessing your program with NWBC.
05-28-2015 4:40 PM
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.
06-15-2015 8:55 PM
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.
05-27-2015 2: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
05-28-2015 4:42 PM
Hi,
unfortunately this doesn't work. I always get back the 'X', independent from the GUI I'm using...