[SAP ABAP] 세션 허용갯수 확인 Function
* 가용 세션 체크
CALL FUNCTION 'SPBT_INITIALIZE'
EXPORTING
group_name = pi_rfcgrp
IMPORTING
max_pbt_wps = lv_max_wps
free_pbt_wps = lv_free_wps
EXCEPTIONS
invalid_group_name = 1
internal_error = 2
pbt_env_already_initialized = 3
currently_no_resources_avail = 4
no_pbt_resources_found = 5
cant_init_different_pbt_groups = 6
OTHERS = 7.
CASE sy-subrc.
WHEN: 0.
WHEN: 3.
CALL FUNCTION 'SPBT_GET_CURR_RESOURCE_INFO'
IMPORTING
max_pbt_wps = lv_max_wps
free_pbt_wps = lv_free_wps
EXCEPTIONS
internal_error = 1
pbt_env_not_initialized_yet = 2
OTHERS = 3.
IF sy-subrc <> 0.
CLEAR: lv_max_wps, lv_free_wps.
ENDIF.
WHEN OTHERS.
CLEAR: lv_max_wps, lv_free_wps.
ENDCASE.