cancel
Showing results for 
Search instead for 
Did you mean: 

get_client_environment from NWBC in WD4A

0 Kudos
59

Hi Expert,

Thread http://scn.sap.com/thread/3736801 referred.

However, When an WDA4 is called with following detailed.

lo_cmp_api = wd_this->wd_get_api( ).

lo_wd_appl = lo_cmp_api->get_application( ).

ld_client = lo_wd_appl->get_client_environment().

* Determine Client Type

If ld_client = 4.

     lv_isnwbc = 'X'.

ElseIF ld_client = 2.

     lv_isportal = 'X'.

Else.

     Clear lv_isnwbc.

ENDIF.

May I know why the result return 2 rather than 4 when call from NWBC?

Regards,

Matthew

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

HI All,

After further study, when a following is called instead

Data: lr_cmp_api     type ref to if_wd_component,

          lr_application type  ref to if_wd_application.

lr_cmp_api      =  wd_this->wd_get_api() .

lr_application  =  lr_cmp_api->get_application() .

CALL Method cl_apd_lpd_launch_utilities=>get_client_environment

   export

      ir_wd_application    = lr_application

   receiving

     ed_client_environment   = ed_client_environment .

Then ed_client_environment = "NWBC_3"

Is it the correct way to check for what enviroment the WD4A is running on?

Former Member
0 Kudos

In order to determine whether NWBC is used or not, try to instantiate the NWBC runtime. It will fail if the used client is anything besides NWBC. Once instantiated, you can query the runtime version (and patch level).


data lo_runtime35 type ref to if_nwbc_runtime35.

try.

    lo_runtime35 ?= cl_nwbc_factory=>get_nwbc_runtime( ).

    if lo_runtime35 is bound.

* NWBC present

    endif.

  catch cx_sy_move_cast_error.

endtry.