
FUNCTION zz_shlp_exit_sm04.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR_T
*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
*"----------------------------------------------------------------------
TYPES: BEGIN OF ty_struc,
timestamp TYPE swftrctxt1,
server_name TYPE ssi_servername,
logon_hdl TYPE ssi_logon_hdl,
logon_id TYPE ssi_logon_id,
session_hdl TYPE ssi_session_hdl,
user_name TYPE ssi_user_name,
logon_type TYPE ssi_logon_type,
logon_sub_type TYPE ssi_logon_sub_type,
tenant TYPE ssi_tenant_id,
request_time TYPE ssi_timestamp,
memory TYPE ssi_memsize,
location_info TYPE ssi_logon_location_info,
application TYPE ssi_application,
application_info TYPE ssi_application_info,
rfc_hdl TYPE ssi_rfc_hdl,
rfc_type TYPE ssi_rfc_type,
trace TYPE ssi_trace_level,
priority TYPE ssi_priority,
memory_brutto TYPE ssi_memsize_brutto,
memory_abap TYPE ssi_memsize_abap,
memory_hyper TYPE ssi_memsize_hyper,
memory_heap TYPE ssi_memsize_heap,
open_tasks TYPE ssi_open_tasks,
act_program TYPE ssi_main_program,
websocket_handle TYPE ssi_websocket_handle,
sap_gui_version TYPE ssi_sap_gui_version,
paging_blocks TYPE ssi_sap_paging_blocks,
state TYPE ssi_logon_state,
client_ip_addr TYPE ssi_logon_client_ip,
END OF ty_struc.
DATA: rc TYPE sy-subrc,
session_list TYPE ssi_session_list,
server_info TYPE REF TO cl_server_info,
lv_record TYPE ty_struc,
lt_record TYPE TABLE OF ty_struc,
time_t_bias TYPE p VALUE '19700101000000'.
CALL FUNCTION 'F4UT_OPTIMIZE_COLWIDTH'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
CHANGING
shlp = shlp
callcontrol = callcontrol.
IF callcontrol-step = 'SELECT'.
TRY.
CREATE OBJECT server_info.
session_list = server_info->get_session_list( with_application_info = 1 ).
CATCH cx_ssi_no_auth.
ENDTRY.
SORT session_list BY tenant user_name.
LOOP AT session_list ASSIGNING FIELD-SYMBOL(<f>).
MOVE-CORRESPONDING <f> TO lv_record.
DATA(r_tstmp) = cl_abap_tstmp=>add(
tstmp = time_t_bias " UTC Time Stamp
secs = <f>-request_time " Time Interval in Seconds
).
CONVERT TIME STAMP r_tstmp TIME ZONE sy-zonlo INTO DATE DATA(dat) TIME DATA(tim).
lv_record-timestamp =
|{ dat(4) }-{ dat+4(2) }-{ dat+6(2) } { tim(2) }:{ tim+2(2) }:{ tim+4(2) }|.
APPEND lv_record TO lt_record.
ENDLOOP.
CALL FUNCTION 'F4UT_RESULTS_MAP'
EXPORTING
* SOURCE_STRUCTURE =
apply_restrictions = 'X'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = lt_record
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 1
OTHERS = 2.
callcontrol-step = 'DISP'.
ENDIF.
ENDFUNCTION.
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml">
<edmx:Include Alias="Aggregation" Namespace="Org.OData.Aggregation.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Authorization.V1.xml">
<edmx:Include Alias="Auth" Namespace="Org.OData.Authorization.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml">
<edmx:Include Alias="Capabilities" Namespace="Org.OData.Capabilities.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470974/Common.xml?api=v2">
<edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470971/Communication.xml?api=v2">
<edmx:Include Alias="Communication" Namespace="com.sap.vocabularies.Communication.v1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml">
<edmx:Include Alias="Measures" Namespace="Org.OData.Measures.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470968/UI.xml?api=v2">
<edmx:Include Alias="UI" Namespace="com.sap.vocabularies.UI.v1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml">
<edmx:Include Alias="Validation" Namespace="Org.OData.Validation.V1"/>
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotations Target="ZSM04_SRV.ZzSm04">
<Annotation Term="UI.SelectionFields">
<Collection>
<PropertyPath>Application</PropertyPath>
<PropertyPath>Timestamp</PropertyPath>
</Collection>
</Annotation>
<Annotation Term="UI.HeaderInfo">
<Record Type="UI.HeaderInfoType">
<PropertyValue Property="TypeName" String="sm04 list"/>
<PropertyValue Property="TypeNamePlural" String="sm04 list"/>
<PropertyValue Property="Title">
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="UserName"/>
</Record>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="UI.Identification">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ServerName"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="UserName"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Tenant"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="LocationInfo"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Application"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ApplicationInfo"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ActProgram"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ClientIpAddr"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Memory"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Timestamp"/>
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.LineItem">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ServerName"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="UserName"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Tenant"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="LocationInfo"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Application"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ApplicationInfo"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ActProgram"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="ClientIpAddr"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Memory"/>
</Record>" "
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Timestamp"/>
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.Facets">
<Collection>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Target" AnnotationPath="@UI.Identification"/>
</Record>
</Collection>
</Annotation>
</Annotations>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
class ZCL_ZSM04_DPC_EXT definition
public
inheriting from ZCL_ZSM04_DPC
create public .
public section.
methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET
redefinition .
methods /IWBEP/IF_SB_GENDPC_SHLP_DATA~GET_SEARCH_HELP_VALUES
redefinition .
protected section.
data MV_SEARCH_STRING type STRING .
private section.
ENDCLASS.
CLASS ZCL_ZSM04_DPC_EXT IMPLEMENTATION.
METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset.
mv_search_string = iv_search_string . "save the default search for later use
TRY.
CALL METHOD super->/iwbep/if_mgw_appl_srv_runtime~get_entityset
EXPORTING
iv_entity_name = iv_entity_name
iv_entity_set_name = iv_entity_set_name
iv_source_name = iv_source_name
it_filter_select_options = it_filter_select_options
it_order = it_order
is_paging = is_paging
it_navigation_path = it_navigation_path
it_key_tab = it_key_tab
iv_filter_string = iv_filter_string
iv_search_string = iv_search_string
io_tech_request_context = io_tech_request_context
IMPORTING
er_entityset = er_entityset
es_response_context = es_response_context.
CATCH /iwbep/cx_mgw_busi_exception .
CATCH /iwbep/cx_mgw_tech_exception .
ENDTRY.
ENDMETHOD.
METHOD /iwbep/if_sb_gendpc_shlp_data~get_search_help_values.
DATA: lt_selopt TYPE ddshselops .
lt_selopt[] = it_selopt[] .
* map the default search field to UserName
IF NOT mv_search_string IS INITIAL.
APPEND INITIAL LINE TO lt_selopt ASSIGNING FIELD-SYMBOL(<f_sel>).
<f_sel>-shlpfield = 'USER_NAME' .
<f_sel>-shlpname = iv_shlp_name .
<f_sel>-sign = 'I'.
<f_sel>-low = mv_search_string.
IF mv_search_string CA '*'.
<f_sel>-option = 'CP'.
ELSE.
<f_sel>-option = 'EQ'.
ENDIF.
ENDIF.
CALL METHOD super->/iwbep/if_sb_gendpc_shlp_data~get_search_help_values
EXPORTING
iv_shlp_name = iv_shlp_name
iv_maxrows = 9999
iv_sort = space
iv_call_shlt_exit = 'X'
it_selopt = lt_selopt
IMPORTING
et_return_list = et_return_list
es_message = es_message.
ENDMETHOD.
ENDCLASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
20 | |
19 | |
9 | |
7 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |